drm/omap: dss: Store dss_device pointer in omap_dss_device
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 2 Mar 2018 00:54:16 +0000 (02:54 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:26 +0000 (16:13 +0300)
Storing the dss_device pointer in the omap_dss_device structure will
allow accessing the dss_device from the dss_mgr API functions.

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>
17 files changed:
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
drivers/gpu/drm/omapdrm/displays/connector-dvi.c
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
drivers/gpu/drm/omapdrm/displays/panel-dpi.c
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
drivers/gpu/drm/omapdrm/dss/base.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_drv.c

index 0eacd2dc302d057dcc17f1e316212e742e29dacb..e416e9e1566a64ffd9adab962a908948223b068a 100644 (file)
@@ -53,7 +53,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index 754f15bc0115d2c3e8df43e02ff4426122098947..a35d39f6cca99535e3c3dddeb0b616ab99f7d381 100644 (file)
@@ -67,7 +67,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index e05f2964f8e1933863efd5337b6c242bdf5655bd..dd6e67f9ae475535e6b5922f29855b1733f2ee36 100644 (file)
@@ -63,7 +63,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index f665f2caea22553ae36fce467cb173a171835c21..41a51364c9852f2de838ef433c8ca56734062b26 100644 (file)
@@ -43,7 +43,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index 11c123ca7916a30e75f8500877af2dd2c2a84b67..cadb8f52aa88e5ee30feea793c7c4c25ae382e51 100644 (file)
@@ -39,7 +39,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index eb2d5af34a35006d9633ca72c996d9b8062261d4..4f671dc272a0121faee5bbce5a55c51668f01d69 100644 (file)
@@ -48,7 +48,7 @@ static int tpd_connect(struct omap_dss_device *dssdev,
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index 64eab64e5f0dcf0d9184588d2e691c6ecf51a2ee..c03986d7df73757edb9860425b4187cfae6dce64 100644 (file)
@@ -45,7 +45,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index bd9401c1c11e53e5ed9d3adba2f07281ad633283..aeeec81f8fcfd58fac33835fcb063db5baa7defb 100644 (file)
@@ -769,7 +769,7 @@ static int dsicm_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                dev_err(dev, "Failed to connect to video source\n");
                goto err_connect;
index 9f9caeadf5dd81cda55a5fd798c9984c36b43cdb..d4a7925e3f16e8a4753e7176cc6657f5875b9bbf 100644 (file)
@@ -127,7 +127,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index d07c955ea06f688ee3f80cae5e42fb24f9bbf299..b0fe60aba729185ace09ec8d6e71f7d6a750720e 100644 (file)
@@ -122,7 +122,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index d02f22a858e2305c4e348e26578a951d8bf8ef54..d96eb1a1397f3a08dfaf5d6d89c5cad0cf77e87c 100644 (file)
@@ -68,7 +68,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index a98c1181887aae8988b929babe47785a4af54f1d..65068eea0647150a256b1164b182039cf3b192eb 100644 (file)
@@ -517,7 +517,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index 07c3f8143e4c5a8a1974e2562868c93d9f8a90d4..96e2e30dd999024e3ea08291b90760222cc3bdb9 100644 (file)
@@ -176,7 +176,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index c32ab872e9f92595ddc3fc1e18028398ab34e036..5845f9e6c6bab4b4e9d24dd5873031bac06287b5 100644 (file)
@@ -347,7 +347,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)
                return PTR_ERR(src);
        }
 
-       r = omapdss_device_connect(src, dssdev);
+       r = omapdss_device_connect(dssdev->dss, src, dssdev);
        if (r) {
                omapdss_device_put(src);
                return r;
index 08846eea5a532603bb7a2d3a729d39034f89e04e..991c424960c7d9666b5ba9fb2e4ff5a50014cf1b 100644 (file)
@@ -177,7 +177,8 @@ done:
 }
 EXPORT_SYMBOL(omapdss_device_get_next);
 
-int omapdss_device_connect(struct omap_dss_device *src,
+int omapdss_device_connect(struct dss_device *dss,
+                          struct omap_dss_device *src,
                           struct omap_dss_device *dst)
 {
        int ret;
@@ -187,13 +188,17 @@ int omapdss_device_connect(struct omap_dss_device *src,
        if (omapdss_device_is_connected(src))
                return -EBUSY;
 
+       src->dss = dss;
+
        if (src->driver)
                ret = src->driver->connect(src);
        else
                ret = src->ops->connect(src, dst);
 
-       if (ret < 0)
+       if (ret < 0) {
+               src->dss = NULL;
                return ret;
+       }
 
        if (dst) {
                dst->src = src;
@@ -226,6 +231,8 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
                src->driver->disconnect(src);
        else
                src->ops->disconnect(src, dst);
+
+       src->dss = NULL;
 }
 EXPORT_SYMBOL_GPL(omapdss_device_disconnect);
 
index 96011e42da05b5064d01f8b984b4af1e73186444..4befe8aab333e8ef6a506a66e3e8e497ca88fe7b 100644 (file)
@@ -391,6 +391,7 @@ struct omap_dss_device {
 
        struct module *owner;
 
+       struct dss_device *dss;
        struct omap_dss_device *src;
        struct omap_dss_device *dst;
 
@@ -498,7 +499,8 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,
                                                    unsigned int port);
 struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from,
                                                bool display_only);
-int omapdss_device_connect(struct omap_dss_device *src,
+int omapdss_device_connect(struct dss_device *dss,
+                          struct omap_dss_device *src,
                           struct omap_dss_device *dst);
 void omapdss_device_disconnect(struct omap_dss_device *src,
                               struct omap_dss_device *dst);
index a3b7dbf1b92b13b0b69988ee44fe7e0cc15afd83..95ebb6b1fc360bedf2ca0a0871445a31938a98e4 100644 (file)
@@ -189,7 +189,7 @@ static int omap_connect_dssdevs(struct drm_device *ddev)
                return -EPROBE_DEFER;
 
        for_each_dss_display(dssdev) {
-               r = omapdss_device_connect(dssdev, NULL);
+               r = omapdss_device_connect(priv->dss, dssdev, NULL);
                if (r == -EPROBE_DEFER) {
                        omapdss_device_put(dssdev);
                        goto cleanup;