lcd_apollon.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * LCD panel support for the Samsung OMAP2 Apollon board
  3. *
  4. * Copyright (C) 2005,2006 Samsung Electronics
  5. * Author: Kyungmin Park <kyungmin.park@samsung.com>
  6. *
  7. * Derived from drivers/video/omap/lcd-h4.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License along
  20. * with this program; if not, write to the Free Software Foundation, Inc.,
  21. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. */
  23. #include <linux/module.h>
  24. #include <linux/platform_device.h>
  25. #include <mach/gpio.h>
  26. #include <plat/mux.h>
  27. #include "omapfb.h"
  28. /* #define USE_35INCH_LCD 1 */
  29. static int apollon_panel_init(struct lcd_panel *panel,
  30. struct omapfb_device *fbdev)
  31. {
  32. /* configure LCD PWR_EN */
  33. omap_cfg_reg(M21_242X_GPIO11);
  34. return 0;
  35. }
  36. static void apollon_panel_cleanup(struct lcd_panel *panel)
  37. {
  38. }
  39. static int apollon_panel_enable(struct lcd_panel *panel)
  40. {
  41. return 0;
  42. }
  43. static void apollon_panel_disable(struct lcd_panel *panel)
  44. {
  45. }
  46. static unsigned long apollon_panel_get_caps(struct lcd_panel *panel)
  47. {
  48. return 0;
  49. }
  50. struct lcd_panel apollon_panel = {
  51. .name = "apollon",
  52. .config = OMAP_LCDC_PANEL_TFT | OMAP_LCDC_INV_VSYNC |
  53. OMAP_LCDC_INV_HSYNC,
  54. .bpp = 16,
  55. .data_lines = 18,
  56. #ifdef USE_35INCH_LCD
  57. .x_res = 240,
  58. .y_res = 320,
  59. .hsw = 2,
  60. .hfp = 3,
  61. .hbp = 9,
  62. .vsw = 4,
  63. .vfp = 3,
  64. .vbp = 5,
  65. #else
  66. .x_res = 480,
  67. .y_res = 272,
  68. .hsw = 41,
  69. .hfp = 2,
  70. .hbp = 2,
  71. .vsw = 10,
  72. .vfp = 2,
  73. .vbp = 2,
  74. #endif
  75. .pixel_clock = 6250,
  76. .init = apollon_panel_init,
  77. .cleanup = apollon_panel_cleanup,
  78. .enable = apollon_panel_enable,
  79. .disable = apollon_panel_disable,
  80. .get_caps = apollon_panel_get_caps,
  81. };
  82. static int apollon_panel_probe(struct platform_device *pdev)
  83. {
  84. omapfb_register_panel(&apollon_panel);
  85. return 0;
  86. }
  87. static int apollon_panel_remove(struct platform_device *pdev)
  88. {
  89. return 0;
  90. }
  91. static int apollon_panel_suspend(struct platform_device *pdev,
  92. pm_message_t mesg)
  93. {
  94. return 0;
  95. }
  96. static int apollon_panel_resume(struct platform_device *pdev)
  97. {
  98. return 0;
  99. }
  100. struct platform_driver apollon_panel_driver = {
  101. .probe = apollon_panel_probe,
  102. .remove = apollon_panel_remove,
  103. .suspend = apollon_panel_suspend,
  104. .resume = apollon_panel_resume,
  105. .driver = {
  106. .name = "apollon_lcd",
  107. .owner = THIS_MODULE,
  108. },
  109. };
  110. static int __init apollon_panel_drv_init(void)
  111. {
  112. return platform_driver_register(&apollon_panel_driver);
  113. }
  114. static void __exit apollon_panel_drv_exit(void)
  115. {
  116. platform_driver_unregister(&apollon_panel_driver);
  117. }
  118. module_init(apollon_panel_drv_init);
  119. module_exit(apollon_panel_drv_exit);