lcd_h3.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * LCD panel support for the TI OMAP H3 board
  4. *
  5. * Copyright (C) 2004 Nokia Corporation
  6. * Author: Imre Deak <[email protected]>
  7. */
  8. #include <linux/module.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/mfd/tps65010.h>
  11. #include <linux/gpio.h>
  12. #include "omapfb.h"
  13. #define MODULE_NAME "omapfb-lcd_h3"
  14. static int h3_panel_enable(struct lcd_panel *panel)
  15. {
  16. int r = 0;
  17. /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
  18. r = tps65010_set_gpio_out_value(GPIO1, HIGH);
  19. if (!r)
  20. r = tps65010_set_gpio_out_value(GPIO2, HIGH);
  21. if (r)
  22. pr_err(MODULE_NAME ": Unable to turn on LCD panel\n");
  23. return r;
  24. }
  25. static void h3_panel_disable(struct lcd_panel *panel)
  26. {
  27. int r = 0;
  28. /* GPIO1 and GPIO2 of TPS65010 send LCD_ENBKL and LCD_ENVDD signals */
  29. r = tps65010_set_gpio_out_value(GPIO1, LOW);
  30. if (!r)
  31. tps65010_set_gpio_out_value(GPIO2, LOW);
  32. if (r)
  33. pr_err(MODULE_NAME ": Unable to turn off LCD panel\n");
  34. }
  35. static struct lcd_panel h3_panel = {
  36. .name = "h3",
  37. .config = OMAP_LCDC_PANEL_TFT,
  38. .data_lines = 16,
  39. .bpp = 16,
  40. .x_res = 240,
  41. .y_res = 320,
  42. .pixel_clock = 12000,
  43. .hsw = 12,
  44. .hfp = 14,
  45. .hbp = 72 - 12,
  46. .vsw = 1,
  47. .vfp = 1,
  48. .vbp = 0,
  49. .pcd = 0,
  50. .enable = h3_panel_enable,
  51. .disable = h3_panel_disable,
  52. };
  53. static int h3_panel_probe(struct platform_device *pdev)
  54. {
  55. omapfb_register_panel(&h3_panel);
  56. return 0;
  57. }
  58. static struct platform_driver h3_panel_driver = {
  59. .probe = h3_panel_probe,
  60. .driver = {
  61. .name = "lcd_h3",
  62. },
  63. };
  64. module_platform_driver(h3_panel_driver);
  65. MODULE_AUTHOR("Imre Deak");
  66. MODULE_DESCRIPTION("LCD panel support for the TI OMAP H3 board");
  67. MODULE_LICENSE("GPL");