Skip to content

Commit f3d9683

Browse files
aford173lumag
authored andcommitted
drm/bridge: adv7511: Allow IRQ to share GPIO pins
The IRQ registration currently assumes that the GPIO is dedicated to it, but that may not necessarily be the case. If the board has another device sharing the GPIO, it won't be registered and the hot-plug detect fails to function. Currently, the handler reads two registers and blindly assumes one of them caused the interrupt and returns IRQ_HANDLED unless there is an error. In order to properly do this, the IRQ handler needs to check if it needs to handle the IRQ and return IRQ_NONE if there is nothing to handle. With the check added and the return code properly indicating whether or not it there was an IRQ, the IRQF_SHARED can be set to share a GPIO IRQ. V2: Add check to see if there is IRQ data to handle Signed-off-by: Adam Ford <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 45c734f commit f3d9683

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd)
477477
if (ret < 0)
478478
return ret;
479479

480+
/* If there is no IRQ to handle, exit indicating no IRQ data */
481+
if (!(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) &&
482+
!(irq1 & ADV7511_INT1_DDC_ERROR))
483+
return -ENODATA;
484+
480485
regmap_write(adv7511->regmap, ADV7511_REG_INT(0), irq0);
481486
regmap_write(adv7511->regmap, ADV7511_REG_INT(1), irq1);
482487

@@ -1318,7 +1323,8 @@ static int adv7511_probe(struct i2c_client *i2c)
13181323

13191324
ret = devm_request_threaded_irq(dev, i2c->irq, NULL,
13201325
adv7511_irq_handler,
1321-
IRQF_ONESHOT, dev_name(dev),
1326+
IRQF_ONESHOT | IRQF_SHARED,
1327+
dev_name(dev),
13221328
adv7511);
13231329
if (ret)
13241330
goto err_unregister_audio;

0 commit comments

Comments
 (0)