mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-28 13:34:38 +08:00
drm/omap: dss: Store dss_device pointer in omap_dss_device
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>
This commit is contained in:
parent
c1dfe721e0
commit
f324b2798c
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user