sh_mipi_dsi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. /*
  2. * Renesas SH-mobile MIPI DSI support
  3. *
  4. * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  5. *
  6. * This is free software; you can redistribute it and/or modify
  7. * it under the terms of version 2 of the GNU General Public License as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/bitmap.h>
  11. #include <linux/clk.h>
  12. #include <linux/delay.h>
  13. #include <linux/init.h>
  14. #include <linux/io.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/pm_runtime.h>
  17. #include <linux/slab.h>
  18. #include <linux/string.h>
  19. #include <linux/types.h>
  20. #include <linux/module.h>
  21. #include <video/mipi_display.h>
  22. #include <video/sh_mipi_dsi.h>
  23. #include <video/sh_mobile_lcdc.h>
  24. #define SYSCTRL 0x0000
  25. #define SYSCONF 0x0004
  26. #define TIMSET 0x0008
  27. #define RESREQSET0 0x0018
  28. #define RESREQSET1 0x001c
  29. #define HSTTOVSET 0x0020
  30. #define LPRTOVSET 0x0024
  31. #define TATOVSET 0x0028
  32. #define PRTOVSET 0x002c
  33. #define DSICTRL 0x0030
  34. #define DSIINTE 0x0060
  35. #define PHYCTRL 0x0070
  36. /* relative to linkbase */
  37. #define DTCTR 0x0000
  38. #define VMCTR1 0x0020
  39. #define VMCTR2 0x0024
  40. #define VMLEN1 0x0028
  41. #define CMTSRTREQ 0x0070
  42. #define CMTSRTCTR 0x00d0
  43. /* E.g., sh7372 has 2 MIPI-DSIs - one for each LCDC */
  44. #define MAX_SH_MIPI_DSI 2
  45. struct sh_mipi {
  46. void __iomem *base;
  47. void __iomem *linkbase;
  48. struct clk *dsit_clk;
  49. struct clk *dsip_clk;
  50. struct device *dev;
  51. void *next_board_data;
  52. void (*next_display_on)(void *board_data, struct fb_info *info);
  53. void (*next_display_off)(void *board_data);
  54. };
  55. static struct sh_mipi *mipi_dsi[MAX_SH_MIPI_DSI];
  56. /* Protect the above array */
  57. static DEFINE_MUTEX(array_lock);
  58. static struct sh_mipi *sh_mipi_by_handle(int handle)
  59. {
  60. if (handle >= ARRAY_SIZE(mipi_dsi) || handle < 0)
  61. return NULL;
  62. return mipi_dsi[handle];
  63. }
  64. static int sh_mipi_send_short(struct sh_mipi *mipi, u8 dsi_cmd,
  65. u8 cmd, u8 param)
  66. {
  67. u32 data = (dsi_cmd << 24) | (cmd << 16) | (param << 8);
  68. int cnt = 100;
  69. /* transmit a short packet to LCD panel */
  70. iowrite32(1 | data, mipi->linkbase + CMTSRTCTR);
  71. iowrite32(1, mipi->linkbase + CMTSRTREQ);
  72. while ((ioread32(mipi->linkbase + CMTSRTREQ) & 1) && --cnt)
  73. udelay(1);
  74. return cnt ? 0 : -ETIMEDOUT;
  75. }
  76. #define LCD_CHAN2MIPI(c) ((c) < LCDC_CHAN_MAINLCD || (c) > LCDC_CHAN_SUBLCD ? \
  77. -EINVAL : (c) - 1)
  78. static int sh_mipi_dcs(int handle, u8 cmd)
  79. {
  80. struct sh_mipi *mipi = sh_mipi_by_handle(LCD_CHAN2MIPI(handle));
  81. if (!mipi)
  82. return -ENODEV;
  83. return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE, cmd, 0);
  84. }
  85. static int sh_mipi_dcs_param(int handle, u8 cmd, u8 param)
  86. {
  87. struct sh_mipi *mipi = sh_mipi_by_handle(LCD_CHAN2MIPI(handle));
  88. if (!mipi)
  89. return -ENODEV;
  90. return sh_mipi_send_short(mipi, MIPI_DSI_DCS_SHORT_WRITE_PARAM, cmd,
  91. param);
  92. }
  93. static void sh_mipi_dsi_enable(struct sh_mipi *mipi, bool enable)
  94. {
  95. /*
  96. * enable LCDC data tx, transition to LPS after completion of each HS
  97. * packet
  98. */
  99. iowrite32(0x00000002 | enable, mipi->linkbase + DTCTR);
  100. }
  101. static void sh_mipi_shutdown(struct platform_device *pdev)
  102. {
  103. struct sh_mipi *mipi = platform_get_drvdata(pdev);
  104. sh_mipi_dsi_enable(mipi, false);
  105. }
  106. static void mipi_display_on(void *arg, struct fb_info *info)
  107. {
  108. struct sh_mipi *mipi = arg;
  109. pm_runtime_get_sync(mipi->dev);
  110. sh_mipi_dsi_enable(mipi, true);
  111. if (mipi->next_display_on)
  112. mipi->next_display_on(mipi->next_board_data, info);
  113. }
  114. static void mipi_display_off(void *arg)
  115. {
  116. struct sh_mipi *mipi = arg;
  117. if (mipi->next_display_off)
  118. mipi->next_display_off(mipi->next_board_data);
  119. sh_mipi_dsi_enable(mipi, false);
  120. pm_runtime_put(mipi->dev);
  121. }
  122. static int __init sh_mipi_setup(struct sh_mipi *mipi,
  123. struct sh_mipi_dsi_info *pdata)
  124. {
  125. void __iomem *base = mipi->base;
  126. struct sh_mobile_lcdc_chan_cfg *ch = pdata->lcd_chan;
  127. u32 pctype, datatype, pixfmt, linelength, vmctr2;
  128. bool yuv;
  129. u32 tmp;
  130. /*
  131. * Select data format. MIPI DSI is not hot-pluggable, so, we just use
  132. * the default videomode. If this ever becomes a problem, We'll have to
  133. * move this to mipi_display_on() above and use info->var.xres
  134. */
  135. switch (pdata->data_format) {
  136. case MIPI_RGB888:
  137. pctype = 0;
  138. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
  139. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  140. linelength = ch->lcd_cfg[0].xres * 3;
  141. yuv = false;
  142. break;
  143. case MIPI_RGB565:
  144. pctype = 1;
  145. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
  146. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  147. linelength = ch->lcd_cfg[0].xres * 2;
  148. yuv = false;
  149. break;
  150. case MIPI_RGB666_LP:
  151. pctype = 2;
  152. datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
  153. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  154. linelength = ch->lcd_cfg[0].xres * 3;
  155. yuv = false;
  156. break;
  157. case MIPI_RGB666:
  158. pctype = 3;
  159. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
  160. pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
  161. linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8;
  162. yuv = false;
  163. break;
  164. case MIPI_BGR888:
  165. pctype = 8;
  166. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_24;
  167. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  168. linelength = ch->lcd_cfg[0].xres * 3;
  169. yuv = false;
  170. break;
  171. case MIPI_BGR565:
  172. pctype = 9;
  173. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_16;
  174. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  175. linelength = ch->lcd_cfg[0].xres * 2;
  176. yuv = false;
  177. break;
  178. case MIPI_BGR666_LP:
  179. pctype = 0xa;
  180. datatype = MIPI_DSI_PIXEL_STREAM_3BYTE_18;
  181. pixfmt = MIPI_DCS_PIXEL_FMT_24BIT;
  182. linelength = ch->lcd_cfg[0].xres * 3;
  183. yuv = false;
  184. break;
  185. case MIPI_BGR666:
  186. pctype = 0xb;
  187. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_18;
  188. pixfmt = MIPI_DCS_PIXEL_FMT_18BIT;
  189. linelength = (ch->lcd_cfg[0].xres * 18 + 7) / 8;
  190. yuv = false;
  191. break;
  192. case MIPI_YUYV:
  193. pctype = 4;
  194. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
  195. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  196. linelength = ch->lcd_cfg[0].xres * 2;
  197. yuv = true;
  198. break;
  199. case MIPI_UYVY:
  200. pctype = 5;
  201. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16;
  202. pixfmt = MIPI_DCS_PIXEL_FMT_16BIT;
  203. linelength = ch->lcd_cfg[0].xres * 2;
  204. yuv = true;
  205. break;
  206. case MIPI_YUV420_L:
  207. pctype = 6;
  208. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
  209. pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
  210. linelength = (ch->lcd_cfg[0].xres * 12 + 7) / 8;
  211. yuv = true;
  212. break;
  213. case MIPI_YUV420:
  214. pctype = 7;
  215. datatype = MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12;
  216. pixfmt = MIPI_DCS_PIXEL_FMT_12BIT;
  217. /* Length of U/V line */
  218. linelength = (ch->lcd_cfg[0].xres + 1) / 2;
  219. yuv = true;
  220. break;
  221. default:
  222. return -EINVAL;
  223. }
  224. if ((yuv && ch->interface_type != YUV422) ||
  225. (!yuv && ch->interface_type != RGB24))
  226. return -EINVAL;
  227. if (!pdata->lane)
  228. return -EINVAL;
  229. /* reset DSI link */
  230. iowrite32(0x00000001, base + SYSCTRL);
  231. /* Hold reset for 100 cycles of the slowest of bus, HS byte and LP clock */
  232. udelay(50);
  233. iowrite32(0x00000000, base + SYSCTRL);
  234. /* setup DSI link */
  235. /*
  236. * Default = ULPS enable |
  237. * Contention detection enabled |
  238. * EoT packet transmission enable |
  239. * CRC check enable |
  240. * ECC check enable
  241. * additionally enable first two lanes
  242. */
  243. bitmap_fill((unsigned long *)&tmp, pdata->lane);
  244. tmp |= 0x00003700;
  245. iowrite32(tmp, base + SYSCONF);
  246. /*
  247. * T_wakeup = 0x7000
  248. * T_hs-trail = 3
  249. * T_hs-prepare = 3
  250. * T_clk-trail = 3
  251. * T_clk-prepare = 2
  252. */
  253. iowrite32(0x70003332, base + TIMSET);
  254. /* no responses requested */
  255. iowrite32(0x00000000, base + RESREQSET0);
  256. /* request response to packets of type 0x28 */
  257. iowrite32(0x00000100, base + RESREQSET1);
  258. /* High-speed transmission timeout, default 0xffffffff */
  259. iowrite32(0x0fffffff, base + HSTTOVSET);
  260. /* LP reception timeout, default 0xffffffff */
  261. iowrite32(0x0fffffff, base + LPRTOVSET);
  262. /* Turn-around timeout, default 0xffffffff */
  263. iowrite32(0x0fffffff, base + TATOVSET);
  264. /* Peripheral reset timeout, default 0xffffffff */
  265. iowrite32(0x0fffffff, base + PRTOVSET);
  266. /* Enable timeout counters */
  267. iowrite32(0x00000f00, base + DSICTRL);
  268. /* Interrupts not used, disable all */
  269. iowrite32(0, base + DSIINTE);
  270. /* DSI-Tx bias on */
  271. iowrite32(0x00000001, base + PHYCTRL);
  272. udelay(200);
  273. /* Deassert resets, power on, set multiplier */
  274. iowrite32(0x03070b01, base + PHYCTRL);
  275. /* setup l-bridge */
  276. /*
  277. * Enable transmission of all packets,
  278. * transmit LPS after each HS packet completion
  279. */
  280. iowrite32(0x00000006, mipi->linkbase + DTCTR);
  281. /* VSYNC width = 2 (<< 17) */
  282. iowrite32((ch->lcd_cfg[0].vsync_len << pdata->vsynw_offset) |
  283. (pdata->clksrc << 16) | (pctype << 12) | datatype,
  284. mipi->linkbase + VMCTR1);
  285. /*
  286. * Non-burst mode with sync pulses: VSE and HSE are output,
  287. * HSA period allowed, no commands in LP
  288. */
  289. vmctr2 = 0;
  290. if (pdata->flags & SH_MIPI_DSI_VSEE)
  291. vmctr2 |= 1 << 23;
  292. if (pdata->flags & SH_MIPI_DSI_HSEE)
  293. vmctr2 |= 1 << 22;
  294. if (pdata->flags & SH_MIPI_DSI_HSAE)
  295. vmctr2 |= 1 << 21;
  296. if (pdata->flags & SH_MIPI_DSI_BL2E)
  297. vmctr2 |= 1 << 17;
  298. if (pdata->flags & SH_MIPI_DSI_HSABM)
  299. vmctr2 |= 1 << 5;
  300. if (pdata->flags & SH_MIPI_DSI_HBPBM)
  301. vmctr2 |= 1 << 4;
  302. if (pdata->flags & SH_MIPI_DSI_HFPBM)
  303. vmctr2 |= 1 << 3;
  304. iowrite32(vmctr2, mipi->linkbase + VMCTR2);
  305. /*
  306. * 0x660 = 1632 bytes per line (RGB24, 544 pixels: see
  307. * sh_mobile_lcdc_info.ch[0].lcd_cfg[0].xres), HSALEN = 1 - default
  308. * (unused if VMCTR2[HSABM] = 0)
  309. */
  310. iowrite32(1 | (linelength << 16), mipi->linkbase + VMLEN1);
  311. msleep(5);
  312. /* setup LCD panel */
  313. /* cf. drivers/video/omap/lcd_mipid.c */
  314. sh_mipi_dcs(ch->chan, MIPI_DCS_EXIT_SLEEP_MODE);
  315. msleep(120);
  316. /*
  317. * [7] - Page Address Mode
  318. * [6] - Column Address Mode
  319. * [5] - Page / Column Address Mode
  320. * [4] - Display Device Line Refresh Order
  321. * [3] - RGB/BGR Order
  322. * [2] - Display Data Latch Data Order
  323. * [1] - Flip Horizontal
  324. * [0] - Flip Vertical
  325. */
  326. sh_mipi_dcs_param(ch->chan, MIPI_DCS_SET_ADDRESS_MODE, 0x00);
  327. /* cf. set_data_lines() */
  328. sh_mipi_dcs_param(ch->chan, MIPI_DCS_SET_PIXEL_FORMAT,
  329. pixfmt << 4);
  330. sh_mipi_dcs(ch->chan, MIPI_DCS_SET_DISPLAY_ON);
  331. return 0;
  332. }
  333. static int __init sh_mipi_probe(struct platform_device *pdev)
  334. {
  335. struct sh_mipi *mipi;
  336. struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
  337. struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  338. struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  339. unsigned long rate, f_current;
  340. int idx = pdev->id, ret;
  341. if (!res || !res2 || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
  342. return -ENODEV;
  343. mutex_lock(&array_lock);
  344. if (idx < 0)
  345. for (idx = 0; idx < ARRAY_SIZE(mipi_dsi) && mipi_dsi[idx]; idx++)
  346. ;
  347. if (idx == ARRAY_SIZE(mipi_dsi)) {
  348. ret = -EBUSY;
  349. goto efindslot;
  350. }
  351. mipi = kzalloc(sizeof(*mipi), GFP_KERNEL);
  352. if (!mipi) {
  353. ret = -ENOMEM;
  354. goto ealloc;
  355. }
  356. if (!request_mem_region(res->start, resource_size(res), pdev->name)) {
  357. dev_err(&pdev->dev, "MIPI register region already claimed\n");
  358. ret = -EBUSY;
  359. goto ereqreg;
  360. }
  361. mipi->base = ioremap(res->start, resource_size(res));
  362. if (!mipi->base) {
  363. ret = -ENOMEM;
  364. goto emap;
  365. }
  366. if (!request_mem_region(res2->start, resource_size(res2), pdev->name)) {
  367. dev_err(&pdev->dev, "MIPI register region 2 already claimed\n");
  368. ret = -EBUSY;
  369. goto ereqreg2;
  370. }
  371. mipi->linkbase = ioremap(res2->start, resource_size(res2));
  372. if (!mipi->linkbase) {
  373. ret = -ENOMEM;
  374. goto emap2;
  375. }
  376. mipi->dev = &pdev->dev;
  377. mipi->dsit_clk = clk_get(&pdev->dev, "dsit_clk");
  378. if (IS_ERR(mipi->dsit_clk)) {
  379. ret = PTR_ERR(mipi->dsit_clk);
  380. goto eclktget;
  381. }
  382. f_current = clk_get_rate(mipi->dsit_clk);
  383. /* 80MHz required by the datasheet */
  384. rate = clk_round_rate(mipi->dsit_clk, 80000000);
  385. if (rate > 0 && rate != f_current)
  386. ret = clk_set_rate(mipi->dsit_clk, rate);
  387. else
  388. ret = rate;
  389. if (ret < 0)
  390. goto esettrate;
  391. dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
  392. mipi->dsip_clk = clk_get(&pdev->dev, "dsip_clk");
  393. if (IS_ERR(mipi->dsip_clk)) {
  394. ret = PTR_ERR(mipi->dsip_clk);
  395. goto eclkpget;
  396. }
  397. f_current = clk_get_rate(mipi->dsip_clk);
  398. /* Between 10 and 50MHz */
  399. rate = clk_round_rate(mipi->dsip_clk, 24000000);
  400. if (rate > 0 && rate != f_current)
  401. ret = clk_set_rate(mipi->dsip_clk, rate);
  402. else
  403. ret = rate;
  404. if (ret < 0)
  405. goto esetprate;
  406. dev_dbg(&pdev->dev, "DSI-P clk %lu -> %lu\n", f_current, rate);
  407. msleep(10);
  408. ret = clk_enable(mipi->dsit_clk);
  409. if (ret < 0)
  410. goto eclkton;
  411. ret = clk_enable(mipi->dsip_clk);
  412. if (ret < 0)
  413. goto eclkpon;
  414. mipi_dsi[idx] = mipi;
  415. pm_runtime_enable(&pdev->dev);
  416. pm_runtime_resume(&pdev->dev);
  417. ret = sh_mipi_setup(mipi, pdata);
  418. if (ret < 0)
  419. goto emipisetup;
  420. mutex_unlock(&array_lock);
  421. platform_set_drvdata(pdev, mipi);
  422. /* Save original LCDC callbacks */
  423. mipi->next_board_data = pdata->lcd_chan->board_cfg.board_data;
  424. mipi->next_display_on = pdata->lcd_chan->board_cfg.display_on;
  425. mipi->next_display_off = pdata->lcd_chan->board_cfg.display_off;
  426. /* Set up LCDC callbacks */
  427. pdata->lcd_chan->board_cfg.board_data = mipi;
  428. pdata->lcd_chan->board_cfg.display_on = mipi_display_on;
  429. pdata->lcd_chan->board_cfg.display_off = mipi_display_off;
  430. pdata->lcd_chan->board_cfg.owner = THIS_MODULE;
  431. return 0;
  432. emipisetup:
  433. mipi_dsi[idx] = NULL;
  434. pm_runtime_disable(&pdev->dev);
  435. clk_disable(mipi->dsip_clk);
  436. eclkpon:
  437. clk_disable(mipi->dsit_clk);
  438. eclkton:
  439. esetprate:
  440. clk_put(mipi->dsip_clk);
  441. eclkpget:
  442. esettrate:
  443. clk_put(mipi->dsit_clk);
  444. eclktget:
  445. iounmap(mipi->linkbase);
  446. emap2:
  447. release_mem_region(res2->start, resource_size(res2));
  448. ereqreg2:
  449. iounmap(mipi->base);
  450. emap:
  451. release_mem_region(res->start, resource_size(res));
  452. ereqreg:
  453. kfree(mipi);
  454. ealloc:
  455. efindslot:
  456. mutex_unlock(&array_lock);
  457. return ret;
  458. }
  459. static int __exit sh_mipi_remove(struct platform_device *pdev)
  460. {
  461. struct sh_mipi_dsi_info *pdata = pdev->dev.platform_data;
  462. struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  463. struct resource *res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
  464. struct sh_mipi *mipi = platform_get_drvdata(pdev);
  465. int i, ret;
  466. mutex_lock(&array_lock);
  467. for (i = 0; i < ARRAY_SIZE(mipi_dsi) && mipi_dsi[i] != mipi; i++)
  468. ;
  469. if (i == ARRAY_SIZE(mipi_dsi)) {
  470. ret = -EINVAL;
  471. } else {
  472. ret = 0;
  473. mipi_dsi[i] = NULL;
  474. }
  475. mutex_unlock(&array_lock);
  476. if (ret < 0)
  477. return ret;
  478. pdata->lcd_chan->board_cfg.owner = NULL;
  479. pdata->lcd_chan->board_cfg.display_on = NULL;
  480. pdata->lcd_chan->board_cfg.display_off = NULL;
  481. pdata->lcd_chan->board_cfg.board_data = NULL;
  482. pm_runtime_disable(&pdev->dev);
  483. clk_disable(mipi->dsip_clk);
  484. clk_disable(mipi->dsit_clk);
  485. clk_put(mipi->dsit_clk);
  486. clk_put(mipi->dsip_clk);
  487. iounmap(mipi->linkbase);
  488. if (res2)
  489. release_mem_region(res2->start, resource_size(res2));
  490. iounmap(mipi->base);
  491. if (res)
  492. release_mem_region(res->start, resource_size(res));
  493. platform_set_drvdata(pdev, NULL);
  494. kfree(mipi);
  495. return 0;
  496. }
  497. static struct platform_driver sh_mipi_driver = {
  498. .remove = __exit_p(sh_mipi_remove),
  499. .shutdown = sh_mipi_shutdown,
  500. .driver = {
  501. .name = "sh-mipi-dsi",
  502. },
  503. };
  504. static int __init sh_mipi_init(void)
  505. {
  506. return platform_driver_probe(&sh_mipi_driver, sh_mipi_probe);
  507. }
  508. module_init(sh_mipi_init);
  509. static void __exit sh_mipi_exit(void)
  510. {
  511. platform_driver_unregister(&sh_mipi_driver);
  512. }
  513. module_exit(sh_mipi_exit);
  514. MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>");
  515. MODULE_DESCRIPTION("SuperH / ARM-shmobile MIPI DSI driver");
  516. MODULE_LICENSE("GPL v2");