Merge branch 'next-queue' into next
[sfrench/cifs-2.6.git] / arch / arm / mach-omap2 / board-4430sdp.c
index 964f12bb936c994b69e462dd2b639f1221c99cb0..56702c5e577fe3365cab09b56c32d5b4913020a0 100644 (file)
@@ -36,6 +36,7 @@
 #include <plat/usb.h>
 #include <plat/mmc.h>
 #include <plat/omap4-keypad.h>
+#include <plat/display.h>
 
 #include "mux.h"
 #include "hsmmc.h"
@@ -47,6 +48,8 @@
 #define ETH_KS8851_QUART               138
 #define OMAP4_SFH7741_SENSOR_OUTPUT_GPIO       184
 #define OMAP4_SFH7741_ENABLE_GPIO              188
+#define HDMI_GPIO_HPD 60 /* Hot plug pin for HDMI */
+#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
 
 static const int sdp4430_keymap[] = {
        KEY(0, 0, KEY_E),
@@ -628,6 +631,76 @@ static void __init omap_sfh7741prox_init(void)
        }
 }
 
+static void sdp4430_hdmi_mux_init(void)
+{
+       /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */
+       omap_mux_init_signal("hdmi_hpd",
+                       OMAP_PIN_INPUT_PULLUP);
+       omap_mux_init_signal("hdmi_cec",
+                       OMAP_PIN_INPUT_PULLUP);
+       /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */
+       omap_mux_init_signal("hdmi_ddc_scl",
+                       OMAP_PIN_INPUT_PULLUP);
+       omap_mux_init_signal("hdmi_ddc_sda",
+                       OMAP_PIN_INPUT_PULLUP);
+}
+
+static int sdp4430_panel_enable_hdmi(struct omap_dss_device *dssdev)
+{
+       int status;
+
+       status = gpio_request_one(HDMI_GPIO_HPD, GPIOF_OUT_INIT_HIGH,
+                                                       "hdmi_gpio_hpd");
+       if (status) {
+               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_HPD);
+               return status;
+       }
+       status = gpio_request_one(HDMI_GPIO_LS_OE, GPIOF_OUT_INIT_HIGH,
+                                                       "hdmi_gpio_ls_oe");
+       if (status) {
+               pr_err("Cannot request GPIO %d\n", HDMI_GPIO_LS_OE);
+               goto error1;
+       }
+
+       return 0;
+
+error1:
+       gpio_free(HDMI_GPIO_HPD);
+
+       return status;
+}
+
+static void sdp4430_panel_disable_hdmi(struct omap_dss_device *dssdev)
+{
+       gpio_free(HDMI_GPIO_LS_OE);
+       gpio_free(HDMI_GPIO_HPD);
+}
+
+static struct omap_dss_device sdp4430_hdmi_device = {
+       .name = "hdmi",
+       .driver_name = "hdmi_panel",
+       .type = OMAP_DISPLAY_TYPE_HDMI,
+       .platform_enable = sdp4430_panel_enable_hdmi,
+       .platform_disable = sdp4430_panel_disable_hdmi,
+       .channel = OMAP_DSS_CHANNEL_DIGIT,
+};
+
+static struct omap_dss_device *sdp4430_dss_devices[] = {
+       &sdp4430_hdmi_device,
+};
+
+static struct omap_dss_board_info sdp4430_dss_data = {
+       .num_devices    = ARRAY_SIZE(sdp4430_dss_devices),
+       .devices        = sdp4430_dss_devices,
+       .default_device = &sdp4430_hdmi_device,
+};
+
+void omap_4430sdp_display_init(void)
+{
+       sdp4430_hdmi_mux_init();
+       omap_display_init(&sdp4430_dss_data);
+}
+
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
        OMAP4_MUX(USBB2_ULPITLL_CLK, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT),
@@ -736,6 +809,8 @@ static void __init omap_4430sdp_init(void)
        status = omap4_keyboard_init(&sdp4430_keypad_data);
        if (status)
                pr_err("Keypad initialization failed: %d\n", status);
+
+       omap_4430sdp_display_init();
 }
 
 static void __init omap_4430sdp_map_io(void)