drm/omap: dss: Make omap_dss_device_ops optional

As part of the move to drm_bridge ops, the dssdev ops will become empty
for some of the internal encoders. Make them optional in the driver to
allow them to be removed completely, easing the transition.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-28-laurent.pinchart@ideasonboard.com
This commit is contained in:
Laurent Pinchart
2020-02-26 13:24:47 +02:00
committed by Tomi Valkeinen
parent 326a1166ca
commit db0fefd1b9
4 changed files with 22 additions and 16 deletions

View File

@ -195,10 +195,12 @@ int omapdss_device_connect(struct dss_device *dss,
dst->dss = dss;
ret = dst->ops->connect(src, dst);
if (ret < 0) {
dst->dss = NULL;
return ret;
if (dst->ops && dst->ops->connect) {
ret = dst->ops->connect(src, dst);
if (ret < 0) {
dst->dss = NULL;
return ret;
}
}
return 0;
@ -226,7 +228,8 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
WARN_ON(dst->state != OMAP_DSS_DISPLAY_DISABLED);
dst->ops->disconnect(src, dst);
if (dst->ops && dst->ops->disconnect)
dst->ops->disconnect(src, dst);
dst->dss = NULL;
}
EXPORT_SYMBOL_GPL(omapdss_device_disconnect);
@ -238,7 +241,7 @@ void omapdss_device_pre_enable(struct omap_dss_device *dssdev)
omapdss_device_pre_enable(dssdev->next);
if (dssdev->ops->pre_enable)
if (dssdev->ops && dssdev->ops->pre_enable)
dssdev->ops->pre_enable(dssdev);
}
EXPORT_SYMBOL_GPL(omapdss_device_pre_enable);
@ -248,7 +251,7 @@ void omapdss_device_enable(struct omap_dss_device *dssdev)
if (!dssdev)
return;
if (dssdev->ops->enable)
if (dssdev->ops && dssdev->ops->enable)
dssdev->ops->enable(dssdev);
omapdss_device_enable(dssdev->next);
@ -264,7 +267,7 @@ void omapdss_device_disable(struct omap_dss_device *dssdev)
omapdss_device_disable(dssdev->next);
if (dssdev->ops->disable)
if (dssdev->ops && dssdev->ops->disable)
dssdev->ops->disable(dssdev);
}
EXPORT_SYMBOL_GPL(omapdss_device_disable);
@ -274,7 +277,7 @@ void omapdss_device_post_disable(struct omap_dss_device *dssdev)
if (!dssdev)
return;
if (dssdev->ops->post_disable)
if (dssdev->ops && dssdev->ops->post_disable)
dssdev->ops->post_disable(dssdev);
omapdss_device_post_disable(dssdev->next);