summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinliang Liu <xinliang.liu@linaro.org>2015-10-30 18:29:09 +0800
committerVishal Bhoj <vishal.bhoj@linaro.org>2015-11-23 04:25:41 +0000
commit10243ddcdc1cb31cb3f1f67d0ed315caab8df11b (patch)
tree7b9cff2894caf738b34c55434fbfa02da34a338c
parenta7fe1afe6e3e17a98993358b9e9258e17150b3b3 (diff)
drm/i2c: adv7511: Fix the issue that two detects has diffrent value
Force connector always connected if define FORCE_HPD macro. Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
-rw-r--r--drivers/gpu/drm/i2c/adv7511.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i2c/adv7511.c b/drivers/gpu/drm/i2c/adv7511.c
index 916964f8508..c3140c0f33c 100644
--- a/drivers/gpu/drm/i2c/adv7511.c
+++ b/drivers/gpu/drm/i2c/adv7511.c
@@ -717,23 +717,24 @@ adv7511_detect(struct adv7511 *adv7511,
struct drm_connector *connector)
{
enum drm_connector_status status;
+#ifndef FORCE_HPD
unsigned int val;
bool hpd = true;
int ret;
+#endif
+#ifdef FORCE_HPD
+ status = connector_status_connected;
+#else
ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val);
if (ret < 0)
return connector_status_disconnected;
-#ifndef FORCE_HPD
if (val & ADV7511_STATUS_HPD)
-#endif
status = connector_status_connected;
-#ifndef FORCE_HPD
else
status = connector_status_disconnected;
hpd = adv7511_hpd(adv7511);
-#endif
/* The chip resets itself when the cable is disconnected, so in case
* there is a pending HPD interrupt and the cable is connected there was
@@ -745,13 +746,12 @@ adv7511_detect(struct adv7511 *adv7511,
adv7511_get_modes(adv7511, connector);
if (adv7511->status == connector_status_connected)
status = connector_status_disconnected;
-#ifndef FORCE_HPD
} else {
/* Renable HDP sensing */
regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2,
ADV7511_REG_POWER2_HDP_SRC_MASK, 0);
-#endif
}
+#endif
adv7511->status = status;
return status;