tilcdc_drv.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /*
  2. * Copyright (C) 2012 Texas Instruments
  3. * Author: Rob Clark <robdclark@gmail.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 as published by
  7. * the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /* LCDC DRM driver, based on da8xx-fb */
  18. #include "tilcdc_drv.h"
  19. #include "tilcdc_regs.h"
  20. #include "tilcdc_tfp410.h"
  21. #include "tilcdc_slave.h"
  22. #include "tilcdc_panel.h"
  23. #include "drm_fb_helper.h"
  24. static LIST_HEAD(module_list);
  25. static bool slave_probing;
  26. void tilcdc_module_init(struct tilcdc_module *mod, const char *name,
  27. const struct tilcdc_module_ops *funcs)
  28. {
  29. mod->name = name;
  30. mod->funcs = funcs;
  31. INIT_LIST_HEAD(&mod->list);
  32. list_add(&mod->list, &module_list);
  33. }
  34. void tilcdc_module_cleanup(struct tilcdc_module *mod)
  35. {
  36. list_del(&mod->list);
  37. }
  38. void tilcdc_slave_probedefer(bool defered)
  39. {
  40. slave_probing = defered;
  41. }
  42. static struct of_device_id tilcdc_of_match[];
  43. static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev,
  44. struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd)
  45. {
  46. return drm_fb_cma_create(dev, file_priv, mode_cmd);
  47. }
  48. static void tilcdc_fb_output_poll_changed(struct drm_device *dev)
  49. {
  50. struct tilcdc_drm_private *priv = dev->dev_private;
  51. if (priv->fbdev)
  52. drm_fbdev_cma_hotplug_event(priv->fbdev);
  53. }
  54. static const struct drm_mode_config_funcs mode_config_funcs = {
  55. .fb_create = tilcdc_fb_create,
  56. .output_poll_changed = tilcdc_fb_output_poll_changed,
  57. };
  58. static int modeset_init(struct drm_device *dev)
  59. {
  60. struct tilcdc_drm_private *priv = dev->dev_private;
  61. struct tilcdc_module *mod;
  62. drm_mode_config_init(dev);
  63. priv->crtc = tilcdc_crtc_create(dev);
  64. list_for_each_entry(mod, &module_list, list) {
  65. DBG("loading module: %s", mod->name);
  66. mod->funcs->modeset_init(mod, dev);
  67. }
  68. if ((priv->num_encoders == 0) || (priv->num_connectors == 0)) {
  69. /* oh nos! */
  70. dev_err(dev->dev, "no encoders/connectors found\n");
  71. return -ENXIO;
  72. }
  73. dev->mode_config.min_width = 0;
  74. dev->mode_config.min_height = 0;
  75. dev->mode_config.max_width = tilcdc_crtc_max_width(priv->crtc);
  76. dev->mode_config.max_height = 2048;
  77. dev->mode_config.funcs = &mode_config_funcs;
  78. return 0;
  79. }
  80. #ifdef CONFIG_CPU_FREQ
  81. static int cpufreq_transition(struct notifier_block *nb,
  82. unsigned long val, void *data)
  83. {
  84. struct tilcdc_drm_private *priv = container_of(nb,
  85. struct tilcdc_drm_private, freq_transition);
  86. if (val == CPUFREQ_POSTCHANGE) {
  87. if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) {
  88. priv->lcd_fck_rate = clk_get_rate(priv->clk);
  89. tilcdc_crtc_update_clk(priv->crtc);
  90. }
  91. }
  92. return 0;
  93. }
  94. #endif
  95. /*
  96. * DRM operations:
  97. */
  98. static int tilcdc_unload(struct drm_device *dev)
  99. {
  100. struct tilcdc_drm_private *priv = dev->dev_private;
  101. drm_fbdev_cma_fini(priv->fbdev);
  102. drm_kms_helper_poll_fini(dev);
  103. drm_mode_config_cleanup(dev);
  104. drm_vblank_cleanup(dev);
  105. pm_runtime_get_sync(dev->dev);
  106. drm_irq_uninstall(dev);
  107. pm_runtime_put_sync(dev->dev);
  108. #ifdef CONFIG_CPU_FREQ
  109. cpufreq_unregister_notifier(&priv->freq_transition,
  110. CPUFREQ_TRANSITION_NOTIFIER);
  111. #endif
  112. if (priv->clk)
  113. clk_put(priv->clk);
  114. if (priv->mmio)
  115. iounmap(priv->mmio);
  116. flush_workqueue(priv->wq);
  117. destroy_workqueue(priv->wq);
  118. dev->dev_private = NULL;
  119. pm_runtime_disable(dev->dev);
  120. kfree(priv);
  121. return 0;
  122. }
  123. static int tilcdc_load(struct drm_device *dev, unsigned long flags)
  124. {
  125. struct platform_device *pdev = dev->platformdev;
  126. struct device_node *node = pdev->dev.of_node;
  127. struct tilcdc_drm_private *priv;
  128. struct tilcdc_module *mod;
  129. struct resource *res;
  130. u32 bpp = 0;
  131. int ret;
  132. priv = kzalloc(sizeof(*priv), GFP_KERNEL);
  133. if (!priv) {
  134. dev_err(dev->dev, "failed to allocate private data\n");
  135. return -ENOMEM;
  136. }
  137. dev->dev_private = priv;
  138. priv->wq = alloc_ordered_workqueue("tilcdc", 0);
  139. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  140. if (!res) {
  141. dev_err(dev->dev, "failed to get memory resource\n");
  142. ret = -EINVAL;
  143. goto fail;
  144. }
  145. priv->mmio = ioremap_nocache(res->start, resource_size(res));
  146. if (!priv->mmio) {
  147. dev_err(dev->dev, "failed to ioremap\n");
  148. ret = -ENOMEM;
  149. goto fail;
  150. }
  151. priv->clk = clk_get(dev->dev, "fck");
  152. if (IS_ERR(priv->clk)) {
  153. dev_err(dev->dev, "failed to get functional clock\n");
  154. ret = -ENODEV;
  155. goto fail;
  156. }
  157. priv->disp_clk = clk_get(dev->dev, "dpll_disp_ck");
  158. if (IS_ERR(priv->clk)) {
  159. dev_err(dev->dev, "failed to get display clock\n");
  160. ret = -ENODEV;
  161. goto fail;
  162. }
  163. #ifdef CONFIG_CPU_FREQ
  164. priv->lcd_fck_rate = clk_get_rate(priv->clk);
  165. priv->freq_transition.notifier_call = cpufreq_transition;
  166. ret = cpufreq_register_notifier(&priv->freq_transition,
  167. CPUFREQ_TRANSITION_NOTIFIER);
  168. if (ret) {
  169. dev_err(dev->dev, "failed to register cpufreq notifier\n");
  170. goto fail;
  171. }
  172. #endif
  173. if (of_property_read_u32(node, "max-bandwidth", &priv->max_bandwidth))
  174. priv->max_bandwidth = TILCDC_DEFAULT_MAX_BANDWIDTH;
  175. DBG("Maximum Bandwidth Value %d", priv->max_bandwidth);
  176. if (of_property_read_u32(node, "ti,max-width", &priv->max_width))
  177. priv->max_width = TILCDC_DEFAULT_MAX_WIDTH;
  178. DBG("Maximum Horizontal Pixel Width Value %dpixels", priv->max_width);
  179. if (of_property_read_u32(node, "ti,max-pixelclock",
  180. &priv->max_pixelclock))
  181. priv->max_pixelclock = TILCDC_DEFAULT_MAX_PIXELCLOCK;
  182. DBG("Maximum Pixel Clock Value %dKHz", priv->max_pixelclock);
  183. pm_runtime_enable(dev->dev);
  184. /* Determine LCD IP Version */
  185. pm_runtime_get_sync(dev->dev);
  186. switch (tilcdc_read(dev, LCDC_PID_REG)) {
  187. case 0x4c100102:
  188. priv->rev = 1;
  189. break;
  190. case 0x4f200800:
  191. case 0x4f201000:
  192. priv->rev = 2;
  193. break;
  194. default:
  195. dev_warn(dev->dev, "Unknown PID Reg value 0x%08x, "
  196. "defaulting to LCD revision 1\n",
  197. tilcdc_read(dev, LCDC_PID_REG));
  198. priv->rev = 1;
  199. break;
  200. }
  201. pm_runtime_put_sync(dev->dev);
  202. ret = modeset_init(dev);
  203. if (ret < 0) {
  204. dev_err(dev->dev, "failed to initialize mode setting\n");
  205. goto fail;
  206. }
  207. ret = drm_vblank_init(dev, 1);
  208. if (ret < 0) {
  209. dev_err(dev->dev, "failed to initialize vblank\n");
  210. goto fail;
  211. }
  212. pm_runtime_get_sync(dev->dev);
  213. ret = drm_irq_install(dev, platform_get_irq(dev->platformdev, 0));
  214. pm_runtime_put_sync(dev->dev);
  215. if (ret < 0) {
  216. dev_err(dev->dev, "failed to install IRQ handler\n");
  217. goto fail;
  218. }
  219. platform_set_drvdata(pdev, dev);
  220. list_for_each_entry(mod, &module_list, list) {
  221. DBG("%s: preferred_bpp: %d", mod->name, mod->preferred_bpp);
  222. bpp = mod->preferred_bpp;
  223. if (bpp > 0)
  224. break;
  225. }
  226. priv->fbdev = drm_fbdev_cma_init(dev, bpp,
  227. dev->mode_config.num_crtc,
  228. dev->mode_config.num_connector);
  229. drm_kms_helper_poll_init(dev);
  230. return 0;
  231. fail:
  232. tilcdc_unload(dev);
  233. return ret;
  234. }
  235. static void tilcdc_preclose(struct drm_device *dev, struct drm_file *file)
  236. {
  237. struct tilcdc_drm_private *priv = dev->dev_private;
  238. tilcdc_crtc_cancel_page_flip(priv->crtc, file);
  239. }
  240. static void tilcdc_lastclose(struct drm_device *dev)
  241. {
  242. struct tilcdc_drm_private *priv = dev->dev_private;
  243. drm_fbdev_cma_restore_mode(priv->fbdev);
  244. }
  245. static irqreturn_t tilcdc_irq(int irq, void *arg)
  246. {
  247. struct drm_device *dev = arg;
  248. struct tilcdc_drm_private *priv = dev->dev_private;
  249. return tilcdc_crtc_irq(priv->crtc);
  250. }
  251. static void tilcdc_irq_preinstall(struct drm_device *dev)
  252. {
  253. tilcdc_clear_irqstatus(dev, 0xffffffff);
  254. }
  255. static int tilcdc_irq_postinstall(struct drm_device *dev)
  256. {
  257. struct tilcdc_drm_private *priv = dev->dev_private;
  258. /* enable FIFO underflow irq: */
  259. if (priv->rev == 1)
  260. tilcdc_set(dev, LCDC_RASTER_CTRL_REG, LCDC_V1_UNDERFLOW_INT_ENA);
  261. else
  262. tilcdc_set(dev, LCDC_INT_ENABLE_SET_REG, LCDC_V2_UNDERFLOW_INT_ENA);
  263. return 0;
  264. }
  265. static void tilcdc_irq_uninstall(struct drm_device *dev)
  266. {
  267. struct tilcdc_drm_private *priv = dev->dev_private;
  268. /* disable irqs that we might have enabled: */
  269. if (priv->rev == 1) {
  270. tilcdc_clear(dev, LCDC_RASTER_CTRL_REG,
  271. LCDC_V1_UNDERFLOW_INT_ENA | LCDC_V1_PL_INT_ENA);
  272. tilcdc_clear(dev, LCDC_DMA_CTRL_REG, LCDC_V1_END_OF_FRAME_INT_ENA);
  273. } else {
  274. tilcdc_clear(dev, LCDC_INT_ENABLE_SET_REG,
  275. LCDC_V2_UNDERFLOW_INT_ENA | LCDC_V2_PL_INT_ENA |
  276. LCDC_V2_END_OF_FRAME0_INT_ENA | LCDC_V2_END_OF_FRAME1_INT_ENA |
  277. LCDC_FRAME_DONE);
  278. }
  279. }
  280. static void enable_vblank(struct drm_device *dev, bool enable)
  281. {
  282. struct tilcdc_drm_private *priv = dev->dev_private;
  283. u32 reg, mask;
  284. if (priv->rev == 1) {
  285. reg = LCDC_DMA_CTRL_REG;
  286. mask = LCDC_V1_END_OF_FRAME_INT_ENA;
  287. } else {
  288. reg = LCDC_INT_ENABLE_SET_REG;
  289. mask = LCDC_V2_END_OF_FRAME0_INT_ENA |
  290. LCDC_V2_END_OF_FRAME1_INT_ENA | LCDC_FRAME_DONE;
  291. }
  292. if (enable)
  293. tilcdc_set(dev, reg, mask);
  294. else
  295. tilcdc_clear(dev, reg, mask);
  296. }
  297. static int tilcdc_enable_vblank(struct drm_device *dev, int crtc)
  298. {
  299. enable_vblank(dev, true);
  300. return 0;
  301. }
  302. static void tilcdc_disable_vblank(struct drm_device *dev, int crtc)
  303. {
  304. enable_vblank(dev, false);
  305. }
  306. #if defined(CONFIG_DEBUG_FS) || defined(CONFIG_PM_SLEEP)
  307. static const struct {
  308. const char *name;
  309. uint8_t rev;
  310. uint8_t save;
  311. uint32_t reg;
  312. } registers[] = {
  313. #define REG(rev, save, reg) { #reg, rev, save, reg }
  314. /* exists in revision 1: */
  315. REG(1, false, LCDC_PID_REG),
  316. REG(1, true, LCDC_CTRL_REG),
  317. REG(1, false, LCDC_STAT_REG),
  318. REG(1, true, LCDC_RASTER_CTRL_REG),
  319. REG(1, true, LCDC_RASTER_TIMING_0_REG),
  320. REG(1, true, LCDC_RASTER_TIMING_1_REG),
  321. REG(1, true, LCDC_RASTER_TIMING_2_REG),
  322. REG(1, true, LCDC_DMA_CTRL_REG),
  323. REG(1, true, LCDC_DMA_FB_BASE_ADDR_0_REG),
  324. REG(1, true, LCDC_DMA_FB_CEILING_ADDR_0_REG),
  325. REG(1, true, LCDC_DMA_FB_BASE_ADDR_1_REG),
  326. REG(1, true, LCDC_DMA_FB_CEILING_ADDR_1_REG),
  327. /* new in revision 2: */
  328. REG(2, false, LCDC_RAW_STAT_REG),
  329. REG(2, false, LCDC_MASKED_STAT_REG),
  330. REG(2, false, LCDC_INT_ENABLE_SET_REG),
  331. REG(2, false, LCDC_INT_ENABLE_CLR_REG),
  332. REG(2, false, LCDC_END_OF_INT_IND_REG),
  333. REG(2, true, LCDC_CLK_ENABLE_REG),
  334. REG(2, true, LCDC_INT_ENABLE_SET_REG),
  335. #undef REG
  336. };
  337. #endif
  338. #ifdef CONFIG_DEBUG_FS
  339. static int tilcdc_regs_show(struct seq_file *m, void *arg)
  340. {
  341. struct drm_info_node *node = (struct drm_info_node *) m->private;
  342. struct drm_device *dev = node->minor->dev;
  343. struct tilcdc_drm_private *priv = dev->dev_private;
  344. unsigned i;
  345. pm_runtime_get_sync(dev->dev);
  346. seq_printf(m, "revision: %d\n", priv->rev);
  347. for (i = 0; i < ARRAY_SIZE(registers); i++)
  348. if (priv->rev >= registers[i].rev)
  349. seq_printf(m, "%s:\t %08x\n", registers[i].name,
  350. tilcdc_read(dev, registers[i].reg));
  351. pm_runtime_put_sync(dev->dev);
  352. return 0;
  353. }
  354. static int tilcdc_mm_show(struct seq_file *m, void *arg)
  355. {
  356. struct drm_info_node *node = (struct drm_info_node *) m->private;
  357. struct drm_device *dev = node->minor->dev;
  358. return drm_mm_dump_table(m, &dev->vma_offset_manager->vm_addr_space_mm);
  359. }
  360. static struct drm_info_list tilcdc_debugfs_list[] = {
  361. { "regs", tilcdc_regs_show, 0 },
  362. { "mm", tilcdc_mm_show, 0 },
  363. { "fb", drm_fb_cma_debugfs_show, 0 },
  364. };
  365. static int tilcdc_debugfs_init(struct drm_minor *minor)
  366. {
  367. struct drm_device *dev = minor->dev;
  368. struct tilcdc_module *mod;
  369. int ret;
  370. ret = drm_debugfs_create_files(tilcdc_debugfs_list,
  371. ARRAY_SIZE(tilcdc_debugfs_list),
  372. minor->debugfs_root, minor);
  373. list_for_each_entry(mod, &module_list, list)
  374. if (mod->funcs->debugfs_init)
  375. mod->funcs->debugfs_init(mod, minor);
  376. if (ret) {
  377. dev_err(dev->dev, "could not install tilcdc_debugfs_list\n");
  378. return ret;
  379. }
  380. return ret;
  381. }
  382. static void tilcdc_debugfs_cleanup(struct drm_minor *minor)
  383. {
  384. struct tilcdc_module *mod;
  385. drm_debugfs_remove_files(tilcdc_debugfs_list,
  386. ARRAY_SIZE(tilcdc_debugfs_list), minor);
  387. list_for_each_entry(mod, &module_list, list)
  388. if (mod->funcs->debugfs_cleanup)
  389. mod->funcs->debugfs_cleanup(mod, minor);
  390. }
  391. #endif
  392. static const struct file_operations fops = {
  393. .owner = THIS_MODULE,
  394. .open = drm_open,
  395. .release = drm_release,
  396. .unlocked_ioctl = drm_ioctl,
  397. #ifdef CONFIG_COMPAT
  398. .compat_ioctl = drm_compat_ioctl,
  399. #endif
  400. .poll = drm_poll,
  401. .read = drm_read,
  402. .llseek = no_llseek,
  403. .mmap = drm_gem_cma_mmap,
  404. };
  405. static struct drm_driver tilcdc_driver = {
  406. .driver_features = DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET,
  407. .load = tilcdc_load,
  408. .unload = tilcdc_unload,
  409. .preclose = tilcdc_preclose,
  410. .lastclose = tilcdc_lastclose,
  411. .irq_handler = tilcdc_irq,
  412. .irq_preinstall = tilcdc_irq_preinstall,
  413. .irq_postinstall = tilcdc_irq_postinstall,
  414. .irq_uninstall = tilcdc_irq_uninstall,
  415. .get_vblank_counter = drm_vblank_count,
  416. .enable_vblank = tilcdc_enable_vblank,
  417. .disable_vblank = tilcdc_disable_vblank,
  418. .gem_free_object = drm_gem_cma_free_object,
  419. .gem_vm_ops = &drm_gem_cma_vm_ops,
  420. .dumb_create = drm_gem_cma_dumb_create,
  421. .dumb_map_offset = drm_gem_cma_dumb_map_offset,
  422. .dumb_destroy = drm_gem_dumb_destroy,
  423. #ifdef CONFIG_DEBUG_FS
  424. .debugfs_init = tilcdc_debugfs_init,
  425. .debugfs_cleanup = tilcdc_debugfs_cleanup,
  426. #endif
  427. .fops = &fops,
  428. .name = "tilcdc",
  429. .desc = "TI LCD Controller DRM",
  430. .date = "20121205",
  431. .major = 1,
  432. .minor = 0,
  433. };
  434. /*
  435. * Power management:
  436. */
  437. #ifdef CONFIG_PM_SLEEP
  438. static int tilcdc_pm_suspend(struct device *dev)
  439. {
  440. struct drm_device *ddev = dev_get_drvdata(dev);
  441. struct tilcdc_drm_private *priv = ddev->dev_private;
  442. unsigned i, n = 0;
  443. drm_kms_helper_poll_disable(ddev);
  444. /* Save register state: */
  445. for (i = 0; i < ARRAY_SIZE(registers); i++)
  446. if (registers[i].save && (priv->rev >= registers[i].rev))
  447. priv->saved_register[n++] = tilcdc_read(ddev, registers[i].reg);
  448. return 0;
  449. }
  450. static int tilcdc_pm_resume(struct device *dev)
  451. {
  452. struct drm_device *ddev = dev_get_drvdata(dev);
  453. struct tilcdc_drm_private *priv = ddev->dev_private;
  454. unsigned i, n = 0;
  455. /* Restore register state: */
  456. for (i = 0; i < ARRAY_SIZE(registers); i++)
  457. if (registers[i].save && (priv->rev >= registers[i].rev))
  458. tilcdc_write(ddev, registers[i].reg, priv->saved_register[n++]);
  459. drm_kms_helper_poll_enable(ddev);
  460. return 0;
  461. }
  462. #endif
  463. static const struct dev_pm_ops tilcdc_pm_ops = {
  464. SET_SYSTEM_SLEEP_PM_OPS(tilcdc_pm_suspend, tilcdc_pm_resume)
  465. };
  466. /*
  467. * Platform driver:
  468. */
  469. static int tilcdc_pdev_probe(struct platform_device *pdev)
  470. {
  471. /* bail out early if no DT data: */
  472. if (!pdev->dev.of_node) {
  473. dev_err(&pdev->dev, "device-tree data is missing\n");
  474. return -ENXIO;
  475. }
  476. /* defer probing if slave is in deferred probing */
  477. if (slave_probing == true)
  478. return -EPROBE_DEFER;
  479. return drm_platform_init(&tilcdc_driver, pdev);
  480. }
  481. static int tilcdc_pdev_remove(struct platform_device *pdev)
  482. {
  483. drm_put_dev(platform_get_drvdata(pdev));
  484. return 0;
  485. }
  486. static struct of_device_id tilcdc_of_match[] = {
  487. { .compatible = "ti,am33xx-tilcdc", },
  488. { },
  489. };
  490. MODULE_DEVICE_TABLE(of, tilcdc_of_match);
  491. static struct platform_driver tilcdc_platform_driver = {
  492. .probe = tilcdc_pdev_probe,
  493. .remove = tilcdc_pdev_remove,
  494. .driver = {
  495. .owner = THIS_MODULE,
  496. .name = "tilcdc",
  497. .pm = &tilcdc_pm_ops,
  498. .of_match_table = tilcdc_of_match,
  499. },
  500. };
  501. static int __init tilcdc_drm_init(void)
  502. {
  503. DBG("init");
  504. tilcdc_tfp410_init();
  505. tilcdc_slave_init();
  506. tilcdc_panel_init();
  507. return platform_driver_register(&tilcdc_platform_driver);
  508. }
  509. static void __exit tilcdc_drm_fini(void)
  510. {
  511. DBG("fini");
  512. platform_driver_unregister(&tilcdc_platform_driver);
  513. tilcdc_panel_fini();
  514. tilcdc_slave_fini();
  515. tilcdc_tfp410_fini();
  516. }
  517. module_init(tilcdc_drm_init);
  518. module_exit(tilcdc_drm_fini);
  519. MODULE_AUTHOR("Rob Clark <robdclark@gmail.com");
  520. MODULE_DESCRIPTION("TI LCD Controller DRM Driver");
  521. MODULE_LICENSE("GPL");