panel-simple.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  1. /*
  2. * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
  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, sub license,
  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
  12. * next paragraph) shall be included in all copies or substantial portions
  13. * of the 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 NON-INFRINGEMENT. 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. #include <linux/backlight.h>
  24. #include <linux/gpio/consumer.h>
  25. #include <linux/module.h>
  26. #include <linux/of_platform.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/regulator/consumer.h>
  29. #include <drm/drmP.h>
  30. #include <drm/drm_crtc.h>
  31. #include <drm/drm_mipi_dsi.h>
  32. #include <drm/drm_panel.h>
  33. struct panel_desc {
  34. const struct drm_display_mode *modes;
  35. unsigned int num_modes;
  36. struct {
  37. unsigned int width;
  38. unsigned int height;
  39. } size;
  40. };
  41. struct panel_simple {
  42. struct drm_panel base;
  43. bool enabled;
  44. const struct panel_desc *desc;
  45. struct backlight_device *backlight;
  46. struct regulator *supply;
  47. struct i2c_adapter *ddc;
  48. struct gpio_desc *enable_gpio;
  49. };
  50. static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
  51. {
  52. return container_of(panel, struct panel_simple, base);
  53. }
  54. static int panel_simple_get_fixed_modes(struct panel_simple *panel)
  55. {
  56. struct drm_connector *connector = panel->base.connector;
  57. struct drm_device *drm = panel->base.drm;
  58. struct drm_display_mode *mode;
  59. unsigned int i, num = 0;
  60. if (!panel->desc)
  61. return 0;
  62. for (i = 0; i < panel->desc->num_modes; i++) {
  63. const struct drm_display_mode *m = &panel->desc->modes[i];
  64. mode = drm_mode_duplicate(drm, m);
  65. if (!mode) {
  66. dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
  67. m->hdisplay, m->vdisplay, m->vrefresh);
  68. continue;
  69. }
  70. drm_mode_set_name(mode);
  71. drm_mode_probed_add(connector, mode);
  72. num++;
  73. }
  74. connector->display_info.width_mm = panel->desc->size.width;
  75. connector->display_info.height_mm = panel->desc->size.height;
  76. return num;
  77. }
  78. static int panel_simple_disable(struct drm_panel *panel)
  79. {
  80. struct panel_simple *p = to_panel_simple(panel);
  81. if (!p->enabled)
  82. return 0;
  83. if (p->backlight) {
  84. p->backlight->props.power = FB_BLANK_POWERDOWN;
  85. backlight_update_status(p->backlight);
  86. }
  87. if (p->enable_gpio)
  88. gpiod_set_value_cansleep(p->enable_gpio, 0);
  89. regulator_disable(p->supply);
  90. p->enabled = false;
  91. return 0;
  92. }
  93. static int panel_simple_enable(struct drm_panel *panel)
  94. {
  95. struct panel_simple *p = to_panel_simple(panel);
  96. int err;
  97. if (p->enabled)
  98. return 0;
  99. err = regulator_enable(p->supply);
  100. if (err < 0) {
  101. dev_err(panel->dev, "failed to enable supply: %d\n", err);
  102. return err;
  103. }
  104. if (p->enable_gpio)
  105. gpiod_set_value_cansleep(p->enable_gpio, 1);
  106. if (p->backlight) {
  107. p->backlight->props.power = FB_BLANK_UNBLANK;
  108. backlight_update_status(p->backlight);
  109. }
  110. p->enabled = true;
  111. return 0;
  112. }
  113. static int panel_simple_get_modes(struct drm_panel *panel)
  114. {
  115. struct panel_simple *p = to_panel_simple(panel);
  116. int num = 0;
  117. /* probe EDID if a DDC bus is available */
  118. if (p->ddc) {
  119. struct edid *edid = drm_get_edid(panel->connector, p->ddc);
  120. drm_mode_connector_update_edid_property(panel->connector, edid);
  121. if (edid) {
  122. num += drm_add_edid_modes(panel->connector, edid);
  123. kfree(edid);
  124. }
  125. }
  126. /* add hard-coded panel modes */
  127. num += panel_simple_get_fixed_modes(p);
  128. return num;
  129. }
  130. static const struct drm_panel_funcs panel_simple_funcs = {
  131. .disable = panel_simple_disable,
  132. .enable = panel_simple_enable,
  133. .get_modes = panel_simple_get_modes,
  134. };
  135. static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
  136. {
  137. struct device_node *backlight, *ddc;
  138. struct panel_simple *panel;
  139. int err;
  140. panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
  141. if (!panel)
  142. return -ENOMEM;
  143. panel->enabled = false;
  144. panel->desc = desc;
  145. panel->supply = devm_regulator_get(dev, "power");
  146. if (IS_ERR(panel->supply))
  147. return PTR_ERR(panel->supply);
  148. panel->enable_gpio = devm_gpiod_get(dev, "enable");
  149. if (IS_ERR(panel->enable_gpio)) {
  150. err = PTR_ERR(panel->enable_gpio);
  151. if (err != -ENOENT) {
  152. dev_err(dev, "failed to request GPIO: %d\n", err);
  153. return err;
  154. }
  155. panel->enable_gpio = NULL;
  156. } else {
  157. err = gpiod_direction_output(panel->enable_gpio, 0);
  158. if (err < 0) {
  159. dev_err(dev, "failed to setup GPIO: %d\n", err);
  160. return err;
  161. }
  162. }
  163. backlight = of_parse_phandle(dev->of_node, "backlight", 0);
  164. if (backlight) {
  165. panel->backlight = of_find_backlight_by_node(backlight);
  166. of_node_put(backlight);
  167. if (!panel->backlight)
  168. return -EPROBE_DEFER;
  169. }
  170. ddc = of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0);
  171. if (ddc) {
  172. panel->ddc = of_find_i2c_adapter_by_node(ddc);
  173. of_node_put(ddc);
  174. if (!panel->ddc) {
  175. err = -EPROBE_DEFER;
  176. goto free_backlight;
  177. }
  178. }
  179. drm_panel_init(&panel->base);
  180. panel->base.dev = dev;
  181. panel->base.funcs = &panel_simple_funcs;
  182. err = drm_panel_add(&panel->base);
  183. if (err < 0)
  184. goto free_ddc;
  185. dev_set_drvdata(dev, panel);
  186. return 0;
  187. free_ddc:
  188. if (panel->ddc)
  189. put_device(&panel->ddc->dev);
  190. free_backlight:
  191. if (panel->backlight)
  192. put_device(&panel->backlight->dev);
  193. return err;
  194. }
  195. static int panel_simple_remove(struct device *dev)
  196. {
  197. struct panel_simple *panel = dev_get_drvdata(dev);
  198. drm_panel_detach(&panel->base);
  199. drm_panel_remove(&panel->base);
  200. panel_simple_disable(&panel->base);
  201. if (panel->ddc)
  202. put_device(&panel->ddc->dev);
  203. if (panel->backlight)
  204. put_device(&panel->backlight->dev);
  205. return 0;
  206. }
  207. static void panel_simple_shutdown(struct device *dev)
  208. {
  209. struct panel_simple *panel = dev_get_drvdata(dev);
  210. panel_simple_disable(&panel->base);
  211. }
  212. static const struct drm_display_mode auo_b101aw03_mode = {
  213. .clock = 51450,
  214. .hdisplay = 1024,
  215. .hsync_start = 1024 + 156,
  216. .hsync_end = 1024 + 156 + 8,
  217. .htotal = 1024 + 156 + 8 + 156,
  218. .vdisplay = 600,
  219. .vsync_start = 600 + 16,
  220. .vsync_end = 600 + 16 + 6,
  221. .vtotal = 600 + 16 + 6 + 16,
  222. .vrefresh = 60,
  223. };
  224. static const struct panel_desc auo_b101aw03 = {
  225. .modes = &auo_b101aw03_mode,
  226. .num_modes = 1,
  227. .size = {
  228. .width = 223,
  229. .height = 125,
  230. },
  231. };
  232. static const struct drm_display_mode auo_b133xtn01_mode = {
  233. .clock = 69500,
  234. .hdisplay = 1366,
  235. .hsync_start = 1366 + 48,
  236. .hsync_end = 1366 + 48 + 32,
  237. .htotal = 1366 + 48 + 32 + 20,
  238. .vdisplay = 768,
  239. .vsync_start = 768 + 3,
  240. .vsync_end = 768 + 3 + 6,
  241. .vtotal = 768 + 3 + 6 + 13,
  242. .vrefresh = 60,
  243. };
  244. static const struct panel_desc auo_b133xtn01 = {
  245. .modes = &auo_b133xtn01_mode,
  246. .num_modes = 1,
  247. .size = {
  248. .width = 293,
  249. .height = 165,
  250. },
  251. };
  252. static const struct drm_display_mode chunghwa_claa101wa01a_mode = {
  253. .clock = 72070,
  254. .hdisplay = 1366,
  255. .hsync_start = 1366 + 58,
  256. .hsync_end = 1366 + 58 + 58,
  257. .htotal = 1366 + 58 + 58 + 58,
  258. .vdisplay = 768,
  259. .vsync_start = 768 + 4,
  260. .vsync_end = 768 + 4 + 4,
  261. .vtotal = 768 + 4 + 4 + 4,
  262. .vrefresh = 60,
  263. };
  264. static const struct panel_desc chunghwa_claa101wa01a = {
  265. .modes = &chunghwa_claa101wa01a_mode,
  266. .num_modes = 1,
  267. .size = {
  268. .width = 220,
  269. .height = 120,
  270. },
  271. };
  272. static const struct drm_display_mode chunghwa_claa101wb01_mode = {
  273. .clock = 69300,
  274. .hdisplay = 1366,
  275. .hsync_start = 1366 + 48,
  276. .hsync_end = 1366 + 48 + 32,
  277. .htotal = 1366 + 48 + 32 + 20,
  278. .vdisplay = 768,
  279. .vsync_start = 768 + 16,
  280. .vsync_end = 768 + 16 + 8,
  281. .vtotal = 768 + 16 + 8 + 16,
  282. .vrefresh = 60,
  283. };
  284. static const struct panel_desc chunghwa_claa101wb01 = {
  285. .modes = &chunghwa_claa101wb01_mode,
  286. .num_modes = 1,
  287. .size = {
  288. .width = 223,
  289. .height = 125,
  290. },
  291. };
  292. static const struct drm_display_mode edt_et057090dhu_mode = {
  293. .clock = 25175,
  294. .hdisplay = 640,
  295. .hsync_start = 640 + 16,
  296. .hsync_end = 640 + 16 + 30,
  297. .htotal = 640 + 16 + 30 + 114,
  298. .vdisplay = 480,
  299. .vsync_start = 480 + 10,
  300. .vsync_end = 480 + 10 + 3,
  301. .vtotal = 480 + 10 + 3 + 32,
  302. .vrefresh = 60,
  303. .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
  304. };
  305. static const struct panel_desc edt_et057090dhu = {
  306. .modes = &edt_et057090dhu_mode,
  307. .num_modes = 1,
  308. .size = {
  309. .width = 115,
  310. .height = 86,
  311. },
  312. };
  313. static const struct drm_display_mode edt_etm0700g0dh6_mode = {
  314. .clock = 33260,
  315. .hdisplay = 800,
  316. .hsync_start = 800 + 40,
  317. .hsync_end = 800 + 40 + 128,
  318. .htotal = 800 + 40 + 128 + 88,
  319. .vdisplay = 480,
  320. .vsync_start = 480 + 10,
  321. .vsync_end = 480 + 10 + 2,
  322. .vtotal = 480 + 10 + 2 + 33,
  323. .vrefresh = 60,
  324. .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
  325. };
  326. static const struct panel_desc edt_etm0700g0dh6 = {
  327. .modes = &edt_etm0700g0dh6_mode,
  328. .num_modes = 1,
  329. .size = {
  330. .width = 152,
  331. .height = 91,
  332. },
  333. };
  334. static const struct drm_display_mode lg_lp129qe_mode = {
  335. .clock = 285250,
  336. .hdisplay = 2560,
  337. .hsync_start = 2560 + 48,
  338. .hsync_end = 2560 + 48 + 32,
  339. .htotal = 2560 + 48 + 32 + 80,
  340. .vdisplay = 1700,
  341. .vsync_start = 1700 + 3,
  342. .vsync_end = 1700 + 3 + 10,
  343. .vtotal = 1700 + 3 + 10 + 36,
  344. .vrefresh = 60,
  345. };
  346. static const struct panel_desc lg_lp129qe = {
  347. .modes = &lg_lp129qe_mode,
  348. .num_modes = 1,
  349. .size = {
  350. .width = 272,
  351. .height = 181,
  352. },
  353. };
  354. static const struct drm_display_mode samsung_ltn101nt05_mode = {
  355. .clock = 54030,
  356. .hdisplay = 1024,
  357. .hsync_start = 1024 + 24,
  358. .hsync_end = 1024 + 24 + 136,
  359. .htotal = 1024 + 24 + 136 + 160,
  360. .vdisplay = 600,
  361. .vsync_start = 600 + 3,
  362. .vsync_end = 600 + 3 + 6,
  363. .vtotal = 600 + 3 + 6 + 61,
  364. .vrefresh = 60,
  365. };
  366. static const struct panel_desc samsung_ltn101nt05 = {
  367. .modes = &samsung_ltn101nt05_mode,
  368. .num_modes = 1,
  369. .size = {
  370. .width = 1024,
  371. .height = 600,
  372. },
  373. };
  374. static const struct of_device_id platform_of_match[] = {
  375. {
  376. .compatible = "auo,b101aw03",
  377. .data = &auo_b101aw03,
  378. }, {
  379. .compatible = "auo,b133xtn01",
  380. .data = &auo_b133xtn01,
  381. }, {
  382. .compatible = "chunghwa,claa101wa01a",
  383. .data = &chunghwa_claa101wa01a
  384. }, {
  385. .compatible = "chunghwa,claa101wb01",
  386. .data = &chunghwa_claa101wb01
  387. }, {
  388. .compatible = "edt,et057090dhu",
  389. .data = &edt_et057090dhu,
  390. }, {
  391. .compatible = "edt,et070080dh6",
  392. .data = &edt_etm0700g0dh6,
  393. }, {
  394. .compatible = "edt,etm0700g0dh6",
  395. .data = &edt_etm0700g0dh6,
  396. }, {
  397. .compatible = "lg,lp129qe",
  398. .data = &lg_lp129qe,
  399. }, {
  400. .compatible = "samsung,ltn101nt05",
  401. .data = &samsung_ltn101nt05,
  402. }, {
  403. .compatible = "simple-panel",
  404. }, {
  405. /* sentinel */
  406. }
  407. };
  408. MODULE_DEVICE_TABLE(of, platform_of_match);
  409. static int panel_simple_platform_probe(struct platform_device *pdev)
  410. {
  411. const struct of_device_id *id;
  412. id = of_match_node(platform_of_match, pdev->dev.of_node);
  413. if (!id)
  414. return -ENODEV;
  415. return panel_simple_probe(&pdev->dev, id->data);
  416. }
  417. static int panel_simple_platform_remove(struct platform_device *pdev)
  418. {
  419. return panel_simple_remove(&pdev->dev);
  420. }
  421. static void panel_simple_platform_shutdown(struct platform_device *pdev)
  422. {
  423. panel_simple_shutdown(&pdev->dev);
  424. }
  425. static struct platform_driver panel_simple_platform_driver = {
  426. .driver = {
  427. .name = "panel-simple",
  428. .owner = THIS_MODULE,
  429. .of_match_table = platform_of_match,
  430. },
  431. .probe = panel_simple_platform_probe,
  432. .remove = panel_simple_platform_remove,
  433. .shutdown = panel_simple_platform_shutdown,
  434. };
  435. struct panel_desc_dsi {
  436. struct panel_desc desc;
  437. unsigned long flags;
  438. enum mipi_dsi_pixel_format format;
  439. unsigned int lanes;
  440. };
  441. static const struct drm_display_mode lg_ld070wx3_sl01_mode = {
  442. .clock = 71000,
  443. .hdisplay = 800,
  444. .hsync_start = 800 + 32,
  445. .hsync_end = 800 + 32 + 1,
  446. .htotal = 800 + 32 + 1 + 57,
  447. .vdisplay = 1280,
  448. .vsync_start = 1280 + 28,
  449. .vsync_end = 1280 + 28 + 1,
  450. .vtotal = 1280 + 28 + 1 + 14,
  451. .vrefresh = 60,
  452. };
  453. static const struct panel_desc_dsi lg_ld070wx3_sl01 = {
  454. .desc = {
  455. .modes = &lg_ld070wx3_sl01_mode,
  456. .num_modes = 1,
  457. .size = {
  458. .width = 94,
  459. .height = 151,
  460. },
  461. },
  462. .flags = MIPI_DSI_MODE_VIDEO,
  463. .format = MIPI_DSI_FMT_RGB888,
  464. .lanes = 4,
  465. };
  466. static const struct drm_display_mode lg_lh500wx1_sd03_mode = {
  467. .clock = 67000,
  468. .hdisplay = 720,
  469. .hsync_start = 720 + 12,
  470. .hsync_end = 720 + 12 + 4,
  471. .htotal = 720 + 12 + 4 + 112,
  472. .vdisplay = 1280,
  473. .vsync_start = 1280 + 8,
  474. .vsync_end = 1280 + 8 + 4,
  475. .vtotal = 1280 + 8 + 4 + 12,
  476. .vrefresh = 60,
  477. };
  478. static const struct panel_desc_dsi lg_lh500wx1_sd03 = {
  479. .desc = {
  480. .modes = &lg_lh500wx1_sd03_mode,
  481. .num_modes = 1,
  482. .size = {
  483. .width = 62,
  484. .height = 110,
  485. },
  486. },
  487. .flags = MIPI_DSI_MODE_VIDEO,
  488. .format = MIPI_DSI_FMT_RGB888,
  489. .lanes = 4,
  490. };
  491. static const struct drm_display_mode panasonic_vvx10f004b00_mode = {
  492. .clock = 157200,
  493. .hdisplay = 1920,
  494. .hsync_start = 1920 + 154,
  495. .hsync_end = 1920 + 154 + 16,
  496. .htotal = 1920 + 154 + 16 + 32,
  497. .vdisplay = 1200,
  498. .vsync_start = 1200 + 17,
  499. .vsync_end = 1200 + 17 + 2,
  500. .vtotal = 1200 + 17 + 2 + 16,
  501. .vrefresh = 60,
  502. };
  503. static const struct panel_desc_dsi panasonic_vvx10f004b00 = {
  504. .desc = {
  505. .modes = &panasonic_vvx10f004b00_mode,
  506. .num_modes = 1,
  507. .size = {
  508. .width = 217,
  509. .height = 136,
  510. },
  511. },
  512. .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
  513. .format = MIPI_DSI_FMT_RGB888,
  514. .lanes = 4,
  515. };
  516. static const struct of_device_id dsi_of_match[] = {
  517. {
  518. .compatible = "lg,ld070wx3-sl01",
  519. .data = &lg_ld070wx3_sl01
  520. }, {
  521. .compatible = "lg,lh500wx1-sd03",
  522. .data = &lg_lh500wx1_sd03
  523. }, {
  524. .compatible = "panasonic,vvx10f004b00",
  525. .data = &panasonic_vvx10f004b00
  526. }, {
  527. /* sentinel */
  528. }
  529. };
  530. MODULE_DEVICE_TABLE(of, dsi_of_match);
  531. static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi)
  532. {
  533. const struct panel_desc_dsi *desc;
  534. const struct of_device_id *id;
  535. int err;
  536. id = of_match_node(dsi_of_match, dsi->dev.of_node);
  537. if (!id)
  538. return -ENODEV;
  539. desc = id->data;
  540. err = panel_simple_probe(&dsi->dev, &desc->desc);
  541. if (err < 0)
  542. return err;
  543. dsi->mode_flags = desc->flags;
  544. dsi->format = desc->format;
  545. dsi->lanes = desc->lanes;
  546. return mipi_dsi_attach(dsi);
  547. }
  548. static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
  549. {
  550. int err;
  551. err = mipi_dsi_detach(dsi);
  552. if (err < 0)
  553. dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
  554. return panel_simple_remove(&dsi->dev);
  555. }
  556. static void panel_simple_dsi_shutdown(struct mipi_dsi_device *dsi)
  557. {
  558. panel_simple_shutdown(&dsi->dev);
  559. }
  560. static struct mipi_dsi_driver panel_simple_dsi_driver = {
  561. .driver = {
  562. .name = "panel-simple-dsi",
  563. .owner = THIS_MODULE,
  564. .of_match_table = dsi_of_match,
  565. },
  566. .probe = panel_simple_dsi_probe,
  567. .remove = panel_simple_dsi_remove,
  568. .shutdown = panel_simple_dsi_shutdown,
  569. };
  570. static int __init panel_simple_init(void)
  571. {
  572. int err;
  573. err = platform_driver_register(&panel_simple_platform_driver);
  574. if (err < 0)
  575. return err;
  576. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI)) {
  577. err = mipi_dsi_driver_register(&panel_simple_dsi_driver);
  578. if (err < 0)
  579. return err;
  580. }
  581. return 0;
  582. }
  583. module_init(panel_simple_init);
  584. static void __exit panel_simple_exit(void)
  585. {
  586. if (IS_ENABLED(CONFIG_DRM_MIPI_DSI))
  587. mipi_dsi_driver_unregister(&panel_simple_dsi_driver);
  588. platform_driver_unregister(&panel_simple_platform_driver);
  589. }
  590. module_exit(panel_simple_exit);
  591. MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
  592. MODULE_DESCRIPTION("DRM Driver for Simple Panels");
  593. MODULE_LICENSE("GPL and additional rights");