summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss/output.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-12 19:41:31 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 11:42:12 +0200
commitd17eb4537a7eb16da9eafbfd5717e12b45b77251 (patch)
tree0979073a2e064898c47bef159eb1c3694a89f135 /drivers/gpu/drm/omapdrm/dss/output.c
parent56c9818d5c89b2655c6b4c65b99829faf5b4f544 (diff)
downloadlinux-next-d17eb4537a7eb16da9eafbfd5717e12b45b77251.tar.gz
linux-next-d17eb4537a7eb16da9eafbfd5717e12b45b77251.zip
drm/omap: Factor out common init/cleanup code for output devices
All the internal encoders share common init and cleanup code. Factor it out to separate functions. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/output.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/output.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
index 18505bc70f7e..0ac400a521f3 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -24,8 +24,15 @@
#include "dss.h"
#include "omapdss.h"
-int omapdss_output_validate(struct omap_dss_device *out)
+int omapdss_device_init_output(struct omap_dss_device *out)
{
+ out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
+ 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);
+ }
+
if (out->next && out->output_type != out->next->type) {
dev_err(out->dev, "output type and display type don't match\n");
return -EINVAL;
@@ -33,7 +40,14 @@ int omapdss_output_validate(struct omap_dss_device *out)
return 0;
}
-EXPORT_SYMBOL(omapdss_output_validate);
+EXPORT_SYMBOL(omapdss_device_init_output);
+
+void omapdss_device_cleanup_output(struct omap_dss_device *out)
+{
+ if (out->next)
+ omapdss_device_put(out->next);
+}
+EXPORT_SYMBOL(omapdss_device_cleanup_output);
int dss_install_mgr_ops(struct dss_device *dss,
const struct dss_mgr_ops *mgr_ops,