@@ -28,6 +28,9 @@
#define TFP410_BIT_BSEL BIT(2)
#define TFP410_BIT_DSEL BIT(3)
+#define TFP410_REG_CTL_2_MODE 0x09
+#define TFP410_BIT_HTPLG BIT(1)
+
static const struct regmap_config tfp410_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -105,6 +108,15 @@ static enum drm_connector_status
tfp410_connector_detect(struct drm_connector *connector, bool force)
{
struct tfp410 *dvi = drm_connector_to_tfp410(connector);
+ int ret;
+
+ if (dvi->i2c) {
+ ret = regmap_test_bits(dvi->regmap, TFP410_REG_CTL_2_MODE, TFP410_BIT_HTPLG);
+ if (ret < 0)
+ dev_err(dvi->dev, "%s failed to read HTPLG bit : %d\n", __func__, ret);
+ else
+ return ret ? connector_status_connected : connector_status_disconnected;
+ }
return drm_bridge_detect(dvi->next_bridge);
}