mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-15 22:41:38 +00:00
drm/bridge: ite66121: Register HPD interrupt handler only when 'client->irq > 0'
If a specific design doesn't wire IT66121's interrupt signal output pin up to the display controller side, then we should not register the interrupt handler. Such a decision is valid usage, as we can fall back to polling mode. So, don't make the assumption that a specific board always supports HPD. Carry out a sanity check on 'client->irq' before using it, fall back to polling mode if client->irq < 0 is true. Such a design increases the overall flexibility. Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240316160536.1051513-1-sui.jingfeng@linux.dev Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240316160536.1051513-1-sui.jingfeng@linux.dev
This commit is contained in:
committed by
Neil Armstrong
parent
ee7860cd8b
commit
ba2d3e6709
@@ -1586,13 +1586,18 @@ static int it66121_probe(struct i2c_client *client)
|
||||
ctx->bridge.funcs = &it66121_bridge_funcs;
|
||||
ctx->bridge.of_node = dev->of_node;
|
||||
ctx->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
|
||||
ctx->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD;
|
||||
ctx->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID;
|
||||
if (client->irq > 0) {
|
||||
ctx->bridge.ops |= DRM_BRIDGE_OP_HPD;
|
||||
|
||||
ret = devm_request_threaded_irq(dev, client->irq, NULL, it66121_irq_threaded_handler,
|
||||
IRQF_ONESHOT, dev_name(dev), ctx);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to request irq %d:%d\n", client->irq, ret);
|
||||
return ret;
|
||||
ret = devm_request_threaded_irq(dev, client->irq, NULL,
|
||||
it66121_irq_threaded_handler,
|
||||
IRQF_ONESHOT, dev_name(dev),
|
||||
ctx);
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "Failed to request irq %d:%d\n", client->irq, ret);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
it66121_audio_codec_init(ctx, dev);
|
||||
|
||||
Reference in New Issue
Block a user