mdfld_dsi_output.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * Copyright © 2010 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors:
  24. * jim liu <jim.liu@intel.com>
  25. * Jackie Li<yaodong.li@intel.com>
  26. */
  27. #include <linux/delay.h>
  28. #include <linux/moduleparam.h>
  29. #include <linux/pm_runtime.h>
  30. #include <linux/gpio/consumer.h>
  31. #include <asm/intel_scu_ipc.h>
  32. #include "mdfld_dsi_dpi.h"
  33. #include "mdfld_dsi_output.h"
  34. #include "mdfld_dsi_pkg_sender.h"
  35. #include "mdfld_output.h"
  36. #include "tc35876x-dsi-lvds.h"
  37. /* get the LABC from command line. */
  38. static int LABC_control = 1;
  39. #ifdef MODULE
  40. module_param(LABC_control, int, 0644);
  41. #else
  42. static int __init parse_LABC_control(char *arg)
  43. {
  44. /* LABC control can be passed in as a cmdline parameter */
  45. /* to enable this feature add LABC=1 to cmdline */
  46. /* to disable this feature add LABC=0 to cmdline */
  47. if (!arg)
  48. return -EINVAL;
  49. if (!strcasecmp(arg, "0"))
  50. LABC_control = 0;
  51. else if (!strcasecmp(arg, "1"))
  52. LABC_control = 1;
  53. return 0;
  54. }
  55. early_param("LABC", parse_LABC_control);
  56. #endif
  57. /**
  58. * Check and see if the generic control or data buffer is empty and ready.
  59. */
  60. void mdfld_dsi_gen_fifo_ready(struct drm_device *dev, u32 gen_fifo_stat_reg,
  61. u32 fifo_stat)
  62. {
  63. u32 GEN_BF_time_out_count;
  64. /* Check MIPI Adatper command registers */
  65. for (GEN_BF_time_out_count = 0;
  66. GEN_BF_time_out_count < GEN_FB_TIME_OUT;
  67. GEN_BF_time_out_count++) {
  68. if ((REG_READ(gen_fifo_stat_reg) & fifo_stat) == fifo_stat)
  69. break;
  70. udelay(100);
  71. }
  72. if (GEN_BF_time_out_count == GEN_FB_TIME_OUT)
  73. DRM_ERROR("mdfld_dsi_gen_fifo_ready, Timeout. gen_fifo_stat_reg = 0x%x.\n",
  74. gen_fifo_stat_reg);
  75. }
  76. /**
  77. * Manage the DSI MIPI keyboard and display brightness.
  78. * FIXME: this is exported to OSPM code. should work out an specific
  79. * display interface to OSPM.
  80. */
  81. void mdfld_dsi_brightness_init(struct mdfld_dsi_config *dsi_config, int pipe)
  82. {
  83. struct mdfld_dsi_pkg_sender *sender =
  84. mdfld_dsi_get_pkg_sender(dsi_config);
  85. struct drm_device *dev;
  86. struct drm_psb_private *dev_priv;
  87. u32 gen_ctrl_val;
  88. if (!sender) {
  89. DRM_ERROR("No sender found\n");
  90. return;
  91. }
  92. dev = sender->dev;
  93. dev_priv = dev->dev_private;
  94. /* Set default display backlight value to 85% (0xd8)*/
  95. mdfld_dsi_send_mcs_short(sender, write_display_brightness, 0xd8, 1,
  96. true);
  97. /* Set minimum brightness setting of CABC function to 20% (0x33)*/
  98. mdfld_dsi_send_mcs_short(sender, write_cabc_min_bright, 0x33, 1, true);
  99. /* Enable backlight or/and LABC */
  100. gen_ctrl_val = BRIGHT_CNTL_BLOCK_ON | DISPLAY_DIMMING_ON |
  101. BACKLIGHT_ON;
  102. if (LABC_control == 1)
  103. gen_ctrl_val |= DISPLAY_DIMMING_ON | DISPLAY_BRIGHTNESS_AUTO
  104. | GAMMA_AUTO;
  105. if (LABC_control == 1)
  106. gen_ctrl_val |= AMBIENT_LIGHT_SENSE_ON;
  107. dev_priv->mipi_ctrl_display = gen_ctrl_val;
  108. mdfld_dsi_send_mcs_short(sender, write_ctrl_display, (u8)gen_ctrl_val,
  109. 1, true);
  110. mdfld_dsi_send_mcs_short(sender, write_ctrl_cabc, UI_IMAGE, 1, true);
  111. }
  112. void mdfld_dsi_brightness_control(struct drm_device *dev, int pipe, int level)
  113. {
  114. struct mdfld_dsi_pkg_sender *sender;
  115. struct drm_psb_private *dev_priv;
  116. struct mdfld_dsi_config *dsi_config;
  117. u32 gen_ctrl_val = 0;
  118. int p_type = TMD_VID;
  119. if (!dev || (pipe != 0 && pipe != 2)) {
  120. DRM_ERROR("Invalid parameter\n");
  121. return;
  122. }
  123. p_type = mdfld_get_panel_type(dev, 0);
  124. dev_priv = dev->dev_private;
  125. if (pipe)
  126. dsi_config = dev_priv->dsi_configs[1];
  127. else
  128. dsi_config = dev_priv->dsi_configs[0];
  129. sender = mdfld_dsi_get_pkg_sender(dsi_config);
  130. if (!sender) {
  131. DRM_ERROR("No sender found\n");
  132. return;
  133. }
  134. gen_ctrl_val = (level * 0xff / MDFLD_DSI_BRIGHTNESS_MAX_LEVEL) & 0xff;
  135. dev_dbg(sender->dev->dev, "pipe = %d, gen_ctrl_val = %d.\n",
  136. pipe, gen_ctrl_val);
  137. if (p_type == TMD_VID) {
  138. /* Set display backlight value */
  139. mdfld_dsi_send_mcs_short(sender, tmd_write_display_brightness,
  140. (u8)gen_ctrl_val, 1, true);
  141. } else {
  142. /* Set display backlight value */
  143. mdfld_dsi_send_mcs_short(sender, write_display_brightness,
  144. (u8)gen_ctrl_val, 1, true);
  145. /* Enable backlight control */
  146. if (level == 0)
  147. gen_ctrl_val = 0;
  148. else
  149. gen_ctrl_val = dev_priv->mipi_ctrl_display;
  150. mdfld_dsi_send_mcs_short(sender, write_ctrl_display,
  151. (u8)gen_ctrl_val, 1, true);
  152. }
  153. }
  154. static int mdfld_dsi_get_panel_status(struct mdfld_dsi_config *dsi_config,
  155. u8 dcs, u32 *data, bool hs)
  156. {
  157. struct mdfld_dsi_pkg_sender *sender
  158. = mdfld_dsi_get_pkg_sender(dsi_config);
  159. if (!sender || !data) {
  160. DRM_ERROR("Invalid parameter\n");
  161. return -EINVAL;
  162. }
  163. return mdfld_dsi_read_mcs(sender, dcs, data, 1, hs);
  164. }
  165. int mdfld_dsi_get_power_mode(struct mdfld_dsi_config *dsi_config, u32 *mode,
  166. bool hs)
  167. {
  168. if (!dsi_config || !mode) {
  169. DRM_ERROR("Invalid parameter\n");
  170. return -EINVAL;
  171. }
  172. return mdfld_dsi_get_panel_status(dsi_config, 0x0a, mode, hs);
  173. }
  174. /*
  175. * NOTE: this function was used by OSPM.
  176. * TODO: will be removed later, should work out display interfaces for OSPM
  177. */
  178. void mdfld_dsi_controller_init(struct mdfld_dsi_config *dsi_config, int pipe)
  179. {
  180. if (!dsi_config || ((pipe != 0) && (pipe != 2))) {
  181. DRM_ERROR("Invalid parameters\n");
  182. return;
  183. }
  184. mdfld_dsi_dpi_controller_init(dsi_config, pipe);
  185. }
  186. static void mdfld_dsi_connector_save(struct drm_connector *connector)
  187. {
  188. }
  189. static void mdfld_dsi_connector_restore(struct drm_connector *connector)
  190. {
  191. }
  192. /* FIXME: start using the force parameter */
  193. static enum drm_connector_status
  194. mdfld_dsi_connector_detect(struct drm_connector *connector, bool force)
  195. {
  196. struct mdfld_dsi_connector *dsi_connector
  197. = mdfld_dsi_connector(connector);
  198. dsi_connector->status = connector_status_connected;
  199. return dsi_connector->status;
  200. }
  201. static int mdfld_dsi_connector_set_property(struct drm_connector *connector,
  202. struct drm_property *property,
  203. uint64_t value)
  204. {
  205. struct drm_encoder *encoder = connector->encoder;
  206. if (!strcmp(property->name, "scaling mode") && encoder) {
  207. struct gma_crtc *gma_crtc = to_gma_crtc(encoder->crtc);
  208. bool centerechange;
  209. uint64_t val;
  210. if (!gma_crtc)
  211. goto set_prop_error;
  212. switch (value) {
  213. case DRM_MODE_SCALE_FULLSCREEN:
  214. break;
  215. case DRM_MODE_SCALE_NO_SCALE:
  216. break;
  217. case DRM_MODE_SCALE_ASPECT:
  218. break;
  219. default:
  220. goto set_prop_error;
  221. }
  222. if (drm_object_property_get_value(&connector->base, property, &val))
  223. goto set_prop_error;
  224. if (val == value)
  225. goto set_prop_done;
  226. if (drm_object_property_set_value(&connector->base,
  227. property, value))
  228. goto set_prop_error;
  229. centerechange = (val == DRM_MODE_SCALE_NO_SCALE) ||
  230. (value == DRM_MODE_SCALE_NO_SCALE);
  231. if (gma_crtc->saved_mode.hdisplay != 0 &&
  232. gma_crtc->saved_mode.vdisplay != 0) {
  233. if (centerechange) {
  234. if (!drm_crtc_helper_set_mode(encoder->crtc,
  235. &gma_crtc->saved_mode,
  236. encoder->crtc->x,
  237. encoder->crtc->y,
  238. encoder->crtc->primary->fb))
  239. goto set_prop_error;
  240. } else {
  241. const struct drm_encoder_helper_funcs *funcs =
  242. encoder->helper_private;
  243. funcs->mode_set(encoder,
  244. &gma_crtc->saved_mode,
  245. &gma_crtc->saved_adjusted_mode);
  246. }
  247. }
  248. } else if (!strcmp(property->name, "backlight") && encoder) {
  249. if (drm_object_property_set_value(&connector->base, property,
  250. value))
  251. goto set_prop_error;
  252. else
  253. gma_backlight_set(encoder->dev, value);
  254. }
  255. set_prop_done:
  256. return 0;
  257. set_prop_error:
  258. return -1;
  259. }
  260. static void mdfld_dsi_connector_destroy(struct drm_connector *connector)
  261. {
  262. struct mdfld_dsi_connector *dsi_connector =
  263. mdfld_dsi_connector(connector);
  264. struct mdfld_dsi_pkg_sender *sender;
  265. if (!dsi_connector)
  266. return;
  267. drm_connector_unregister(connector);
  268. drm_connector_cleanup(connector);
  269. sender = dsi_connector->pkg_sender;
  270. mdfld_dsi_pkg_sender_destroy(sender);
  271. kfree(dsi_connector);
  272. }
  273. static int mdfld_dsi_connector_get_modes(struct drm_connector *connector)
  274. {
  275. struct mdfld_dsi_connector *dsi_connector =
  276. mdfld_dsi_connector(connector);
  277. struct mdfld_dsi_config *dsi_config =
  278. mdfld_dsi_get_config(dsi_connector);
  279. struct drm_display_mode *fixed_mode = dsi_config->fixed_mode;
  280. struct drm_display_mode *dup_mode = NULL;
  281. struct drm_device *dev = connector->dev;
  282. if (fixed_mode) {
  283. dev_dbg(dev->dev, "fixed_mode %dx%d\n",
  284. fixed_mode->hdisplay, fixed_mode->vdisplay);
  285. dup_mode = drm_mode_duplicate(dev, fixed_mode);
  286. drm_mode_probed_add(connector, dup_mode);
  287. return 1;
  288. }
  289. DRM_ERROR("Didn't get any modes!\n");
  290. return 0;
  291. }
  292. static enum drm_mode_status mdfld_dsi_connector_mode_valid(struct drm_connector *connector,
  293. struct drm_display_mode *mode)
  294. {
  295. struct mdfld_dsi_connector *dsi_connector =
  296. mdfld_dsi_connector(connector);
  297. struct mdfld_dsi_config *dsi_config =
  298. mdfld_dsi_get_config(dsi_connector);
  299. struct drm_display_mode *fixed_mode = dsi_config->fixed_mode;
  300. if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
  301. return MODE_NO_DBLESCAN;
  302. if (mode->flags & DRM_MODE_FLAG_INTERLACE)
  303. return MODE_NO_INTERLACE;
  304. /**
  305. * FIXME: current DC has no fitting unit, reject any mode setting
  306. * request
  307. * Will figure out a way to do up-scaling(panel fitting) later.
  308. **/
  309. if (fixed_mode) {
  310. if (mode->hdisplay != fixed_mode->hdisplay)
  311. return MODE_PANEL;
  312. if (mode->vdisplay != fixed_mode->vdisplay)
  313. return MODE_PANEL;
  314. }
  315. return MODE_OK;
  316. }
  317. static struct drm_encoder *mdfld_dsi_connector_best_encoder(
  318. struct drm_connector *connector)
  319. {
  320. struct mdfld_dsi_connector *dsi_connector =
  321. mdfld_dsi_connector(connector);
  322. struct mdfld_dsi_config *dsi_config =
  323. mdfld_dsi_get_config(dsi_connector);
  324. return &dsi_config->encoder->base.base;
  325. }
  326. /*DSI connector funcs*/
  327. static const struct drm_connector_funcs mdfld_dsi_connector_funcs = {
  328. .dpms = drm_helper_connector_dpms,
  329. .detect = mdfld_dsi_connector_detect,
  330. .fill_modes = drm_helper_probe_single_connector_modes,
  331. .set_property = mdfld_dsi_connector_set_property,
  332. .destroy = mdfld_dsi_connector_destroy,
  333. };
  334. /*DSI connector helper funcs*/
  335. static const struct drm_connector_helper_funcs
  336. mdfld_dsi_connector_helper_funcs = {
  337. .get_modes = mdfld_dsi_connector_get_modes,
  338. .mode_valid = mdfld_dsi_connector_mode_valid,
  339. .best_encoder = mdfld_dsi_connector_best_encoder,
  340. };
  341. static int mdfld_dsi_get_default_config(struct drm_device *dev,
  342. struct mdfld_dsi_config *config, int pipe)
  343. {
  344. if (!dev || !config) {
  345. DRM_ERROR("Invalid parameters");
  346. return -EINVAL;
  347. }
  348. config->bpp = 24;
  349. if (mdfld_get_panel_type(dev, pipe) == TC35876X)
  350. config->lane_count = 4;
  351. else
  352. config->lane_count = 2;
  353. config->channel_num = 0;
  354. if (mdfld_get_panel_type(dev, pipe) == TMD_VID)
  355. config->video_mode = MDFLD_DSI_VIDEO_NON_BURST_MODE_SYNC_PULSE;
  356. else if (mdfld_get_panel_type(dev, pipe) == TC35876X)
  357. config->video_mode =
  358. MDFLD_DSI_VIDEO_NON_BURST_MODE_SYNC_EVENTS;
  359. else
  360. config->video_mode = MDFLD_DSI_VIDEO_BURST_MODE;
  361. return 0;
  362. }
  363. int mdfld_dsi_panel_reset(struct drm_device *ddev, int pipe)
  364. {
  365. struct device *dev = ddev->dev;
  366. struct gpio_desc *gpiod;
  367. /*
  368. * Raise the GPIO reset line for the corresponding pipe to HIGH,
  369. * this is probably because it is active low so this takes the
  370. * respective pipe out of reset. (We have no code to put it back
  371. * into reset in this driver.)
  372. */
  373. switch (pipe) {
  374. case 0:
  375. gpiod = gpiod_get(dev, "dsi-pipe0-reset", GPIOD_OUT_HIGH);
  376. if (IS_ERR(gpiod))
  377. return PTR_ERR(gpiod);
  378. break;
  379. case 2:
  380. gpiod = gpiod_get(dev, "dsi-pipe2-reset", GPIOD_OUT_HIGH);
  381. if (IS_ERR(gpiod))
  382. return PTR_ERR(gpiod);
  383. break;
  384. default:
  385. DRM_DEV_ERROR(dev, "Invalid output pipe\n");
  386. return -EINVAL;
  387. }
  388. gpiod_put(gpiod);
  389. /* Flush posted writes on the device */
  390. gpiod = gpiod_get(dev, "dsi-pipe0-reset", GPIOD_ASIS);
  391. if (IS_ERR(gpiod))
  392. return PTR_ERR(gpiod);
  393. gpiod_get_value(gpiod);
  394. gpiod_put(gpiod);
  395. return 0;
  396. }
  397. /*
  398. * MIPI output init
  399. * @dev drm device
  400. * @pipe pipe number. 0 or 2
  401. * @config
  402. *
  403. * Do the initialization of a MIPI output, including create DRM mode objects
  404. * initialization of DSI output on @pipe
  405. */
  406. void mdfld_dsi_output_init(struct drm_device *dev,
  407. int pipe,
  408. const struct panel_funcs *p_vid_funcs)
  409. {
  410. struct mdfld_dsi_config *dsi_config;
  411. struct mdfld_dsi_connector *dsi_connector;
  412. struct drm_connector *connector;
  413. struct mdfld_dsi_encoder *encoder;
  414. struct drm_psb_private *dev_priv = dev->dev_private;
  415. struct panel_info dsi_panel_info;
  416. u32 width_mm, height_mm;
  417. dev_dbg(dev->dev, "init DSI output on pipe %d\n", pipe);
  418. if (pipe != 0 && pipe != 2) {
  419. DRM_ERROR("Invalid parameter\n");
  420. return;
  421. }
  422. /*create a new connector*/
  423. dsi_connector = kzalloc(sizeof(struct mdfld_dsi_connector), GFP_KERNEL);
  424. if (!dsi_connector) {
  425. DRM_ERROR("No memory");
  426. return;
  427. }
  428. dsi_connector->pipe = pipe;
  429. dsi_config = kzalloc(sizeof(struct mdfld_dsi_config),
  430. GFP_KERNEL);
  431. if (!dsi_config) {
  432. DRM_ERROR("cannot allocate memory for DSI config\n");
  433. goto dsi_init_err0;
  434. }
  435. mdfld_dsi_get_default_config(dev, dsi_config, pipe);
  436. dsi_connector->private = dsi_config;
  437. dsi_config->changed = 1;
  438. dsi_config->dev = dev;
  439. dsi_config->fixed_mode = p_vid_funcs->get_config_mode(dev);
  440. if (p_vid_funcs->get_panel_info(dev, pipe, &dsi_panel_info))
  441. goto dsi_init_err0;
  442. width_mm = dsi_panel_info.width_mm;
  443. height_mm = dsi_panel_info.height_mm;
  444. dsi_config->mode = dsi_config->fixed_mode;
  445. dsi_config->connector = dsi_connector;
  446. if (!dsi_config->fixed_mode) {
  447. DRM_ERROR("No panel fixed mode was found\n");
  448. goto dsi_init_err0;
  449. }
  450. if (pipe && dev_priv->dsi_configs[0]) {
  451. dsi_config->dvr_ic_inited = 0;
  452. dev_priv->dsi_configs[1] = dsi_config;
  453. } else if (pipe == 0) {
  454. dsi_config->dvr_ic_inited = 1;
  455. dev_priv->dsi_configs[0] = dsi_config;
  456. } else {
  457. DRM_ERROR("Trying to init MIPI1 before MIPI0\n");
  458. goto dsi_init_err0;
  459. }
  460. connector = &dsi_connector->base.base;
  461. dsi_connector->base.save = mdfld_dsi_connector_save;
  462. dsi_connector->base.restore = mdfld_dsi_connector_restore;
  463. drm_connector_init(dev, connector, &mdfld_dsi_connector_funcs,
  464. DRM_MODE_CONNECTOR_LVDS);
  465. drm_connector_helper_add(connector, &mdfld_dsi_connector_helper_funcs);
  466. connector->display_info.subpixel_order = SubPixelHorizontalRGB;
  467. connector->display_info.width_mm = width_mm;
  468. connector->display_info.height_mm = height_mm;
  469. connector->interlace_allowed = false;
  470. connector->doublescan_allowed = false;
  471. /*attach properties*/
  472. drm_object_attach_property(&connector->base,
  473. dev->mode_config.scaling_mode_property,
  474. DRM_MODE_SCALE_FULLSCREEN);
  475. drm_object_attach_property(&connector->base,
  476. dev_priv->backlight_property,
  477. MDFLD_DSI_BRIGHTNESS_MAX_LEVEL);
  478. /*init DSI package sender on this output*/
  479. if (mdfld_dsi_pkg_sender_init(dsi_connector, pipe)) {
  480. DRM_ERROR("Package Sender initialization failed on pipe %d\n",
  481. pipe);
  482. goto dsi_init_err0;
  483. }
  484. encoder = mdfld_dsi_dpi_init(dev, dsi_connector, p_vid_funcs);
  485. if (!encoder) {
  486. DRM_ERROR("Create DPI encoder failed\n");
  487. goto dsi_init_err1;
  488. }
  489. encoder->private = dsi_config;
  490. dsi_config->encoder = encoder;
  491. encoder->base.type = (pipe == 0) ? INTEL_OUTPUT_MIPI :
  492. INTEL_OUTPUT_MIPI2;
  493. drm_connector_register(connector);
  494. return;
  495. /*TODO: add code to destroy outputs on error*/
  496. dsi_init_err1:
  497. /*destroy sender*/
  498. mdfld_dsi_pkg_sender_destroy(dsi_connector->pkg_sender);
  499. drm_connector_cleanup(connector);
  500. kfree(dsi_config->fixed_mode);
  501. kfree(dsi_config);
  502. dsi_init_err0:
  503. kfree(dsi_connector);
  504. }