static const int packet_i2c_addr = 0x70;
static const int cec_i2c_addr = 0x78;
-#define HPD_ENABLE 0
-
static struct adv7511 *encoder_to_adv7511(struct drm_encoder *encoder)
{
return to_encoder_slave(encoder)->slave_priv;
* Still, let's be safe and stick to the documentation.
*/
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0),
- ADV7511_INT0_EDID_READY);
+ ADV7511_INT0_EDID_READY | ADV7511_INT0_HDP);
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1),
ADV7511_INT1_DDC_ERROR);
}
* Interrupt and hotplug detection
*/
-#if HPD_ENABLE
static bool adv7511_hpd(struct adv7511 *adv7511)
{
unsigned int irq0;
return false;
}
-#endif
static void adv7511_hpd_work(struct work_struct *work)
{
if (ret < 0)
return ret;
- regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0);
- regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
-
if (process_hpd && irq0 & ADV7511_INT0_HDP && adv7511->encoder)
schedule_work(&adv7511->hpd_work);
+ regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0);
+ regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
+
if (irq0 & ADV7511_INT0_EDID_READY || irq1 & ADV7511_INT1_DDC_ERROR) {
adv7511->edid_read = true;
ADV7511_POWER_POWER_DOWN, 0);
if (adv7511->i2c_main->irq) {
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0),
- ADV7511_INT0_EDID_READY);
+ ADV7511_INT0_EDID_READY | ADV7511_INT0_HDP);
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1),
ADV7511_INT1_DDC_ERROR);
}
/* Reset the EDID_I2C_ADDR register as it might be cleared */
regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR,
edid_i2c_addr);
+ msleep(200);
}
edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511);
{
enum drm_connector_status status;
unsigned int val;
-#if HPD_ENABLE
bool hpd;
-#endif
int ret;
ret = regmap_read(adv7511->regmap, ADV7511_REG_STATUS, &val);
else
status = connector_status_disconnected;
-#if HPD_ENABLE
hpd = adv7511_hpd(adv7511);
/* The chip resets itself when the cable is disconnected, so in case
ADV7511_REG_POWER2_HDP_SRC_MASK,
ADV7511_REG_POWER2_HDP_SRC_BOTH);
}
-#endif
adv7511->status = status;
return status;
{
struct adv7511 *adv = bridge_to_adv7511(bridge);
-#if HPD_ENABLE
- if (!adv7511->powered)
- return;
-#endif
-
adv7511_power_off(adv);
}
return -ENODEV;
}
-#if HPD_ENABLE
adv->connector.polled = DRM_CONNECTOR_POLL_HPD;
-#endif
ret = drm_connector_init(bridge->dev, &adv->connector,
&adv7533_connector_funcs, DRM_MODE_CONNECTOR_HDMIA);
drm_connector_register(&adv->connector);
drm_mode_connector_attach_encoder(&adv->connector, adv->encoder);
-#if HPD_ENABLE
drm_helper_hpd_irq_event(adv->connector.dev);
-#endif
adv7533_attach_dsi(adv);
+ /* enable HPD */
+ if (adv->i2c_main->irq)
+ regmap_write(adv->regmap, ADV7511_REG_INT_ENABLE(0),
+ ADV7511_INT0_HDP);
return ret;
}