drm/omap: displays: Remove input omap_dss_device from panel data

All connectors, encoders and panels store a pointer to their input
omap_dss_device in the panel driver data structure. This duplicates the
src field in the omap_dss_device structure. Remove the private copy and
use the src field.

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:
Laurent Pinchart
2018-02-28 17:30:30 +02:00
committed by Tomi Valkeinen
parent fb5571717c
commit 7269fde4e8
14 changed files with 362 additions and 447 deletions

View File

@@ -19,7 +19,6 @@
struct panel_drv_data {
struct omap_dss_device dssdev;
struct omap_dss_device *in;
int pd_gpio;
@@ -31,23 +30,21 @@ struct panel_drv_data {
static int tfp410_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in;
struct omap_dss_device *src;
int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) {
src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n");
return PTR_ERR(in);
return PTR_ERR(src);
}
r = omapdss_device_connect(in, dssdev);
r = omapdss_device_connect(src, dssdev);
if (r) {
omap_dss_put_device(in);
omap_dss_put_device(src);
return r;
}
ddata->in = in;
return 0;
}
@@ -55,18 +52,17 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
struct omap_dss_device *src = dssdev->src;
omapdss_device_disconnect(in, &ddata->dssdev);
omapdss_device_disconnect(src, &ddata->dssdev);
omap_dss_put_device(in);
ddata->in = NULL;
omap_dss_put_device(src);
}
static int tfp410_enable(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
struct omap_dss_device *src = dssdev->src;
int r;
if (!omapdss_device_is_connected(dssdev))
@@ -75,9 +71,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev))
return 0;
in->ops->set_timings(in, &ddata->vm);
src->ops->set_timings(src, &ddata->vm);
r = in->ops->enable(in);
r = src->ops->enable(src);
if (r)
return r;
@@ -92,7 +88,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
static void tfp410_disable(struct omap_dss_device *dssdev)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
struct omap_dss_device *src = dssdev->src;
if (!omapdss_device_is_enabled(dssdev))
return;
@@ -100,7 +96,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
if (gpio_is_valid(ddata->pd_gpio))
gpio_set_value_cansleep(ddata->pd_gpio, 0);
in->ops->disable(in);
src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
}
@@ -115,24 +111,23 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
struct omap_dss_device *src = dssdev->src;
tfp410_fix_timings(vm);
ddata->vm = *vm;
in->ops->set_timings(in, vm);
src->ops->set_timings(src, vm);
}
static int tfp410_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in;
struct omap_dss_device *src = dssdev->src;
tfp410_fix_timings(vm);
return in->ops->check_timings(in, vm);
return src->ops->check_timings(src, vm);
}
static const struct omap_dss_device_ops tfp410_ops = {