dss-common.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 <video/omapdss.h>
  26. #include <video/omap-panel-tfp410.h>
  27. #include <plat/cpu.h>
  28. #include "dss-common.h"
  29. #include "mux.h"
  30. #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
  31. #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
  32. #define HDMI_GPIO_HPD 63 /* Hotplug detect */
  33. /* Display DVI */
  34. #define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
  35. /* Using generic display panel */
  36. static struct tfp410_platform_data omap4_dvi_panel = {
  37. .i2c_bus_num = 3,
  38. .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
  39. };
  40. static struct omap_dss_device omap4_panda_dvi_device = {
  41. .type = OMAP_DISPLAY_TYPE_DPI,
  42. .name = "dvi",
  43. .driver_name = "tfp410",
  44. .data = &omap4_dvi_panel,
  45. .phy.dpi.data_lines = 24,
  46. .reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
  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(void)
  71. {
  72. omap_display_init(&omap4_panda_dss_data);
  73. /*
  74. * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
  75. * later have external pull up on the HDMI I2C lines
  76. */
  77. if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
  78. omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
  79. else
  80. omap_hdmi_init(0);
  81. omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
  82. omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
  83. omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
  84. }
  85. void __init omap4_panda_display_init_of(void)
  86. {
  87. omap_display_init(&omap4_panda_dss_data);
  88. }