diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-02 22:13:06 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:27 +0300 |
commit | 27d624527d99265c2df999af3615ff71c29d06f4 (patch) | |
tree | 7dc6bf622bfde27e4a25482aa0b80e8c902a630f /drivers/gpu/drm/omapdrm/displays | |
parent | c87193267d247c58f4517081d9cd04c8dc6302b8 (diff) | |
download | linux-27d624527d99265c2df999af3615ff71c29d06f4.tar.gz linux-27d624527d99265c2df999af3615ff71c29d06f4.tar.bz2 linux-27d624527d99265c2df999af3615ff71c29d06f4.zip |
drm/omap: dss: Acquire next dssdev at probe time
Look up the next dssdev at probe time based on device tree links for all
DSS outputs and encoders. This will be used to reverse the order of the
dssdev connect and disconnect call chains.
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>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/displays')
-rw-r--r-- | drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 9 |
3 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c index 939e259d601d..f661ba8f3fa0 100644 --- a/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +++ b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c @@ -169,6 +169,13 @@ static int opa362_probe(struct platform_device *pdev) dssdev->owner = THIS_MODULE; dssdev->of_ports = BIT(1) | BIT(0); + dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1); + if (IS_ERR(dssdev->next)) { + if (PTR_ERR(dssdev->next) != -EPROBE_DEFER) + dev_err(&pdev->dev, "failed to find video sink\n"); + return PTR_ERR(dssdev->next); + } + omapdss_device_register(dssdev); return 0; @@ -179,6 +186,8 @@ static int __exit opa362_remove(struct platform_device *pdev) struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; + if (dssdev->next) + omapdss_device_put(dssdev->next); omapdss_device_unregister(&ddata->dssdev); WARN_ON(omapdss_device_is_enabled(dssdev)); diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c index 55549c5a5af2..3be35ba564da 100644 --- a/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c @@ -192,6 +192,13 @@ static int tfp410_probe(struct platform_device *pdev) dssdev->owner = THIS_MODULE; dssdev->of_ports = BIT(1) | BIT(0); + dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1); + if (IS_ERR(dssdev->next)) { + if (PTR_ERR(dssdev->next) != -EPROBE_DEFER) + dev_err(&pdev->dev, "failed to find video sink\n"); + return PTR_ERR(dssdev->next); + } + omapdss_device_register(dssdev); return 0; @@ -202,6 +209,8 @@ static int __exit tfp410_remove(struct platform_device *pdev) struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; + if (dssdev->next) + omapdss_device_put(dssdev->next); omapdss_device_unregister(&ddata->dssdev); WARN_ON(omapdss_device_is_enabled(dssdev)); diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c index 58a831c3f74c..cee53346f6fc 100644 --- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c @@ -301,6 +301,13 @@ static int tpd_probe(struct platform_device *pdev) dssdev->owner = THIS_MODULE; dssdev->of_ports = BIT(1) | BIT(0); + dssdev->next = omapdss_of_find_connected_device(pdev->dev.of_node, 1); + if (IS_ERR(dssdev->next)) { + if (PTR_ERR(dssdev->next) != -EPROBE_DEFER) + dev_err(&pdev->dev, "failed to find video sink\n"); + return PTR_ERR(dssdev->next); + } + omapdss_device_register(dssdev); return 0; @@ -311,6 +318,8 @@ static int __exit tpd_remove(struct platform_device *pdev) struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct omap_dss_device *dssdev = &ddata->dssdev; + if (dssdev->next) + omapdss_device_put(dssdev->next); omapdss_device_unregister(&ddata->dssdev); WARN_ON(omapdss_device_is_enabled(dssdev)); |