mdfld_dsi_output.c 16 KB

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