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/dss/sdi.c | |
parent | c87193267d247c58f4517081d9cd04c8dc6302b8 (diff) | |
download | talos-op-linux-27d624527d99265c2df999af3615ff71c29d06f4.tar.gz talos-op-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/dss/sdi.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/sdi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c index e9b280784264..fd7c11ebda5d 100644 --- a/drivers/gpu/drm/omapdrm/dss/sdi.c +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c @@ -317,7 +317,7 @@ static const struct omap_dss_device_ops sdi_ops = { .set_timings = sdi_set_timings, }; -static void sdi_init_output(struct sdi_device *sdi) +static int sdi_init_output(struct sdi_device *sdi) { struct omap_dss_device *out = &sdi->output; @@ -331,11 +331,22 @@ static void sdi_init_output(struct sdi_device *sdi) out->ops = &sdi_ops; out->owner = THIS_MODULE; + out->next = omapdss_of_find_connected_device(out->dev->of_node, 1); + if (IS_ERR(out->next)) { + if (PTR_ERR(out->next) != -EPROBE_DEFER) + dev_err(out->dev, "failed to find video sink\n"); + return PTR_ERR(out->next); + } + omapdss_device_register(out); + + return 0; } static void sdi_uninit_output(struct sdi_device *sdi) { + if (sdi->output.next) + omapdss_device_put(sdi->output.next); omapdss_device_unregister(&sdi->output); } @@ -370,7 +381,9 @@ int sdi_init_port(struct dss_device *dss, struct platform_device *pdev, sdi->pdev = pdev; port->data = sdi; - sdi_init_output(sdi); + r = sdi_init_output(sdi); + if (r) + goto err_free; return 0; |