Skip to content

Commit aea7e5c

Browse files
Wolfram Sanggregkh
authored andcommitted
drm: adv7511: really enable interrupts for EDID detection
commit d0be8584b01160eb6f49e77f8e9c1da286bb4ffb upstream. The interrupts for EDID_READY or DDC_ERROR were never enabled in this driver, so reading EDID always timed out when chip was powered down and interrupts were used. Fix this and also remove clearing the interrupt flags, they are cleared in POWER_DOWN mode anyhow (unlike the interrupt enable flags) according to docs and my tests. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Thong Ho <thong.ho.px@rvc.renesas.com> Signed-off-by: Nhan Nguyen <nhan.nguyen.yb@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a2e71dc commit aea7e5c

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

drivers/gpu/drm/i2c/adv7511.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,19 @@ static void adv7511_power_on(struct adv7511 *adv7511)
362362
{
363363
adv7511->current_edid_segment = -1;
364364

365-
regmap_write(adv7511->regmap, ADV7511_REG_INT(0),
366-
ADV7511_INT0_EDID_READY);
367-
regmap_write(adv7511->regmap, ADV7511_REG_INT(1),
368-
ADV7511_INT1_DDC_ERROR);
369365
regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
370366
ADV7511_POWER_POWER_DOWN, 0);
367+
if (adv7511->i2c_main->irq) {
368+
/*
369+
* Documentation says the INT_ENABLE registers are reset in
370+
* POWER_DOWN mode. My 7511w preserved the bits, however.
371+
* Still, let's be safe and stick to the documentation.
372+
*/
373+
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0),
374+
ADV7511_INT0_EDID_READY);
375+
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1),
376+
ADV7511_INT1_DDC_ERROR);
377+
}
371378

372379
/*
373380
* Per spec it is allowed to pulse the HDP signal to indicate that the
@@ -567,12 +574,14 @@ static int adv7511_get_modes(struct drm_encoder *encoder,
567574

568575
/* Reading the EDID only works if the device is powered */
569576
if (!adv7511->powered) {
570-
regmap_write(adv7511->regmap, ADV7511_REG_INT(0),
571-
ADV7511_INT0_EDID_READY);
572-
regmap_write(adv7511->regmap, ADV7511_REG_INT(1),
573-
ADV7511_INT1_DDC_ERROR);
574577
regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
575578
ADV7511_POWER_POWER_DOWN, 0);
579+
if (adv7511->i2c_main->irq) {
580+
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0),
581+
ADV7511_INT0_EDID_READY);
582+
regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1),
583+
ADV7511_INT1_DDC_ERROR);
584+
}
576585
adv7511->current_edid_segment = -1;
577586
}
578587

0 commit comments

Comments
 (0)