drm/msm/hdmi: Fix connector detect when there is no HPD gpio
authorArchit Taneja <architt@codeaurora.org>
Thu, 25 Feb 2016 05:52:37 +0000 (11:22 +0530)
committerRob Clark <robdclark@gmail.com>
Mon, 29 Feb 2016 14:48:30 +0000 (09:48 -0500)
Some platforms may not have a HPD gpio line to detect Hot Plug signal from
the connector. They need to rely only on reading REG_HDMI_HPD_INT_STATUS
for HPD.

Modify hdmi_connector_detect logic such that it checks for HPD only using
the status register if there is no HPD gpio.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/hdmi/hdmi_connector.c

index deec1f918426b47fab67bbc9030b82b76e8c60c6..3973d464467984b599cddcb68765bc2d93db2fe3 100644 (file)
@@ -301,9 +301,18 @@ static enum drm_connector_status hdmi_connector_detect(
 {
        struct hdmi_connector *hdmi_connector = to_hdmi_connector(connector);
        struct hdmi *hdmi = hdmi_connector->hdmi;
+       const struct hdmi_platform_config *config = hdmi->config;
+       struct hdmi_gpio_data hpd_gpio = config->gpios[HPD_GPIO_INDEX];
        enum drm_connector_status stat_gpio, stat_reg;
        int retry = 20;
 
+       /*
+        * some platforms may not have hpd gpio. Rely only on the status
+        * provided by REG_HDMI_HPD_INT_STATUS in this case.
+        */
+       if (hpd_gpio.num == -1)
+               return detect_reg(hdmi);
+
        do {
                stat_gpio = detect_gpio(hdmi);
                stat_reg  = detect_reg(hdmi);
This page took 0.024825 seconds and 5 git commands to generate.