panel-toppoly-tdo35s.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * LCD panel driver for Toppoly TDO35S
  3. *
  4. * Copyright (C) 2009 CompuLab, Ltd.
  5. * Author: Mike Rapoport <mike@compulab.co.il>
  6. *
  7. * Based on generic panel support
  8. * Copyright (C) 2008 Nokia Corporation
  9. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License version 2 as published by
  13. * the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but WITHOUT
  16. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  17. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  18. * more details.
  19. *
  20. * You should have received a copy of the GNU General Public License along with
  21. * this program. If not, see <http://www.gnu.org/licenses/>.
  22. */
  23. #include <linux/module.h>
  24. #include <linux/delay.h>
  25. #include <plat/display.h>
  26. static struct omap_video_timings toppoly_tdo_panel_timings = {
  27. /* 640 x 480 @ 60 Hz Reduced blanking VESA CVT 0.31M3-R */
  28. .x_res = 480,
  29. .y_res = 640,
  30. .pixel_clock = 26000,
  31. .hfp = 104,
  32. .hsw = 8,
  33. .hbp = 8,
  34. .vfp = 4,
  35. .vsw = 2,
  36. .vbp = 2,
  37. };
  38. static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev)
  39. {
  40. dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
  41. OMAP_DSS_LCD_IHS;
  42. dssdev->panel.timings = toppoly_tdo_panel_timings;
  43. return 0;
  44. }
  45. static void toppoly_tdo_panel_remove(struct omap_dss_device *dssdev)
  46. {
  47. }
  48. static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev)
  49. {
  50. int r = 0;
  51. if (dssdev->platform_enable)
  52. r = dssdev->platform_enable(dssdev);
  53. return r;
  54. }
  55. static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev)
  56. {
  57. if (dssdev->platform_disable)
  58. dssdev->platform_disable(dssdev);
  59. }
  60. static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev)
  61. {
  62. toppoly_tdo_panel_disable(dssdev);
  63. return 0;
  64. }
  65. static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev)
  66. {
  67. return toppoly_tdo_panel_enable(dssdev);
  68. }
  69. static struct omap_dss_driver generic_driver = {
  70. .probe = toppoly_tdo_panel_probe,
  71. .remove = toppoly_tdo_panel_remove,
  72. .enable = toppoly_tdo_panel_enable,
  73. .disable = toppoly_tdo_panel_disable,
  74. .suspend = toppoly_tdo_panel_suspend,
  75. .resume = toppoly_tdo_panel_resume,
  76. .driver = {
  77. .name = "toppoly_tdo35s_panel",
  78. .owner = THIS_MODULE,
  79. },
  80. };
  81. static int __init toppoly_tdo_panel_drv_init(void)
  82. {
  83. return omap_dss_register_driver(&generic_driver);
  84. }
  85. static void __exit toppoly_tdo_panel_drv_exit(void)
  86. {
  87. omap_dss_unregister_driver(&generic_driver);
  88. }
  89. module_init(toppoly_tdo_panel_drv_init);
  90. module_exit(toppoly_tdo_panel_drv_exit);
  91. MODULE_LICENSE("GPL");