dss-common.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /*
  2. * Copyright (C) 2012 Texas Instruments, Inc..
  3. * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * version 2 as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  17. * 02110-1301 USA
  18. *
  19. */
  20. /*
  21. * NOTE: this is a transitional file to help with DT adaptation.
  22. * This file will be removed when DSS supports DT.
  23. */
  24. #include <linux/kernel.h>
  25. #include <linux/gpio.h>
  26. #include <video/omapdss.h>
  27. #include <video/omap-panel-data.h>
  28. #include "soc.h"
  29. #include "dss-common.h"
  30. #include "mux.h"
  31. #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
  32. #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
  33. #define HDMI_GPIO_HPD 63 /* Hotplug detect */
  34. /* Display DVI */
  35. #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
  36. /* Using generic display panel */
  37. static struct tfp410_platform_data omap4_dvi_panel = {
  38. .i2c_bus_num = 2,
  39. .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
  40. };
  41. static struct omap_dss_device omap4_panda_dvi_device = {
  42. .type = OMAP_DISPLAY_TYPE_DPI,
  43. .name = "dvi",
  44. .driver_name = "tfp410",
  45. .data = &omap4_dvi_panel,
  46. .phy.dpi.data_lines = 24,
  47. .channel = OMAP_DSS_CHANNEL_LCD2,
  48. };
  49. static struct omap_dss_hdmi_data omap4_panda_hdmi_data = {
  50. .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
  51. .ls_oe_gpio = HDMI_GPIO_LS_OE,
  52. .hpd_gpio = HDMI_GPIO_HPD,
  53. };
  54. static struct omap_dss_device omap4_panda_hdmi_device = {
  55. .name = "hdmi",
  56. .driver_name = "hdmi_panel",
  57. .type = OMAP_DISPLAY_TYPE_HDMI,
  58. .channel = OMAP_DSS_CHANNEL_DIGIT,
  59. .data = &omap4_panda_hdmi_data,
  60. };
  61. static struct omap_dss_device *omap4_panda_dss_devices[] = {
  62. &omap4_panda_dvi_device,
  63. &omap4_panda_hdmi_device,
  64. };
  65. static struct omap_dss_board_info omap4_panda_dss_data = {
  66. .num_devices = ARRAY_SIZE(omap4_panda_dss_devices),
  67. .devices = omap4_panda_dss_devices,
  68. .default_device = &omap4_panda_dvi_device,
  69. };
  70. void __init omap4_panda_display_init_of(void)
  71. {
  72. omap_display_init(&omap4_panda_dss_data);
  73. }
  74. /* OMAP4 Blaze display data */
  75. #define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
  76. #define DLP_POWER_ON_GPIO 40
  77. static struct nokia_dsi_panel_data dsi1_panel = {
  78. .name = "taal",
  79. .reset_gpio = 102,
  80. .use_ext_te = false,
  81. .ext_te_gpio = 101,
  82. .esd_interval = 0,
  83. .pin_config = {
  84. .num_pins = 6,
  85. .pins = { 0, 1, 2, 3, 4, 5 },
  86. },
  87. };
  88. static struct omap_dss_device sdp4430_lcd_device = {
  89. .name = "lcd",
  90. .driver_name = "taal",
  91. .type = OMAP_DISPLAY_TYPE_DSI,
  92. .data = &dsi1_panel,
  93. .phy.dsi = {
  94. .module = 0,
  95. },
  96. .channel = OMAP_DSS_CHANNEL_LCD,
  97. };
  98. static struct nokia_dsi_panel_data dsi2_panel = {
  99. .name = "taal",
  100. .reset_gpio = 104,
  101. .use_ext_te = false,
  102. .ext_te_gpio = 103,
  103. .esd_interval = 0,
  104. .pin_config = {
  105. .num_pins = 6,
  106. .pins = { 0, 1, 2, 3, 4, 5 },
  107. },
  108. };
  109. static struct omap_dss_device sdp4430_lcd2_device = {
  110. .name = "lcd2",
  111. .driver_name = "taal",
  112. .type = OMAP_DISPLAY_TYPE_DSI,
  113. .data = &dsi2_panel,
  114. .phy.dsi = {
  115. .module = 1,
  116. },
  117. .channel = OMAP_DSS_CHANNEL_LCD2,
  118. };
  119. static struct omap_dss_hdmi_data sdp4430_hdmi_data = {
  120. .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
  121. .ls_oe_gpio = HDMI_GPIO_LS_OE,
  122. .hpd_gpio = HDMI_GPIO_HPD,
  123. };
  124. static struct omap_dss_device sdp4430_hdmi_device = {
  125. .name = "hdmi",
  126. .driver_name = "hdmi_panel",
  127. .type = OMAP_DISPLAY_TYPE_HDMI,
  128. .channel = OMAP_DSS_CHANNEL_DIGIT,
  129. .data = &sdp4430_hdmi_data,
  130. };
  131. static struct picodlp_panel_data sdp4430_picodlp_pdata = {
  132. .picodlp_adapter_id = 2,
  133. .emu_done_gpio = 44,
  134. .pwrgood_gpio = 45,
  135. };
  136. static struct omap_dss_device sdp4430_picodlp_device = {
  137. .name = "picodlp",
  138. .driver_name = "picodlp_panel",
  139. .type = OMAP_DISPLAY_TYPE_DPI,
  140. .phy.dpi.data_lines = 24,
  141. .channel = OMAP_DSS_CHANNEL_LCD2,
  142. .data = &sdp4430_picodlp_pdata,
  143. };
  144. static struct omap_dss_device *sdp4430_dss_devices[] = {
  145. &sdp4430_lcd_device,
  146. &sdp4430_lcd2_device,
  147. &sdp4430_hdmi_device,
  148. &sdp4430_picodlp_device,
  149. };
  150. static struct omap_dss_board_info sdp4430_dss_data = {
  151. .num_devices = ARRAY_SIZE(sdp4430_dss_devices),
  152. .devices = sdp4430_dss_devices,
  153. .default_device = &sdp4430_lcd_device,
  154. };
  155. /*
  156. * we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
  157. * Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
  158. * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
  159. * selected by default
  160. */
  161. void __init omap_4430sdp_display_init_of(void)
  162. {
  163. int r;
  164. r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
  165. "display_sel");
  166. if (r)
  167. pr_err("%s: Could not get display_sel GPIO\n", __func__);
  168. r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
  169. "DLP POWER ON");
  170. if (r)
  171. pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
  172. omap_display_init(&sdp4430_dss_data);
  173. }