dpi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. /*
  2. * linux/drivers/video/omap2/dss/dpi.c
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  6. *
  7. * Some code and ideas taken from drivers/video/omap/ driver
  8. * by Imre Deak.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License version 2 as published by
  12. * the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  17. * more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along with
  20. * this program. If not, see <http://www.gnu.org/licenses/>.
  21. */
  22. #define DSS_SUBSYS_NAME "DPI"
  23. #include <linux/kernel.h>
  24. #include <linux/delay.h>
  25. #include <linux/export.h>
  26. #include <linux/err.h>
  27. #include <linux/errno.h>
  28. #include <linux/platform_device.h>
  29. #include <linux/regulator/consumer.h>
  30. #include <linux/string.h>
  31. #include <video/omapdss.h>
  32. #include "dss.h"
  33. #include "dss_features.h"
  34. static struct {
  35. struct platform_device *pdev;
  36. struct regulator *vdds_dsi_reg;
  37. struct platform_device *dsidev;
  38. struct mutex lock;
  39. struct omap_video_timings timings;
  40. struct dss_lcd_mgr_config mgr_config;
  41. int data_lines;
  42. struct omap_dss_device output;
  43. } dpi;
  44. static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
  45. {
  46. /*
  47. * XXX we can't currently use DSI PLL for DPI with OMAP3, as the DSI PLL
  48. * would also be used for DISPC fclk. Meaning, when the DPI output is
  49. * disabled, DISPC clock will be disabled, and TV out will stop.
  50. */
  51. switch (omapdss_get_version()) {
  52. case OMAPDSS_VER_OMAP24xx:
  53. case OMAPDSS_VER_OMAP34xx_ES1:
  54. case OMAPDSS_VER_OMAP34xx_ES3:
  55. case OMAPDSS_VER_OMAP3630:
  56. case OMAPDSS_VER_AM35xx:
  57. return NULL;
  58. case OMAPDSS_VER_OMAP4430_ES1:
  59. case OMAPDSS_VER_OMAP4430_ES2:
  60. case OMAPDSS_VER_OMAP4:
  61. switch (channel) {
  62. case OMAP_DSS_CHANNEL_LCD:
  63. return dsi_get_dsidev_from_id(0);
  64. case OMAP_DSS_CHANNEL_LCD2:
  65. return dsi_get_dsidev_from_id(1);
  66. default:
  67. return NULL;
  68. }
  69. case OMAPDSS_VER_OMAP5:
  70. switch (channel) {
  71. case OMAP_DSS_CHANNEL_LCD:
  72. return dsi_get_dsidev_from_id(0);
  73. case OMAP_DSS_CHANNEL_LCD3:
  74. return dsi_get_dsidev_from_id(1);
  75. default:
  76. return NULL;
  77. }
  78. default:
  79. return NULL;
  80. }
  81. }
  82. static enum omap_dss_clk_source dpi_get_alt_clk_src(enum omap_channel channel)
  83. {
  84. switch (channel) {
  85. case OMAP_DSS_CHANNEL_LCD:
  86. return OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC;
  87. case OMAP_DSS_CHANNEL_LCD2:
  88. return OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC;
  89. default:
  90. /* this shouldn't happen */
  91. WARN_ON(1);
  92. return OMAP_DSS_CLK_SRC_FCK;
  93. }
  94. }
  95. struct dpi_clk_calc_ctx {
  96. struct platform_device *dsidev;
  97. /* inputs */
  98. unsigned long pck_min, pck_max;
  99. /* outputs */
  100. struct dsi_clock_info dsi_cinfo;
  101. unsigned long long fck;
  102. struct dispc_clock_info dispc_cinfo;
  103. };
  104. static bool dpi_calc_dispc_cb(int lckd, int pckd, unsigned long lck,
  105. unsigned long pck, void *data)
  106. {
  107. struct dpi_clk_calc_ctx *ctx = data;
  108. /*
  109. * Odd dividers give us uneven duty cycle, causing problem when level
  110. * shifted. So skip all odd dividers when the pixel clock is on the
  111. * higher side.
  112. */
  113. if (ctx->pck_min >= 100000000) {
  114. if (lckd > 1 && lckd % 2 != 0)
  115. return false;
  116. if (pckd > 1 && pckd % 2 != 0)
  117. return false;
  118. }
  119. ctx->dispc_cinfo.lck_div = lckd;
  120. ctx->dispc_cinfo.pck_div = pckd;
  121. ctx->dispc_cinfo.lck = lck;
  122. ctx->dispc_cinfo.pck = pck;
  123. return true;
  124. }
  125. static bool dpi_calc_hsdiv_cb(int regm_dispc, unsigned long dispc,
  126. void *data)
  127. {
  128. struct dpi_clk_calc_ctx *ctx = data;
  129. /*
  130. * Odd dividers give us uneven duty cycle, causing problem when level
  131. * shifted. So skip all odd dividers when the pixel clock is on the
  132. * higher side.
  133. */
  134. if (regm_dispc > 1 && regm_dispc % 2 != 0 && ctx->pck_min >= 100000000)
  135. return false;
  136. ctx->dsi_cinfo.regm_dispc = regm_dispc;
  137. ctx->dsi_cinfo.dsi_pll_hsdiv_dispc_clk = dispc;
  138. return dispc_div_calc(dispc, ctx->pck_min, ctx->pck_max,
  139. dpi_calc_dispc_cb, ctx);
  140. }
  141. static bool dpi_calc_pll_cb(int regn, int regm, unsigned long fint,
  142. unsigned long pll,
  143. void *data)
  144. {
  145. struct dpi_clk_calc_ctx *ctx = data;
  146. ctx->dsi_cinfo.regn = regn;
  147. ctx->dsi_cinfo.regm = regm;
  148. ctx->dsi_cinfo.fint = fint;
  149. ctx->dsi_cinfo.clkin4ddr = pll;
  150. return dsi_hsdiv_calc(ctx->dsidev, pll, ctx->pck_min,
  151. dpi_calc_hsdiv_cb, ctx);
  152. }
  153. static bool dpi_calc_dss_cb(unsigned long fck, void *data)
  154. {
  155. struct dpi_clk_calc_ctx *ctx = data;
  156. ctx->fck = fck;
  157. return dispc_div_calc(fck, ctx->pck_min, ctx->pck_max,
  158. dpi_calc_dispc_cb, ctx);
  159. }
  160. static bool dpi_dsi_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
  161. {
  162. unsigned long clkin;
  163. unsigned long pll_min, pll_max;
  164. clkin = dsi_get_pll_clkin(dpi.dsidev);
  165. memset(ctx, 0, sizeof(*ctx));
  166. ctx->dsidev = dpi.dsidev;
  167. ctx->pck_min = pck - 1000;
  168. ctx->pck_max = pck + 1000;
  169. ctx->dsi_cinfo.clkin = clkin;
  170. pll_min = 0;
  171. pll_max = 0;
  172. return dsi_pll_calc(dpi.dsidev, clkin,
  173. pll_min, pll_max,
  174. dpi_calc_pll_cb, ctx);
  175. }
  176. static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx)
  177. {
  178. int i;
  179. /*
  180. * DSS fck gives us very few possibilities, so finding a good pixel
  181. * clock may not be possible. We try multiple times to find the clock,
  182. * each time widening the pixel clock range we look for, up to
  183. * +/- ~15MHz.
  184. */
  185. for (i = 0; i < 25; ++i) {
  186. bool ok;
  187. memset(ctx, 0, sizeof(*ctx));
  188. if (pck > 1000 * i * i * i)
  189. ctx->pck_min = max(pck - 1000 * i * i * i, 0lu);
  190. else
  191. ctx->pck_min = 0;
  192. ctx->pck_max = pck + 1000 * i * i * i;
  193. ok = dss_div_calc(ctx->pck_min, dpi_calc_dss_cb, ctx);
  194. if (ok)
  195. return ok;
  196. }
  197. return false;
  198. }
  199. static int dpi_set_dsi_clk(enum omap_channel channel,
  200. unsigned long pck_req, unsigned long *fck, int *lck_div,
  201. int *pck_div)
  202. {
  203. struct dpi_clk_calc_ctx ctx;
  204. int r;
  205. bool ok;
  206. ok = dpi_dsi_clk_calc(pck_req, &ctx);
  207. if (!ok)
  208. return -EINVAL;
  209. r = dsi_pll_set_clock_div(dpi.dsidev, &ctx.dsi_cinfo);
  210. if (r)
  211. return r;
  212. dss_select_lcd_clk_source(channel,
  213. dpi_get_alt_clk_src(channel));
  214. dpi.mgr_config.clock_info = ctx.dispc_cinfo;
  215. *fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
  216. *lck_div = ctx.dispc_cinfo.lck_div;
  217. *pck_div = ctx.dispc_cinfo.pck_div;
  218. return 0;
  219. }
  220. static int dpi_set_dispc_clk(unsigned long pck_req, unsigned long *fck,
  221. int *lck_div, int *pck_div)
  222. {
  223. struct dpi_clk_calc_ctx ctx;
  224. int r;
  225. bool ok;
  226. ok = dpi_dss_clk_calc(pck_req, &ctx);
  227. if (!ok)
  228. return -EINVAL;
  229. r = dss_set_fck_rate(ctx.fck);
  230. if (r)
  231. return r;
  232. dpi.mgr_config.clock_info = ctx.dispc_cinfo;
  233. *fck = ctx.fck;
  234. *lck_div = ctx.dispc_cinfo.lck_div;
  235. *pck_div = ctx.dispc_cinfo.pck_div;
  236. return 0;
  237. }
  238. static int dpi_set_mode(struct omap_overlay_manager *mgr)
  239. {
  240. struct omap_video_timings *t = &dpi.timings;
  241. int lck_div = 0, pck_div = 0;
  242. unsigned long fck = 0;
  243. unsigned long pck;
  244. int r = 0;
  245. if (dpi.dsidev)
  246. r = dpi_set_dsi_clk(mgr->id, t->pixel_clock * 1000, &fck,
  247. &lck_div, &pck_div);
  248. else
  249. r = dpi_set_dispc_clk(t->pixel_clock * 1000, &fck,
  250. &lck_div, &pck_div);
  251. if (r)
  252. return r;
  253. pck = fck / lck_div / pck_div / 1000;
  254. if (pck != t->pixel_clock) {
  255. DSSWARN("Could not find exact pixel clock. "
  256. "Requested %d kHz, got %lu kHz\n",
  257. t->pixel_clock, pck);
  258. t->pixel_clock = pck;
  259. }
  260. dss_mgr_set_timings(mgr, t);
  261. return 0;
  262. }
  263. static void dpi_config_lcd_manager(struct omap_overlay_manager *mgr)
  264. {
  265. dpi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
  266. dpi.mgr_config.stallmode = false;
  267. dpi.mgr_config.fifohandcheck = false;
  268. dpi.mgr_config.video_port_width = dpi.data_lines;
  269. dpi.mgr_config.lcden_sig_polarity = 0;
  270. dss_mgr_set_lcd_config(mgr, &dpi.mgr_config);
  271. }
  272. static int dpi_display_enable(struct omap_dss_device *dssdev)
  273. {
  274. struct omap_dss_device *out = &dpi.output;
  275. int r;
  276. mutex_lock(&dpi.lock);
  277. if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI) && !dpi.vdds_dsi_reg) {
  278. DSSERR("no VDSS_DSI regulator\n");
  279. r = -ENODEV;
  280. goto err_no_reg;
  281. }
  282. if (out == NULL || out->manager == NULL) {
  283. DSSERR("failed to enable display: no output/manager\n");
  284. r = -ENODEV;
  285. goto err_no_out_mgr;
  286. }
  287. if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
  288. r = regulator_enable(dpi.vdds_dsi_reg);
  289. if (r)
  290. goto err_reg_enable;
  291. }
  292. r = dispc_runtime_get();
  293. if (r)
  294. goto err_get_dispc;
  295. r = dss_dpi_select_source(out->manager->id);
  296. if (r)
  297. goto err_src_sel;
  298. if (dpi.dsidev) {
  299. r = dsi_runtime_get(dpi.dsidev);
  300. if (r)
  301. goto err_get_dsi;
  302. r = dsi_pll_init(dpi.dsidev, 0, 1);
  303. if (r)
  304. goto err_dsi_pll_init;
  305. }
  306. r = dpi_set_mode(out->manager);
  307. if (r)
  308. goto err_set_mode;
  309. dpi_config_lcd_manager(out->manager);
  310. mdelay(2);
  311. r = dss_mgr_enable(out->manager);
  312. if (r)
  313. goto err_mgr_enable;
  314. mutex_unlock(&dpi.lock);
  315. return 0;
  316. err_mgr_enable:
  317. err_set_mode:
  318. if (dpi.dsidev)
  319. dsi_pll_uninit(dpi.dsidev, true);
  320. err_dsi_pll_init:
  321. if (dpi.dsidev)
  322. dsi_runtime_put(dpi.dsidev);
  323. err_get_dsi:
  324. err_src_sel:
  325. dispc_runtime_put();
  326. err_get_dispc:
  327. if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
  328. regulator_disable(dpi.vdds_dsi_reg);
  329. err_reg_enable:
  330. err_no_out_mgr:
  331. err_no_reg:
  332. mutex_unlock(&dpi.lock);
  333. return r;
  334. }
  335. static void dpi_display_disable(struct omap_dss_device *dssdev)
  336. {
  337. struct omap_overlay_manager *mgr = dpi.output.manager;
  338. mutex_lock(&dpi.lock);
  339. dss_mgr_disable(mgr);
  340. if (dpi.dsidev) {
  341. dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
  342. dsi_pll_uninit(dpi.dsidev, true);
  343. dsi_runtime_put(dpi.dsidev);
  344. }
  345. dispc_runtime_put();
  346. if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
  347. regulator_disable(dpi.vdds_dsi_reg);
  348. mutex_unlock(&dpi.lock);
  349. }
  350. static void dpi_set_timings(struct omap_dss_device *dssdev,
  351. struct omap_video_timings *timings)
  352. {
  353. DSSDBG("dpi_set_timings\n");
  354. mutex_lock(&dpi.lock);
  355. dpi.timings = *timings;
  356. mutex_unlock(&dpi.lock);
  357. }
  358. static void dpi_get_timings(struct omap_dss_device *dssdev,
  359. struct omap_video_timings *timings)
  360. {
  361. mutex_lock(&dpi.lock);
  362. *timings = dpi.timings;
  363. mutex_unlock(&dpi.lock);
  364. }
  365. static int dpi_check_timings(struct omap_dss_device *dssdev,
  366. struct omap_video_timings *timings)
  367. {
  368. struct omap_overlay_manager *mgr = dpi.output.manager;
  369. int lck_div, pck_div;
  370. unsigned long fck;
  371. unsigned long pck;
  372. struct dpi_clk_calc_ctx ctx;
  373. bool ok;
  374. if (mgr && !dispc_mgr_timings_ok(mgr->id, timings))
  375. return -EINVAL;
  376. if (timings->pixel_clock == 0)
  377. return -EINVAL;
  378. if (dpi.dsidev) {
  379. ok = dpi_dsi_clk_calc(timings->pixel_clock * 1000, &ctx);
  380. if (!ok)
  381. return -EINVAL;
  382. fck = ctx.dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
  383. } else {
  384. ok = dpi_dss_clk_calc(timings->pixel_clock * 1000, &ctx);
  385. if (!ok)
  386. return -EINVAL;
  387. fck = ctx.fck;
  388. }
  389. lck_div = ctx.dispc_cinfo.lck_div;
  390. pck_div = ctx.dispc_cinfo.pck_div;
  391. pck = fck / lck_div / pck_div / 1000;
  392. timings->pixel_clock = pck;
  393. return 0;
  394. }
  395. static void dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines)
  396. {
  397. mutex_lock(&dpi.lock);
  398. dpi.data_lines = data_lines;
  399. mutex_unlock(&dpi.lock);
  400. }
  401. static int dpi_verify_dsi_pll(struct platform_device *dsidev)
  402. {
  403. int r;
  404. /* do initial setup with the PLL to see if it is operational */
  405. r = dsi_runtime_get(dsidev);
  406. if (r)
  407. return r;
  408. r = dsi_pll_init(dsidev, 0, 1);
  409. if (r) {
  410. dsi_runtime_put(dsidev);
  411. return r;
  412. }
  413. dsi_pll_uninit(dsidev, true);
  414. dsi_runtime_put(dsidev);
  415. return 0;
  416. }
  417. static int dpi_init_regulator(void)
  418. {
  419. struct regulator *vdds_dsi;
  420. if (!dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
  421. return 0;
  422. if (dpi.vdds_dsi_reg)
  423. return 0;
  424. vdds_dsi = devm_regulator_get(&dpi.pdev->dev, "vdds_dsi");
  425. if (IS_ERR(vdds_dsi)) {
  426. DSSERR("can't get VDDS_DSI regulator\n");
  427. return PTR_ERR(vdds_dsi);
  428. }
  429. dpi.vdds_dsi_reg = vdds_dsi;
  430. return 0;
  431. }
  432. static void dpi_init_pll(void)
  433. {
  434. struct platform_device *dsidev;
  435. if (dpi.dsidev)
  436. return;
  437. dsidev = dpi_get_dsidev(dpi.output.dispc_channel);
  438. if (!dsidev)
  439. return;
  440. if (dpi_verify_dsi_pll(dsidev)) {
  441. DSSWARN("DSI PLL not operational\n");
  442. return;
  443. }
  444. dpi.dsidev = dsidev;
  445. }
  446. /*
  447. * Return a hardcoded channel for the DPI output. This should work for
  448. * current use cases, but this can be later expanded to either resolve
  449. * the channel in some more dynamic manner, or get the channel as a user
  450. * parameter.
  451. */
  452. static enum omap_channel dpi_get_channel(void)
  453. {
  454. switch (omapdss_get_version()) {
  455. case OMAPDSS_VER_OMAP24xx:
  456. case OMAPDSS_VER_OMAP34xx_ES1:
  457. case OMAPDSS_VER_OMAP34xx_ES3:
  458. case OMAPDSS_VER_OMAP3630:
  459. case OMAPDSS_VER_AM35xx:
  460. return OMAP_DSS_CHANNEL_LCD;
  461. case OMAPDSS_VER_OMAP4430_ES1:
  462. case OMAPDSS_VER_OMAP4430_ES2:
  463. case OMAPDSS_VER_OMAP4:
  464. return OMAP_DSS_CHANNEL_LCD2;
  465. case OMAPDSS_VER_OMAP5:
  466. return OMAP_DSS_CHANNEL_LCD3;
  467. default:
  468. DSSWARN("unsupported DSS version\n");
  469. return OMAP_DSS_CHANNEL_LCD;
  470. }
  471. }
  472. static int dpi_connect(struct omap_dss_device *dssdev,
  473. struct omap_dss_device *dst)
  474. {
  475. struct omap_overlay_manager *mgr;
  476. int r;
  477. r = dpi_init_regulator();
  478. if (r)
  479. return r;
  480. dpi_init_pll();
  481. mgr = omap_dss_get_overlay_manager(dssdev->dispc_channel);
  482. if (!mgr)
  483. return -ENODEV;
  484. r = dss_mgr_connect(mgr, dssdev);
  485. if (r)
  486. return r;
  487. r = omapdss_output_set_device(dssdev, dst);
  488. if (r) {
  489. DSSERR("failed to connect output to new device: %s\n",
  490. dst->name);
  491. dss_mgr_disconnect(mgr, dssdev);
  492. return r;
  493. }
  494. return 0;
  495. }
  496. static void dpi_disconnect(struct omap_dss_device *dssdev,
  497. struct omap_dss_device *dst)
  498. {
  499. WARN_ON(dst != dssdev->dst);
  500. if (dst != dssdev->dst)
  501. return;
  502. omapdss_output_unset_device(dssdev);
  503. if (dssdev->manager)
  504. dss_mgr_disconnect(dssdev->manager, dssdev);
  505. }
  506. static const struct omapdss_dpi_ops dpi_ops = {
  507. .connect = dpi_connect,
  508. .disconnect = dpi_disconnect,
  509. .enable = dpi_display_enable,
  510. .disable = dpi_display_disable,
  511. .check_timings = dpi_check_timings,
  512. .set_timings = dpi_set_timings,
  513. .get_timings = dpi_get_timings,
  514. .set_data_lines = dpi_set_data_lines,
  515. };
  516. static void dpi_init_output(struct platform_device *pdev)
  517. {
  518. struct omap_dss_device *out = &dpi.output;
  519. out->dev = &pdev->dev;
  520. out->id = OMAP_DSS_OUTPUT_DPI;
  521. out->output_type = OMAP_DISPLAY_TYPE_DPI;
  522. out->name = "dpi.0";
  523. out->dispc_channel = dpi_get_channel();
  524. out->ops.dpi = &dpi_ops;
  525. out->owner = THIS_MODULE;
  526. omapdss_register_output(out);
  527. }
  528. static void __exit dpi_uninit_output(struct platform_device *pdev)
  529. {
  530. struct omap_dss_device *out = &dpi.output;
  531. omapdss_unregister_output(out);
  532. }
  533. static int omap_dpi_probe(struct platform_device *pdev)
  534. {
  535. dpi.pdev = pdev;
  536. mutex_init(&dpi.lock);
  537. dpi_init_output(pdev);
  538. return 0;
  539. }
  540. static int __exit omap_dpi_remove(struct platform_device *pdev)
  541. {
  542. dpi_uninit_output(pdev);
  543. return 0;
  544. }
  545. static struct platform_driver omap_dpi_driver = {
  546. .probe = omap_dpi_probe,
  547. .remove = __exit_p(omap_dpi_remove),
  548. .driver = {
  549. .name = "omapdss_dpi",
  550. .owner = THIS_MODULE,
  551. },
  552. };
  553. int __init dpi_init_platform_driver(void)
  554. {
  555. return platform_driver_register(&omap_dpi_driver);
  556. }
  557. void __exit dpi_uninit_platform_driver(void)
  558. {
  559. platform_driver_unregister(&omap_dpi_driver);
  560. }