lcd_ams_delta.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * Based on drivers/video/omap/lcd_inn1510.c
  3. *
  4. * LCD panel support for the Amstrad E3 (Delta) videophone.
  5. *
  6. * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2 of the License, or (at your
  11. * option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. #include <linux/module.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/io.h>
  25. #include <linux/delay.h>
  26. #include <plat/board-ams-delta.h>
  27. #include <mach/hardware.h>
  28. #include "omapfb.h"
  29. #define AMS_DELTA_DEFAULT_CONTRAST 112
  30. static int ams_delta_panel_init(struct lcd_panel *panel,
  31. struct omapfb_device *fbdev)
  32. {
  33. return 0;
  34. }
  35. static void ams_delta_panel_cleanup(struct lcd_panel *panel)
  36. {
  37. }
  38. static int ams_delta_panel_enable(struct lcd_panel *panel)
  39. {
  40. ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP,
  41. AMS_DELTA_LATCH2_LCD_NDISP);
  42. ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN,
  43. AMS_DELTA_LATCH2_LCD_VBLEN);
  44. omap_writeb(1, OMAP_PWL_CLK_ENABLE);
  45. omap_writeb(AMS_DELTA_DEFAULT_CONTRAST, OMAP_PWL_ENABLE);
  46. return 0;
  47. }
  48. static void ams_delta_panel_disable(struct lcd_panel *panel)
  49. {
  50. ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0);
  51. ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0);
  52. }
  53. static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel)
  54. {
  55. return 0;
  56. }
  57. static struct lcd_panel ams_delta_panel = {
  58. .name = "ams-delta",
  59. .config = 0,
  60. .bpp = 12,
  61. .data_lines = 16,
  62. .x_res = 480,
  63. .y_res = 320,
  64. .pixel_clock = 4687,
  65. .hsw = 3,
  66. .hfp = 1,
  67. .hbp = 1,
  68. .vsw = 1,
  69. .vfp = 0,
  70. .vbp = 0,
  71. .pcd = 0,
  72. .acb = 37,
  73. .init = ams_delta_panel_init,
  74. .cleanup = ams_delta_panel_cleanup,
  75. .enable = ams_delta_panel_enable,
  76. .disable = ams_delta_panel_disable,
  77. .get_caps = ams_delta_panel_get_caps,
  78. };
  79. static int ams_delta_panel_probe(struct platform_device *pdev)
  80. {
  81. omapfb_register_panel(&ams_delta_panel);
  82. return 0;
  83. }
  84. static int ams_delta_panel_remove(struct platform_device *pdev)
  85. {
  86. return 0;
  87. }
  88. static int ams_delta_panel_suspend(struct platform_device *pdev,
  89. pm_message_t mesg)
  90. {
  91. return 0;
  92. }
  93. static int ams_delta_panel_resume(struct platform_device *pdev)
  94. {
  95. return 0;
  96. }
  97. struct platform_driver ams_delta_panel_driver = {
  98. .probe = ams_delta_panel_probe,
  99. .remove = ams_delta_panel_remove,
  100. .suspend = ams_delta_panel_suspend,
  101. .resume = ams_delta_panel_resume,
  102. .driver = {
  103. .name = "lcd_ams_delta",
  104. .owner = THIS_MODULE,
  105. },
  106. };
  107. static int __init ams_delta_panel_drv_init(void)
  108. {
  109. return platform_driver_register(&ams_delta_panel_driver);
  110. }
  111. static void __exit ams_delta_panel_drv_cleanup(void)
  112. {
  113. platform_driver_unregister(&ams_delta_panel_driver);
  114. }
  115. module_init(ams_delta_panel_drv_init);
  116. module_exit(ams_delta_panel_drv_cleanup);