Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bridge: ti-tfp410: Fall back to HPD polling if HPD irq is not available

In case either the HPD gpio is not specified or when the HPD gpio can not
be used as interrupt we should tell the core that the HPD needs to be
polled for detecting hotplug.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190401123342.15767-1-peter.ujfalusi@ti.com

authored by

Peter Ujfalusi and committed by
Andrzej Hajda
3d31e215 beb941b9

+11 -3
+11 -3
drivers/gpu/drm/bridge/ti-tfp410.c
··· 31 31 32 32 struct i2c_adapter *ddc; 33 33 struct gpio_desc *hpd; 34 + int hpd_irq; 34 35 struct delayed_work hpd_work; 35 36 struct gpio_desc *powerdown; 36 37 ··· 125 124 return -ENODEV; 126 125 } 127 126 128 - if (dvi->hpd) 127 + if (dvi->hpd_irq >= 0) 129 128 dvi->connector.polled = DRM_CONNECTOR_POLL_HPD; 129 + else 130 + dvi->connector.polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; 130 131 131 132 drm_connector_helper_add(&dvi->connector, 132 133 &tfp410_con_helper_funcs); ··· 327 324 return PTR_ERR(dvi->powerdown); 328 325 } 329 326 330 - if (dvi->hpd) { 327 + if (dvi->hpd) 328 + dvi->hpd_irq = gpiod_to_irq(dvi->hpd); 329 + else 330 + dvi->hpd_irq = -ENXIO; 331 + 332 + if (dvi->hpd_irq >= 0) { 331 333 INIT_DELAYED_WORK(&dvi->hpd_work, tfp410_hpd_work_func); 332 334 333 - ret = devm_request_threaded_irq(dev, gpiod_to_irq(dvi->hpd), 335 + ret = devm_request_threaded_irq(dev, dvi->hpd_irq, 334 336 NULL, tfp410_hpd_irq_thread, IRQF_TRIGGER_RISING | 335 337 IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 336 338 "hdmi-hpd", dvi);