Commit 7269fde4 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent fb557171
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct device *dev; struct device *dev;
...@@ -45,40 +44,37 @@ static const struct videomode tvc_pal_vm = { ...@@ -45,40 +44,37 @@ static const struct videomode tvc_pal_vm = {
static int tvc_connect(struct omap_dss_device *dssdev) static int tvc_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in; struct omap_dss_device *src;
int r; int r;
in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node); src = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(ddata->dev, "failed to find video source\n"); dev_err(ddata->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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void tvc_disconnect(struct omap_dss_device *dssdev) static void tvc_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int tvc_enable(struct omap_dss_device *dssdev) static int tvc_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
dev_dbg(ddata->dev, "enable\n"); dev_dbg(ddata->dev, "enable\n");
...@@ -89,9 +85,9 @@ static int tvc_enable(struct omap_dss_device *dssdev) ...@@ -89,9 +85,9 @@ static int tvc_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -103,14 +99,14 @@ static int tvc_enable(struct omap_dss_device *dssdev) ...@@ -103,14 +99,14 @@ static int tvc_enable(struct omap_dss_device *dssdev)
static void tvc_disable(struct omap_dss_device *dssdev) static void tvc_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
dev_dbg(ddata->dev, "disable\n"); dev_dbg(ddata->dev, "disable\n");
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -119,11 +115,11 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, ...@@ -119,11 +115,11 @@ static void tvc_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void tvc_get_timings(struct omap_dss_device *dssdev, static void tvc_get_timings(struct omap_dss_device *dssdev,
...@@ -137,10 +133,9 @@ static void tvc_get_timings(struct omap_dss_device *dssdev, ...@@ -137,10 +133,9 @@ static void tvc_get_timings(struct omap_dss_device *dssdev,
static int tvc_check_timings(struct omap_dss_device *dssdev, static int tvc_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver tvc_driver = { static const struct omap_dss_driver tvc_driver = {
......
...@@ -40,7 +40,6 @@ static const struct videomode dvic_default_vm = { ...@@ -40,7 +40,6 @@ static const struct videomode dvic_default_vm = {
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct videomode vm; struct videomode vm;
...@@ -59,41 +58,37 @@ struct panel_drv_data { ...@@ -59,41 +58,37 @@ struct panel_drv_data {
static int dvic_connect(struct omap_dss_device *dssdev) static int dvic_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void dvic_disconnect(struct omap_dss_device *dssdev) static void dvic_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int dvic_enable(struct omap_dss_device *dssdev) static int dvic_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -102,9 +97,9 @@ static int dvic_enable(struct omap_dss_device *dssdev) ...@@ -102,9 +97,9 @@ static int dvic_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -115,13 +110,12 @@ static int dvic_enable(struct omap_dss_device *dssdev) ...@@ -115,13 +110,12 @@ static int dvic_enable(struct omap_dss_device *dssdev)
static void dvic_disable(struct omap_dss_device *dssdev) static void dvic_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -130,11 +124,11 @@ static void dvic_set_timings(struct omap_dss_device *dssdev, ...@@ -130,11 +124,11 @@ static void dvic_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void dvic_get_timings(struct omap_dss_device *dssdev, static void dvic_get_timings(struct omap_dss_device *dssdev,
...@@ -148,10 +142,9 @@ static void dvic_get_timings(struct omap_dss_device *dssdev, ...@@ -148,10 +142,9 @@ static void dvic_get_timings(struct omap_dss_device *dssdev,
static int dvic_check_timings(struct omap_dss_device *dssdev, static int dvic_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static int dvic_ddc_read(struct i2c_adapter *adapter, static int dvic_ddc_read(struct i2c_adapter *adapter,
......
...@@ -37,7 +37,6 @@ static const struct videomode hdmic_default_vm = { ...@@ -37,7 +37,6 @@ static const struct videomode hdmic_default_vm = {
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
void (*hpd_cb)(void *cb_data, enum drm_connector_status status); void (*hpd_cb)(void *cb_data, enum drm_connector_status status);
void *hpd_cb_data; void *hpd_cb_data;
bool hpd_enabled; bool hpd_enabled;
...@@ -55,40 +54,37 @@ struct panel_drv_data { ...@@ -55,40 +54,37 @@ struct panel_drv_data {
static int hdmic_connect(struct omap_dss_device *dssdev) static int hdmic_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in; struct omap_dss_device *src;
int r; int r;
in = omapdss_of_find_source_for_first_ep(ddata->dev->of_node); src = omapdss_of_find_source_for_first_ep(ddata->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(ddata->dev, "failed to find video source\n"); dev_err(ddata->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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void hdmic_disconnect(struct omap_dss_device *dssdev) static void hdmic_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int hdmic_enable(struct omap_dss_device *dssdev) static int hdmic_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
dev_dbg(ddata->dev, "enable\n"); dev_dbg(ddata->dev, "enable\n");
...@@ -99,9 +95,9 @@ static int hdmic_enable(struct omap_dss_device *dssdev) ...@@ -99,9 +95,9 @@ static int hdmic_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -113,14 +109,14 @@ static int hdmic_enable(struct omap_dss_device *dssdev) ...@@ -113,14 +109,14 @@ static int hdmic_enable(struct omap_dss_device *dssdev)
static void hdmic_disable(struct omap_dss_device *dssdev) static void hdmic_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
dev_dbg(ddata->dev, "disable\n"); dev_dbg(ddata->dev, "disable\n");
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -129,11 +125,11 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev, ...@@ -129,11 +125,11 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void hdmic_get_timings(struct omap_dss_device *dssdev, static void hdmic_get_timings(struct omap_dss_device *dssdev,
...@@ -147,33 +143,31 @@ static void hdmic_get_timings(struct omap_dss_device *dssdev, ...@@ -147,33 +143,31 @@ static void hdmic_get_timings(struct omap_dss_device *dssdev,
static int hdmic_check_timings(struct omap_dss_device *dssdev, static int hdmic_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static int hdmic_read_edid(struct omap_dss_device *dssdev, static int hdmic_read_edid(struct omap_dss_device *dssdev,
u8 *edid, int len) u8 *edid, int len)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->hdmi.read_edid(in, edid, len); return src->ops->hdmi.read_edid(src, edid, len);
} }
static bool hdmic_detect(struct omap_dss_device *dssdev) static bool hdmic_detect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
bool connected; bool connected;
if (gpio_is_valid(ddata->hpd_gpio)) if (gpio_is_valid(ddata->hpd_gpio))
connected = gpio_get_value_cansleep(ddata->hpd_gpio); connected = gpio_get_value_cansleep(ddata->hpd_gpio);
else else
connected = in->ops->hdmi.detect(in); connected = src->ops->hdmi.detect(src);
if (!connected && in->ops->hdmi.lost_hotplug) if (!connected && src->ops->hdmi.lost_hotplug)
in->ops->hdmi.lost_hotplug(in); src->ops->hdmi.lost_hotplug(src);
return connected; return connected;
} }
...@@ -183,7 +177,7 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ...@@ -183,7 +177,7 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
void *cb_data) void *cb_data)
{ {
struct panel_drv_data *ddata = to_panel_data(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 (gpio_is_valid(ddata->hpd_gpio)) { if (gpio_is_valid(ddata->hpd_gpio)) {
mutex_lock(&ddata->hpd_lock); mutex_lock(&ddata->hpd_lock);
...@@ -191,8 +185,8 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ...@@ -191,8 +185,8 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
ddata->hpd_cb_data = cb_data; ddata->hpd_cb_data = cb_data;
mutex_unlock(&ddata->hpd_lock); mutex_unlock(&ddata->hpd_lock);
return 0; return 0;
} else if (in->ops->hdmi.register_hpd_cb) { } else if (src->ops->hdmi.register_hpd_cb) {
return in->ops->hdmi.register_hpd_cb(in, cb, cb_data); return src->ops->hdmi.register_hpd_cb(src, cb, cb_data);
} }
return -ENOTSUPP; return -ENOTSUPP;
...@@ -201,61 +195,59 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ...@@ -201,61 +195,59 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,
static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev) static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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 (gpio_is_valid(ddata->hpd_gpio)) { if (gpio_is_valid(ddata->hpd_gpio)) {
mutex_lock(&ddata->hpd_lock); mutex_lock(&ddata->hpd_lock);
ddata->hpd_cb = NULL; ddata->hpd_cb = NULL;
ddata->hpd_cb_data = NULL; ddata->hpd_cb_data = NULL;
mutex_unlock(&ddata->hpd_lock); mutex_unlock(&ddata->hpd_lock);
} else if (in->ops->hdmi.unregister_hpd_cb) { } else if (src->ops->hdmi.unregister_hpd_cb) {
in->ops->hdmi.unregister_hpd_cb(in); src->ops->hdmi.unregister_hpd_cb(src);
} }
} }
static void hdmic_enable_hpd(struct omap_dss_device *dssdev) static void hdmic_enable_hpd(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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 (gpio_is_valid(ddata->hpd_gpio)) { if (gpio_is_valid(ddata->hpd_gpio)) {
mutex_lock(&ddata->hpd_lock); mutex_lock(&ddata->hpd_lock);
ddata->hpd_enabled = true; ddata->hpd_enabled = true;
mutex_unlock(&ddata->hpd_lock); mutex_unlock(&ddata->hpd_lock);
} else if (in->ops->hdmi.enable_hpd) { } else if (src->ops->hdmi.enable_hpd) {
in->ops->hdmi.enable_hpd(in); src->ops->hdmi.enable_hpd(src);
} }
} }
static void hdmic_disable_hpd(struct omap_dss_device *dssdev) static void hdmic_disable_hpd(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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 (gpio_is_valid(ddata->hpd_gpio)) { if (gpio_is_valid(ddata->hpd_gpio)) {
mutex_lock(&ddata->hpd_lock); mutex_lock(&ddata->hpd_lock);
ddata->hpd_enabled = false; ddata->hpd_enabled = false;
mutex_unlock(&ddata->hpd_lock); mutex_unlock(&ddata->hpd_lock);
} else if (in->ops->hdmi.disable_hpd) { } else if (src->ops->hdmi.disable_hpd) {
in->ops->hdmi.disable_hpd(in); src->ops->hdmi.disable_hpd(src);
} }
} }
static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode) static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->hdmi.set_hdmi_mode(in, hdmi_mode); return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
} }
static int hdmic_set_infoframe(struct omap_dss_device *dssdev, static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi) const struct hdmi_avi_infoframe *avi)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->hdmi.set_infoframe(in, avi); return src->ops->hdmi.set_infoframe(src, avi);
} }
static const struct omap_dss_driver hdmic_driver = { static const struct omap_dss_driver hdmic_driver = {
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct gpio_desc *enable_gpio; struct gpio_desc *enable_gpio;
...@@ -35,23 +34,21 @@ struct panel_drv_data { ...@@ -35,23 +34,21 @@ struct panel_drv_data {
static int opa362_connect(struct omap_dss_device *dssdev, static int opa362_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
...@@ -59,18 +56,17 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, ...@@ -59,18 +56,17 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); 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); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int opa362_enable(struct omap_dss_device *dssdev) static int opa362_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
dev_dbg(dssdev->dev, "enable\n"); dev_dbg(dssdev->dev, "enable\n");
...@@ -81,9 +77,9 @@ static int opa362_enable(struct omap_dss_device *dssdev) ...@@ -81,9 +77,9 @@ static int opa362_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -98,7 +94,7 @@ static int opa362_enable(struct omap_dss_device *dssdev) ...@@ -98,7 +94,7 @@ static int opa362_enable(struct omap_dss_device *dssdev)
static void opa362_disable(struct omap_dss_device *dssdev) static void opa362_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
dev_dbg(dssdev->dev, "disable\n"); dev_dbg(dssdev->dev, "disable\n");
...@@ -108,7 +104,7 @@ static void opa362_disable(struct omap_dss_device *dssdev) ...@@ -108,7 +104,7 @@ static void opa362_disable(struct omap_dss_device *dssdev)
if (ddata->enable_gpio) if (ddata->enable_gpio)
gpiod_set_value_cansleep(ddata->enable_gpio, 0); gpiod_set_value_cansleep(ddata->enable_gpio, 0);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -117,24 +113,23 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, ...@@ -117,24 +113,23 @@ static void opa362_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
dev_dbg(dssdev->dev, "set_timings\n"); dev_dbg(dssdev->dev, "set_timings\n");
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static int opa362_check_timings(struct omap_dss_device *dssdev, static int opa362_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
dev_dbg(dssdev->dev, "check_timings\n"); dev_dbg(dssdev->dev, "check_timings\n");
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_device_ops opa362_ops = { static const struct omap_dss_device_ops opa362_ops = {
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
int pd_gpio; int pd_gpio;
...@@ -31,23 +30,21 @@ struct panel_drv_data { ...@@ -31,23 +30,21 @@ struct panel_drv_data {
static int tfp410_connect(struct omap_dss_device *dssdev, static int tfp410_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
...@@ -55,18 +52,17 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, ...@@ -55,18 +52,17 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); 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); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int tfp410_enable(struct omap_dss_device *dssdev) static int tfp410_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -75,9 +71,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev) ...@@ -75,9 +71,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -92,7 +88,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev) ...@@ -92,7 +88,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev)
static void tfp410_disable(struct omap_dss_device *dssdev) static void tfp410_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -100,7 +96,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev) ...@@ -100,7 +96,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
if (gpio_is_valid(ddata->pd_gpio)) if (gpio_is_valid(ddata->pd_gpio))
gpio_set_value_cansleep(ddata->pd_gpio, 0); gpio_set_value_cansleep(ddata->pd_gpio, 0);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -115,24 +111,23 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, ...@@ -115,24 +111,23 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); 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); tfp410_fix_timings(vm);
ddata->vm = *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, static int tfp410_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
tfp410_fix_timings(vm); 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 = { static const struct omap_dss_device_ops tfp410_ops = {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
void (*hpd_cb)(void *cb_data, enum drm_connector_status status); void (*hpd_cb)(void *cb_data, enum drm_connector_status status);
void *hpd_cb_data; void *hpd_cb_data;
bool hpd_enabled; bool hpd_enabled;
...@@ -40,18 +39,18 @@ static int tpd_connect(struct omap_dss_device *dssdev, ...@@ -40,18 +39,18 @@ static int tpd_connect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in; struct omap_dss_device *src;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
...@@ -61,7 +60,6 @@ static int tpd_connect(struct omap_dss_device *dssdev, ...@@ -61,7 +60,6 @@ static int tpd_connect(struct omap_dss_device *dssdev,
/* DC-DC converter needs at max 300us to get to 90% of 5V */ /* DC-DC converter needs at max 300us to get to 90% of 5V */
udelay(300); udelay(300);
ddata->in = in;
return 0; return 0;
} }
...@@ -69,29 +67,28 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, ...@@ -69,29 +67,28 @@ static void tpd_disconnect(struct omap_dss_device *dssdev,
struct omap_dss_device *dst) struct omap_dss_device *dst)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0); gpiod_set_value_cansleep(ddata->ct_cp_hpd_gpio, 0);
gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0); gpiod_set_value_cansleep(ddata->ls_oe_gpio, 0);
omapdss_device_disconnect(in, &ddata->dssdev); omapdss_device_disconnect(src, &ddata->dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int tpd_enable(struct omap_dss_device *dssdev) static int tpd_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0; 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) if (r)
return r; return r;
...@@ -102,13 +99,12 @@ static int tpd_enable(struct omap_dss_device *dssdev) ...@@ -102,13 +99,12 @@ static int tpd_enable(struct omap_dss_device *dssdev)
static void tpd_disable(struct omap_dss_device *dssdev) static void tpd_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return; return;
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -117,45 +113,41 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, ...@@ -117,45 +113,41 @@ static void tpd_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static int tpd_check_timings(struct omap_dss_device *dssdev, static int tpd_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
int r;
r = in->ops->check_timings(in, vm);
return r; return src->ops->check_timings(src, vm);
} }
static int tpd_read_edid(struct omap_dss_device *dssdev, static int tpd_read_edid(struct omap_dss_device *dssdev,
u8 *edid, int len) u8 *edid, int len)
{ {
struct panel_drv_data *ddata = to_panel_data(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 (!gpiod_get_value_cansleep(ddata->hpd_gpio)) if (!gpiod_get_value_cansleep(ddata->hpd_gpio))
return -ENODEV; return -ENODEV;
return in->ops->hdmi.read_edid(in, edid, len); return src->ops->hdmi.read_edid(src, edid, len);
} }
static bool tpd_detect(struct omap_dss_device *dssdev) static bool tpd_detect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio); bool connected = gpiod_get_value_cansleep(ddata->hpd_gpio);
if (!connected && in->ops->hdmi.lost_hotplug) if (!connected && src->ops->hdmi.lost_hotplug)
in->ops->hdmi.lost_hotplug(in); src->ops->hdmi.lost_hotplug(src);
return connected; return connected;
} }
...@@ -205,19 +197,17 @@ static void tpd_disable_hpd(struct omap_dss_device *dssdev) ...@@ -205,19 +197,17 @@ static void tpd_disable_hpd(struct omap_dss_device *dssdev)
static int tpd_set_infoframe(struct omap_dss_device *dssdev, static int tpd_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi) const struct hdmi_avi_infoframe *avi)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->hdmi.set_infoframe(in, avi); return src->ops->hdmi.set_infoframe(src, avi);
} }
static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev, static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,
bool hdmi_mode) bool hdmi_mode)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->hdmi.set_hdmi_mode(in, hdmi_mode); return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
} }
static const struct omap_dss_device_ops tpd_ops = { static const struct omap_dss_device_ops tpd_ops = {
...@@ -262,7 +252,7 @@ static irqreturn_t tpd_hpd_isr(int irq, void *data) ...@@ -262,7 +252,7 @@ static irqreturn_t tpd_hpd_isr(int irq, void *data)
static int tpd_probe(struct platform_device *pdev) static int tpd_probe(struct platform_device *pdev)
{ {
struct omap_dss_device *in, *dssdev; struct omap_dss_device *dssdev;
struct panel_drv_data *ddata; struct panel_drv_data *ddata;
int r; int r;
struct gpio_desc *gpio; struct gpio_desc *gpio;
...@@ -311,8 +301,6 @@ static int tpd_probe(struct platform_device *pdev) ...@@ -311,8 +301,6 @@ static int tpd_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
dssdev->port_num = 1; dssdev->port_num = 1;
in = ddata->in;
r = omapdss_register_output(dssdev); r = omapdss_register_output(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register output\n"); dev_err(&pdev->dev, "Failed to register output\n");
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct videomode vm; struct videomode vm;
...@@ -37,41 +36,37 @@ struct panel_drv_data { ...@@ -37,41 +36,37 @@ struct panel_drv_data {
static int panel_dpi_connect(struct omap_dss_device *dssdev) static int panel_dpi_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void panel_dpi_disconnect(struct omap_dss_device *dssdev) static void panel_dpi_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int panel_dpi_enable(struct omap_dss_device *dssdev) static int panel_dpi_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -80,15 +75,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) ...@@ -80,15 +75,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
r = regulator_enable(ddata->vcc_supply); r = regulator_enable(ddata->vcc_supply);
if (r) { if (r) {
in->ops->disable(in); src->ops->disable(src);
return r; return r;
} }
...@@ -103,7 +98,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) ...@@ -103,7 +98,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
static void panel_dpi_disable(struct omap_dss_device *dssdev) static void panel_dpi_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -113,7 +108,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) ...@@ -113,7 +108,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)
gpiod_set_value_cansleep(ddata->enable_gpio, 0); gpiod_set_value_cansleep(ddata->enable_gpio, 0);
regulator_disable(ddata->vcc_supply); regulator_disable(ddata->vcc_supply);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -122,11 +117,11 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev, ...@@ -122,11 +117,11 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void panel_dpi_get_timings(struct omap_dss_device *dssdev, static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
...@@ -140,10 +135,9 @@ static void panel_dpi_get_timings(struct omap_dss_device *dssdev, ...@@ -140,10 +135,9 @@ static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
static int panel_dpi_check_timings(struct omap_dss_device *dssdev, static int panel_dpi_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver panel_dpi_ops = { static const struct omap_dss_driver panel_dpi_ops = {
......
...@@ -45,7 +45,6 @@ static const struct videomode lb035q02_vm = { ...@@ -45,7 +45,6 @@ static const struct videomode lb035q02_vm = {
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct spi_device *spi; struct spi_device *spi;
...@@ -119,42 +118,39 @@ static void init_lb035q02_panel(struct spi_device *spi) ...@@ -119,42 +118,39 @@ static void init_lb035q02_panel(struct spi_device *spi)
static int lb035q02_connect(struct omap_dss_device *dssdev) static int lb035q02_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in; struct omap_dss_device *src;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
init_lb035q02_panel(ddata->spi); init_lb035q02_panel(ddata->spi);
ddata->in = in;
return 0; return 0;
} }
static void lb035q02_disconnect(struct omap_dss_device *dssdev) static void lb035q02_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int lb035q02_enable(struct omap_dss_device *dssdev) static int lb035q02_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -163,9 +159,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) ...@@ -163,9 +159,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -180,7 +176,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) ...@@ -180,7 +176,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)
static void lb035q02_disable(struct omap_dss_device *dssdev) static void lb035q02_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -188,7 +184,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) ...@@ -188,7 +184,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)
if (ddata->enable_gpio) if (ddata->enable_gpio)
gpiod_set_value_cansleep(ddata->enable_gpio, 0); gpiod_set_value_cansleep(ddata->enable_gpio, 0);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -197,11 +193,11 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev, ...@@ -197,11 +193,11 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void lb035q02_get_timings(struct omap_dss_device *dssdev, static void lb035q02_get_timings(struct omap_dss_device *dssdev,
...@@ -215,10 +211,9 @@ static void lb035q02_get_timings(struct omap_dss_device *dssdev, ...@@ -215,10 +211,9 @@ static void lb035q02_get_timings(struct omap_dss_device *dssdev,
static int lb035q02_check_timings(struct omap_dss_device *dssdev, static int lb035q02_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver lb035q02_ops = { static const struct omap_dss_driver lb035q02_ops = {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct videomode vm; struct videomode vm;
...@@ -114,41 +113,37 @@ static int init_nec_8048_wvga_lcd(struct spi_device *spi) ...@@ -114,41 +113,37 @@ static int init_nec_8048_wvga_lcd(struct spi_device *spi)
static int nec_8048_connect(struct omap_dss_device *dssdev) static int nec_8048_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void nec_8048_disconnect(struct omap_dss_device *dssdev) static void nec_8048_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int nec_8048_enable(struct omap_dss_device *dssdev) static int nec_8048_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -157,9 +152,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev) ...@@ -157,9 +152,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -174,7 +169,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev) ...@@ -174,7 +169,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)
static void nec_8048_disable(struct omap_dss_device *dssdev) static void nec_8048_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -182,7 +177,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) ...@@ -182,7 +177,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)
if (gpio_is_valid(ddata->res_gpio)) if (gpio_is_valid(ddata->res_gpio))
gpio_set_value_cansleep(ddata->res_gpio, 0); gpio_set_value_cansleep(ddata->res_gpio, 0);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -191,11 +186,11 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev, ...@@ -191,11 +186,11 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void nec_8048_get_timings(struct omap_dss_device *dssdev, static void nec_8048_get_timings(struct omap_dss_device *dssdev,
...@@ -209,10 +204,9 @@ static void nec_8048_get_timings(struct omap_dss_device *dssdev, ...@@ -209,10 +204,9 @@ static void nec_8048_get_timings(struct omap_dss_device *dssdev,
static int nec_8048_check_timings(struct omap_dss_device *dssdev, static int nec_8048_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver nec_8048_ops = { static const struct omap_dss_driver nec_8048_ops = {
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct regulator *vcc; struct regulator *vcc;
struct videomode vm; struct videomode vm;
...@@ -60,41 +59,37 @@ static const struct videomode sharp_ls_vm = { ...@@ -60,41 +59,37 @@ static const struct videomode sharp_ls_vm = {
static int sharp_ls_connect(struct omap_dss_device *dssdev) static int sharp_ls_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void sharp_ls_disconnect(struct omap_dss_device *dssdev) static void sharp_ls_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int sharp_ls_enable(struct omap_dss_device *dssdev) static int sharp_ls_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -103,7 +98,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -103,7 +98,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; return 0;
in->ops->set_timings(in, &ddata->vm); src->ops->set_timings(src, &ddata->vm);
if (ddata->vcc) { if (ddata->vcc) {
r = regulator_enable(ddata->vcc); r = regulator_enable(ddata->vcc);
...@@ -111,7 +106,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -111,7 +106,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)
return r; return r;
} }
r = in->ops->enable(in); r = src->ops->enable(src);
if (r) { if (r) {
regulator_disable(ddata->vcc); regulator_disable(ddata->vcc);
return r; return r;
...@@ -134,7 +129,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -134,7 +129,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)
static void sharp_ls_disable(struct omap_dss_device *dssdev) static void sharp_ls_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -149,7 +144,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) ...@@ -149,7 +144,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)
msleep(100); msleep(100);
in->ops->disable(in); src->ops->disable(src);
if (ddata->vcc) if (ddata->vcc)
regulator_disable(ddata->vcc); regulator_disable(ddata->vcc);
...@@ -161,11 +156,11 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev, ...@@ -161,11 +156,11 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void sharp_ls_get_timings(struct omap_dss_device *dssdev, static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
...@@ -179,10 +174,9 @@ static void sharp_ls_get_timings(struct omap_dss_device *dssdev, ...@@ -179,10 +174,9 @@ static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
static int sharp_ls_check_timings(struct omap_dss_device *dssdev, static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver sharp_ls_ops = { static const struct omap_dss_driver sharp_ls_ops = {
......
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
int reset_gpio; int reset_gpio;
...@@ -509,48 +508,44 @@ static const struct attribute_group bldev_attr_group = { ...@@ -509,48 +508,44 @@ static const struct attribute_group bldev_attr_group = {
static int acx565akm_connect(struct omap_dss_device *dssdev) static int acx565akm_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void acx565akm_disconnect(struct omap_dss_device *dssdev) static void acx565akm_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
dev_dbg(&ddata->spi->dev, "%s\n", __func__); dev_dbg(&ddata->spi->dev, "%s\n", __func__);
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) { if (r) {
pr_err("%s sdi enable failed\n", __func__); pr_err("%s sdi enable failed\n", __func__);
return r; return r;
...@@ -591,7 +586,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) ...@@ -591,7 +586,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
static void acx565akm_panel_power_off(struct omap_dss_device *dssdev) static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
dev_dbg(dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
...@@ -615,7 +610,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev) ...@@ -615,7 +610,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)
/* FIXME need to tweak this delay */ /* FIXME need to tweak this delay */
msleep(100); msleep(100);
in->ops->disable(in); src->ops->disable(src);
} }
static int acx565akm_enable(struct omap_dss_device *dssdev) static int acx565akm_enable(struct omap_dss_device *dssdev)
...@@ -662,11 +657,11 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev, ...@@ -662,11 +657,11 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void acx565akm_get_timings(struct omap_dss_device *dssdev, static void acx565akm_get_timings(struct omap_dss_device *dssdev,
...@@ -680,10 +675,9 @@ static void acx565akm_get_timings(struct omap_dss_device *dssdev, ...@@ -680,10 +675,9 @@ static void acx565akm_get_timings(struct omap_dss_device *dssdev,
static int acx565akm_check_timings(struct omap_dss_device *dssdev, static int acx565akm_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver acx565akm_ops = { static const struct omap_dss_driver acx565akm_ops = {
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct videomode vm; struct videomode vm;
...@@ -168,41 +167,37 @@ enum jbt_register { ...@@ -168,41 +167,37 @@ enum jbt_register {
static int td028ttec1_panel_connect(struct omap_dss_device *dssdev) static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev) static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -211,9 +206,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) ...@@ -211,9 +206,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -310,7 +305,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) ...@@ -310,7 +305,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)
static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
...@@ -322,7 +317,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) ...@@ -322,7 +317,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)
jbt_ret_write_0(ddata, JBT_REG_SLEEP_IN); jbt_ret_write_0(ddata, JBT_REG_SLEEP_IN);
jbt_reg_write_1(ddata, JBT_REG_POWER_ON_OFF, 0x00); jbt_reg_write_1(ddata, JBT_REG_POWER_ON_OFF, 0x00);
in->ops->disable(in); src->ops->disable(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -331,11 +326,11 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, ...@@ -331,11 +326,11 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
...@@ -349,10 +344,9 @@ static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, ...@@ -349,10 +344,9 @@ static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev, static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver td028ttec1_ops = { static const struct omap_dss_driver td028ttec1_ops = {
......
...@@ -54,7 +54,6 @@ static const u16 tpo_td043_def_gamma[12] = { ...@@ -54,7 +54,6 @@ static const u16 tpo_td043_def_gamma[12] = {
struct panel_drv_data { struct panel_drv_data {
struct omap_dss_device dssdev; struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct videomode vm; struct videomode vm;
...@@ -339,41 +338,37 @@ static void tpo_td043_power_off(struct panel_drv_data *ddata) ...@@ -339,41 +338,37 @@ static void tpo_td043_power_off(struct panel_drv_data *ddata)
static int tpo_td043_connect(struct omap_dss_device *dssdev) static int tpo_td043_connect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src;
struct omap_dss_device *in;
int r; int r;
in = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node); src = omapdss_of_find_source_for_first_ep(dssdev->dev->of_node);
if (IS_ERR(in)) { if (IS_ERR(src)) {
dev_err(dssdev->dev, "failed to find video source\n"); 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) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
ddata->in = in;
return 0; return 0;
} }
static void tpo_td043_disconnect(struct omap_dss_device *dssdev) static void tpo_td043_disconnect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
omap_dss_put_device(in); omap_dss_put_device(src);
ddata->in = NULL;
} }
static int tpo_td043_enable(struct omap_dss_device *dssdev) static int tpo_td043_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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; int r;
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
...@@ -382,9 +377,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -382,9 +377,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)
if (omapdss_device_is_enabled(dssdev)) if (omapdss_device_is_enabled(dssdev))
return 0; 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) if (r)
return r; return r;
...@@ -395,7 +390,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -395,7 +390,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)
if (!ddata->spi_suspended) { if (!ddata->spi_suspended) {
r = tpo_td043_power_on(ddata); r = tpo_td043_power_on(ddata);
if (r) { if (r) {
in->ops->disable(in); src->ops->disable(src);
return r; return r;
} }
} }
...@@ -408,12 +403,12 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -408,12 +403,12 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)
static void tpo_td043_disable(struct omap_dss_device *dssdev) static void tpo_td043_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(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)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops->disable(in); src->ops->disable(src);
if (!ddata->spi_suspended) if (!ddata->spi_suspended)
tpo_td043_power_off(ddata); tpo_td043_power_off(ddata);
...@@ -425,11 +420,11 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev, ...@@ -425,11 +420,11 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
ddata->vm = *vm; ddata->vm = *vm;
in->ops->set_timings(in, vm); src->ops->set_timings(src, vm);
} }
static void tpo_td043_get_timings(struct omap_dss_device *dssdev, static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
...@@ -443,10 +438,9 @@ static void tpo_td043_get_timings(struct omap_dss_device *dssdev, ...@@ -443,10 +438,9 @@ static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
static int tpo_td043_check_timings(struct omap_dss_device *dssdev, static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
struct videomode *vm) struct videomode *vm)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct omap_dss_device *src = dssdev->src;
struct omap_dss_device *in = ddata->in;
return in->ops->check_timings(in, vm); return src->ops->check_timings(src, vm);
} }
static const struct omap_dss_driver tpo_td043_ops = { static const struct omap_dss_driver tpo_td043_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment