lcd_h3.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * LCD panel support for the TI OMAP H3 board
  3. *
  4. * Copyright (C) 2004 Nokia Corporation
  5. * Author: Imre Deak <imre.deak@nokia.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. #include <linux/module.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/mfd/tps65010.h>
  24. #include <linux/gpio.h>
  25. #include "omapfb.h"
  26. #define MODULE_NAME "omapfb-lcd_h3"
  27. static int h3_panel_enable(struct lcd_panel *panel)
  28. {
  29. int r = 0;
  30. /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
  31. r = tps65010_set_gpio_out_value(GPIO1, HIGH);
  32. if (!r)
  33. r = tps65010_set_gpio_out_value(GPIO2, HIGH);
  34. if (r)
  35. pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
  36. return r;
  37. }
  38. static void h3_panel_disable(struct lcd_panel *panel)
  39. {
  40. int r = 0;
  41. /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
  42. r = tps65010_set_gpio_out_value(GPIO1, LOW);
  43. if (!r)
  44. tps65010_set_gpio_out_value(GPIO2, LOW);
  45. if (r)
  46. pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
  47. }
  48. static struct lcd_panel h3_panel = {
  49. .name = "h3",
  50. .config = OMAP_LCDC_PANEL_TFT,
  51. .data_lines = 16,
  52. .bpp = 16,
  53. .x_res = 240,
  54. .y_res = 320,
  55. .pixel_clock = 12000,
  56. .hsw = 12,
  57. .hfp = 14,
  58. .hbp = 72 - 12,
  59. .vsw = 1,
  60. .vfp = 1,
  61. .vbp = 0,
  62. .pcd = 0,
  63. .enable = h3_panel_enable,
  64. .disable = h3_panel_disable,
  65. };
  66. static int h3_panel_probe(struct platform_device *pdev)
  67. {
  68. omapfb_register_panel(&h3_panel);
  69. return 0;
  70. }
  71. static struct platform_driver h3_panel_driver = {
  72. .probe = h3_panel_probe,
  73. .driver = {
  74. .name = "lcd_h3",
  75. },
  76. };
  77. module_platform_driver(h3_panel_driver);
  78. MODULE_AUTHOR("Imre Deak");
  79. MODULE_DESCRIPTION("LCD panel support for the TI OMAP H3 board");
  80. MODULE_LICENSE("GPL");