drm/omap: Don't call .detect() operation recursively
Instead of calling the .detect() operation recursively from the display device back to the first device that provides hot plug detection support, iterate over the devices manually in the DRM connector .detect() implementation. This moves the complexity to a single central location and simplifies the logic in omap_dss_device drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:

committed by
Tomi Valkeinen

parent
09e5bb6d5b
commit
f2ea55775e
@@ -372,6 +372,8 @@ static int dvic_probe(struct platform_device *pdev)
|
||||
dssdev->type = OMAP_DISPLAY_TYPE_DVI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = ddata->hpd_gpio || ddata->i2c_adapter
|
||||
? OMAP_DSS_DEVICE_OP_DETECT : 0;
|
||||
|
||||
omapdss_display_init(dssdev);
|
||||
omapdss_device_register(dssdev);
|
||||
|
@@ -141,10 +141,7 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
|
||||
struct omap_dss_device *src = dssdev->src;
|
||||
bool connected;
|
||||
|
||||
if (ddata->hpd_gpio)
|
||||
connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
|
||||
else
|
||||
connected = src->ops->detect(src);
|
||||
connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
|
||||
if (!connected && src->ops->hdmi.lost_hotplug)
|
||||
src->ops->hdmi.lost_hotplug(src);
|
||||
return connected;
|
||||
@@ -317,6 +314,7 @@ static int hdmic_probe(struct platform_device *pdev)
|
||||
dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(0);
|
||||
dssdev->ops_flags = ddata->hpd_gpio ? OMAP_DSS_DEVICE_OP_DETECT : 0;
|
||||
|
||||
omapdss_display_init(dssdev);
|
||||
omapdss_device_register(dssdev);
|
||||
|
@@ -132,8 +132,9 @@ static bool tpd_detect(struct omap_dss_device *dssdev)
|
||||
{
|
||||
struct panel_drv_data *ddata = to_panel_data(dssdev);
|
||||
struct omap_dss_device *src = dssdev->src;
|
||||
bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
|
||||
bool connected;
|
||||
|
||||
connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
|
||||
if (!connected && src->ops->hdmi.lost_hotplug)
|
||||
src->ops->hdmi.lost_hotplug(src);
|
||||
return connected;
|
||||
@@ -288,6 +289,7 @@ static int tpd_probe(struct platform_device *pdev)
|
||||
dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
|
||||
dssdev->owner = THIS_MODULE;
|
||||
dssdev->of_ports = BIT(1) | BIT(0);
|
||||
dssdev->ops_flags = OMAP_DSS_DEVICE_OP_DETECT;
|
||||
|
||||
dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1);
|
||||
if (IS_ERR(dssdev->next)) {
|
||||
|
Reference in New Issue
Block a user