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 = {
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,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;
...@@ -142,11 +141,11 @@ static void hw_guard_wait(struct panel_drv_data *ddata) ...@@ -142,11 +141,11 @@ static void hw_guard_wait(struct panel_drv_data *ddata)
static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
u8 buf[1]; u8 buf[1];
r = in->ops->dsi.dcs_read(in, ddata->channel, dcs_cmd, buf, 1); r = src->ops->dsi.dcs_read(src, ddata->channel, dcs_cmd, buf, 1);
if (r < 0) if (r < 0)
return r; return r;
...@@ -158,29 +157,30 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) ...@@ -158,29 +157,30 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd) static int dsicm_dcs_write_0(struct panel_drv_data *ddata, u8 dcs_cmd)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
return in->ops->dsi.dcs_write(in, ddata->channel, &dcs_cmd, 1);
return src->ops->dsi.dcs_write(src, ddata->channel, &dcs_cmd, 1);
} }
static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
u8 buf[2] = { dcs_cmd, param }; u8 buf[2] = { dcs_cmd, param };
return in->ops->dsi.dcs_write(in, ddata->channel, buf, 2); return src->ops->dsi.dcs_write(src, ddata->channel, buf, 2);
} }
static int dsicm_sleep_in(struct panel_drv_data *ddata) static int dsicm_sleep_in(struct panel_drv_data *ddata)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
u8 cmd; u8 cmd;
int r; int r;
hw_guard_wait(ddata); hw_guard_wait(ddata);
cmd = MIPI_DCS_ENTER_SLEEP_MODE; cmd = MIPI_DCS_ENTER_SLEEP_MODE;
r = in->ops->dsi.dcs_write_nosync(in, ddata->channel, &cmd, 1); r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, &cmd, 1);
if (r) if (r)
return r; return r;
...@@ -228,7 +228,7 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3) ...@@ -228,7 +228,7 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3)
static int dsicm_set_update_window(struct panel_drv_data *ddata, static int dsicm_set_update_window(struct panel_drv_data *ddata,
u16 x, u16 y, u16 w, u16 h) u16 x, u16 y, u16 w, u16 h)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
u16 x1 = x; u16 x1 = x;
u16 x2 = x + w - 1; u16 x2 = x + w - 1;
...@@ -242,7 +242,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, ...@@ -242,7 +242,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata,
buf[3] = (x2 >> 8) & 0xff; buf[3] = (x2 >> 8) & 0xff;
buf[4] = (x2 >> 0) & 0xff; buf[4] = (x2 >> 0) & 0xff;
r = in->ops->dsi.dcs_write_nosync(in, ddata->channel, buf, sizeof(buf)); r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf));
if (r) if (r)
return r; return r;
...@@ -252,11 +252,11 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, ...@@ -252,11 +252,11 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata,
buf[3] = (y2 >> 8) & 0xff; buf[3] = (y2 >> 8) & 0xff;
buf[4] = (y2 >> 0) & 0xff; buf[4] = (y2 >> 0) & 0xff;
r = in->ops->dsi.dcs_write_nosync(in, ddata->channel, buf, sizeof(buf)); r = src->ops->dsi.dcs_write_nosync(src, ddata->channel, buf, sizeof(buf));
if (r) if (r)
return r; return r;
in->ops->dsi.bta_sync(in, ddata->channel); src->ops->dsi.bta_sync(src, ddata->channel);
return r; return r;
} }
...@@ -275,7 +275,7 @@ static void dsicm_cancel_ulps_work(struct panel_drv_data *ddata) ...@@ -275,7 +275,7 @@ static void dsicm_cancel_ulps_work(struct panel_drv_data *ddata)
static int dsicm_enter_ulps(struct panel_drv_data *ddata) static int dsicm_enter_ulps(struct panel_drv_data *ddata)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
if (ddata->ulps_enabled) if (ddata->ulps_enabled)
...@@ -290,7 +290,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) ...@@ -290,7 +290,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)
if (ddata->ext_te_gpio) if (ddata->ext_te_gpio)
disable_irq(gpiod_to_irq(ddata->ext_te_gpio)); disable_irq(gpiod_to_irq(ddata->ext_te_gpio));
in->ops->dsi.disable(in, false, true); src->ops->dsi.disable(src, false, true);
ddata->ulps_enabled = true; ddata->ulps_enabled = true;
...@@ -309,19 +309,19 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata) ...@@ -309,19 +309,19 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)
static int dsicm_exit_ulps(struct panel_drv_data *ddata) static int dsicm_exit_ulps(struct panel_drv_data *ddata)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
if (!ddata->ulps_enabled) if (!ddata->ulps_enabled)
return 0; return 0;
r = in->ops->enable(in); r = src->ops->enable(src);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, "failed to enable DSI\n"); dev_err(&ddata->pdev->dev, "failed to enable DSI\n");
goto err1; goto err1;
} }
in->ops->dsi.enable_hs(in, ddata->channel, true); src->ops->dsi.enable_hs(src, ddata->channel, true);
r = _dsicm_enable_te(ddata, true); r = _dsicm_enable_te(ddata, true);
if (r) { if (r) {
...@@ -366,7 +366,7 @@ static int dsicm_wake_up(struct panel_drv_data *ddata) ...@@ -366,7 +366,7 @@ static int dsicm_wake_up(struct panel_drv_data *ddata)
static int dsicm_bl_update_status(struct backlight_device *dev) static int dsicm_bl_update_status(struct backlight_device *dev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev); struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r = 0; int r = 0;
int level; int level;
...@@ -381,13 +381,13 @@ static int dsicm_bl_update_status(struct backlight_device *dev) ...@@ -381,13 +381,13 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (!r) if (!r)
r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level); r = dsicm_dcs_write_1(ddata, DCS_BRIGHTNESS, level);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -414,21 +414,21 @@ static ssize_t dsicm_num_errors_show(struct device *dev, ...@@ -414,21 +414,21 @@ static ssize_t dsicm_num_errors_show(struct device *dev,
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
u8 errors = 0; u8 errors = 0;
int r; int r;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (!r) if (!r)
r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS, r = dsicm_dcs_read_1(ddata, DCS_READ_NUM_ERRORS,
&errors); &errors);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} else { } else {
r = -ENODEV; r = -ENODEV;
} }
...@@ -446,20 +446,20 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, ...@@ -446,20 +446,20 @@ static ssize_t dsicm_hw_revision_show(struct device *dev,
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
u8 id1, id2, id3; u8 id1, id2, id3;
int r; int r;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (!r) if (!r)
r = dsicm_get_id(ddata, &id1, &id2, &id3); r = dsicm_get_id(ddata, &id1, &id2, &id3);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} else { } else {
r = -ENODEV; r = -ENODEV;
} }
...@@ -478,7 +478,7 @@ static ssize_t dsicm_store_ulps(struct device *dev, ...@@ -478,7 +478,7 @@ static ssize_t dsicm_store_ulps(struct device *dev,
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
unsigned long t; unsigned long t;
int r; int r;
...@@ -489,14 +489,14 @@ static ssize_t dsicm_store_ulps(struct device *dev, ...@@ -489,14 +489,14 @@ static ssize_t dsicm_store_ulps(struct device *dev,
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
if (t) if (t)
r = dsicm_enter_ulps(ddata); r = dsicm_enter_ulps(ddata);
else else
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -528,7 +528,7 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, ...@@ -528,7 +528,7 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev,
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
unsigned long t; unsigned long t;
int r; int r;
...@@ -541,9 +541,9 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, ...@@ -541,9 +541,9 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev,
if (ddata->enabled) { if (ddata->enabled) {
/* dsicm_wake_up will restart the timer */ /* dsicm_wake_up will restart the timer */
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -603,7 +603,7 @@ static void dsicm_hw_reset(struct panel_drv_data *ddata) ...@@ -603,7 +603,7 @@ static void dsicm_hw_reset(struct panel_drv_data *ddata)
static int dsicm_power_on(struct panel_drv_data *ddata) static int dsicm_power_on(struct panel_drv_data *ddata)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
u8 id1, id2, id3; u8 id1, id2, id3;
int r; int r;
struct omap_dss_dsi_config dsi_config = { struct omap_dss_dsi_config dsi_config = {
...@@ -635,7 +635,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -635,7 +635,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
} }
if (ddata->pin_config.num_pins > 0) { if (ddata->pin_config.num_pins > 0) {
r = in->ops->dsi.configure_pins(in, &ddata->pin_config); r = src->ops->dsi.configure_pins(src, &ddata->pin_config);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, dev_err(&ddata->pdev->dev,
"failed to configure DSI pins\n"); "failed to configure DSI pins\n");
...@@ -643,13 +643,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -643,13 +643,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
} }
} }
r = in->ops->dsi.set_config(in, &dsi_config); r = src->ops->dsi.set_config(src, &dsi_config);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, "failed to configure DSI\n"); dev_err(&ddata->pdev->dev, "failed to configure DSI\n");
goto err_vddi; goto err_vddi;
} }
r = in->ops->enable(in); r = src->ops->enable(src);
if (r) { if (r) {
dev_err(&ddata->pdev->dev, "failed to enable DSI\n"); dev_err(&ddata->pdev->dev, "failed to enable DSI\n");
goto err_vddi; goto err_vddi;
...@@ -657,7 +657,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -657,7 +657,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
in->ops->dsi.enable_hs(in, ddata->channel, false); src->ops->dsi.enable_hs(src, ddata->channel, false);
r = dsicm_sleep_out(ddata); r = dsicm_sleep_out(ddata);
if (r) if (r)
...@@ -689,7 +689,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -689,7 +689,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
if (r) if (r)
goto err; goto err;
r = in->ops->dsi.enable_video_output(in, ddata->channel); r = src->ops->dsi.enable_video_output(src, ddata->channel);
if (r) if (r)
goto err; goto err;
...@@ -701,7 +701,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -701,7 +701,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
ddata->intro_printed = true; ddata->intro_printed = true;
} }
in->ops->dsi.enable_hs(in, ddata->channel, true); src->ops->dsi.enable_hs(src, ddata->channel, true);
return 0; return 0;
err: err:
...@@ -709,7 +709,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -709,7 +709,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
in->ops->dsi.disable(in, true, false); src->ops->dsi.disable(src, true, false);
err_vddi: err_vddi:
if (ddata->vddi) if (ddata->vddi)
regulator_disable(ddata->vddi); regulator_disable(ddata->vddi);
...@@ -722,10 +722,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ...@@ -722,10 +722,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata)
static void dsicm_power_off(struct panel_drv_data *ddata) static void dsicm_power_off(struct panel_drv_data *ddata)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
in->ops->dsi.disable_video_output(in, ddata->channel); src->ops->dsi.disable_video_output(src, ddata->channel);
r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_DISPLAY_OFF); r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_DISPLAY_OFF);
if (!r) if (!r)
...@@ -737,7 +737,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata) ...@@ -737,7 +737,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)
dsicm_hw_reset(ddata); dsicm_hw_reset(ddata);
} }
in->ops->dsi.disable(in, true, false); src->ops->dsi.disable(src, true, false);
if (ddata->vddi) if (ddata->vddi)
regulator_disable(ddata->vddi); regulator_disable(ddata->vddi);
...@@ -760,61 +760,59 @@ static int dsicm_connect(struct omap_dss_device *dssdev) ...@@ -760,61 +760,59 @@ static int dsicm_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 device *dev = &ddata->pdev->dev; struct device *dev = &ddata->pdev->dev;
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) {
dev_err(dev, "Failed to connect to video source\n"); dev_err(dev, "Failed to connect to video source\n");
goto err_connect; goto err_connect;
} }
r = in->ops->dsi.request_vc(in, &ddata->channel); r = src->ops->dsi.request_vc(src, &ddata->channel);
if (r) { if (r) {
dev_err(dev, "failed to get virtual channel\n"); dev_err(dev, "failed to get virtual channel\n");
goto err_req_vc; goto err_req_vc;
} }
r = in->ops->dsi.set_vc_id(in, ddata->channel, TCH); r = src->ops->dsi.set_vc_id(src, ddata->channel, TCH);
if (r) { if (r) {
dev_err(dev, "failed to set VC_ID\n"); dev_err(dev, "failed to set VC_ID\n");
goto err_vc_id; goto err_vc_id;
} }
ddata->in = in;
return 0; return 0;
err_vc_id: err_vc_id:
in->ops->dsi.release_vc(in, ddata->channel); src->ops->dsi.release_vc(src, ddata->channel);
err_req_vc: err_req_vc:
omapdss_device_disconnect(in, dssdev); omapdss_device_disconnect(src, dssdev);
err_connect: err_connect:
omap_dss_put_device(in); omap_dss_put_device(src);
return r; return r;
} }
static void dsicm_disconnect(struct omap_dss_device *dssdev) static void dsicm_disconnect(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;
in->ops->dsi.release_vc(in, ddata->channel); src->ops->dsi.release_vc(src, ddata->channel);
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 dsicm_enable(struct omap_dss_device *dssdev) static int dsicm_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->pdev->dev, "enable\n"); dev_dbg(&ddata->pdev->dev, "enable\n");
...@@ -831,11 +829,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev) ...@@ -831,11 +829,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev)
goto err; goto err;
} }
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_power_on(ddata); r = dsicm_power_on(ddata);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
if (r) if (r)
goto err; goto err;
...@@ -856,7 +854,7 @@ static int dsicm_enable(struct omap_dss_device *dssdev) ...@@ -856,7 +854,7 @@ static int dsicm_enable(struct omap_dss_device *dssdev)
static void dsicm_disable(struct omap_dss_device *dssdev) static void dsicm_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;
int r; int r;
dev_dbg(&ddata->pdev->dev, "disable\n"); dev_dbg(&ddata->pdev->dev, "disable\n");
...@@ -867,7 +865,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -867,7 +865,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
dsicm_cancel_ulps_work(ddata); dsicm_cancel_ulps_work(ddata);
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
if (omapdss_device_is_enabled(dssdev)) { if (omapdss_device_is_enabled(dssdev)) {
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
...@@ -875,7 +873,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -875,7 +873,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
dsicm_power_off(ddata); dsicm_power_off(ddata);
} }
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
...@@ -885,16 +883,16 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -885,16 +883,16 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
static void dsicm_framedone_cb(int err, void *data) static void dsicm_framedone_cb(int err, void *data)
{ {
struct panel_drv_data *ddata = data; struct panel_drv_data *ddata = data;
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
dev_dbg(&ddata->pdev->dev, "framedone, err %d\n", err); dev_dbg(&ddata->pdev->dev, "framedone, err %d\n", err);
in->ops->dsi.bus_unlock(ddata->in); src->ops->dsi.bus_unlock(src);
} }
static irqreturn_t dsicm_te_isr(int irq, void *data) static irqreturn_t dsicm_te_isr(int irq, void *data)
{ {
struct panel_drv_data *ddata = data; struct panel_drv_data *ddata = data;
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int old; int old;
int r; int r;
...@@ -903,7 +901,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data) ...@@ -903,7 +901,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)
if (old) { if (old) {
cancel_delayed_work(&ddata->te_timeout_work); cancel_delayed_work(&ddata->te_timeout_work);
r = in->ops->dsi.update(in, ddata->channel, dsicm_framedone_cb, r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb,
ddata); ddata);
if (r) if (r)
goto err; goto err;
...@@ -912,7 +910,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data) ...@@ -912,7 +910,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
err: err:
dev_err(&ddata->pdev->dev, "start update failed\n"); dev_err(&ddata->pdev->dev, "start update failed\n");
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -920,25 +918,25 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work) ...@@ -920,25 +918,25 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work)
{ {
struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, struct panel_drv_data *ddata = container_of(work, struct panel_drv_data,
te_timeout_work.work); te_timeout_work.work);
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
dev_err(&ddata->pdev->dev, "TE not received for 250ms!\n"); dev_err(&ddata->pdev->dev, "TE not received for 250ms!\n");
atomic_set(&ddata->do_update, 0); atomic_set(&ddata->do_update, 0);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
} }
static int dsicm_update(struct omap_dss_device *dssdev, static int dsicm_update(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h) u16 x, u16 y, u16 w, u16 h)
{ {
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->pdev->dev, "update %d, %d, %d x %d\n", x, y, w, h); dev_dbg(&ddata->pdev->dev, "update %d, %d, %d x %d\n", x, y, w, h);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (r) if (r)
...@@ -960,17 +958,17 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -960,17 +958,17 @@ static int dsicm_update(struct omap_dss_device *dssdev,
msecs_to_jiffies(250)); msecs_to_jiffies(250));
atomic_set(&ddata->do_update, 1); atomic_set(&ddata->do_update, 1);
} else { } else {
r = in->ops->dsi.update(in, ddata->channel, dsicm_framedone_cb, r = src->ops->dsi.update(src, ddata->channel, dsicm_framedone_cb,
ddata); ddata);
if (r) if (r)
goto err; goto err;
} }
/* note: no bus_unlock here. unlock is in framedone_cb */ /* note: no bus_unlock here. unlock is src framedone_cb */
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return 0; return 0;
err: err:
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
} }
...@@ -978,13 +976,13 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -978,13 +976,13 @@ static int dsicm_update(struct omap_dss_device *dssdev,
static int dsicm_sync(struct omap_dss_device *dssdev) static int dsicm_sync(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->pdev->dev, "sync\n"); dev_dbg(&ddata->pdev->dev, "sync\n");
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
dev_dbg(&ddata->pdev->dev, "sync done\n"); dev_dbg(&ddata->pdev->dev, "sync done\n");
...@@ -994,7 +992,7 @@ static int dsicm_sync(struct omap_dss_device *dssdev) ...@@ -994,7 +992,7 @@ static int dsicm_sync(struct omap_dss_device *dssdev)
static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)
{ {
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = ddata->dssdev.src;
int r; int r;
if (enable) if (enable)
...@@ -1003,7 +1001,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) ...@@ -1003,7 +1001,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)
r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_TEAR_OFF); r = dsicm_dcs_write_0(ddata, MIPI_DCS_SET_TEAR_OFF);
if (!ddata->ext_te_gpio) if (!ddata->ext_te_gpio)
in->ops->dsi.enable_te(in, enable); src->ops->dsi.enable_te(src, enable);
/* possible panel bug */ /* possible panel bug */
msleep(100); msleep(100);
...@@ -1014,7 +1012,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) ...@@ -1014,7 +1012,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)
static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)
{ {
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;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -1022,7 +1020,7 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -1022,7 +1020,7 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)
if (ddata->te_enabled == enable) if (ddata->te_enabled == enable)
goto end; goto end;
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
if (ddata->enabled) { if (ddata->enabled) {
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
...@@ -1036,13 +1034,13 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -1036,13 +1034,13 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)
ddata->te_enabled = enable; ddata->te_enabled = enable;
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
end: end:
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return 0; return 0;
err: err:
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
...@@ -1065,7 +1063,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1065,7 +1063,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h) u16 x, u16 y, u16 w, u16 h)
{ {
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;
int first = 1; int first = 1;
int plen; int plen;
...@@ -1084,7 +1082,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1084,7 +1082,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
size = min((u32)w * h * 3, size = min((u32)w * h * 3,
ddata->vm.hactive * ddata->vm.vactive * 3); ddata->vm.hactive * ddata->vm.vactive * 3);
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (r) if (r)
...@@ -1100,7 +1098,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1100,7 +1098,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
dsicm_set_update_window(ddata, x, y, w, h); dsicm_set_update_window(ddata, x, y, w, h);
r = in->ops->dsi.set_max_rx_packet_size(in, ddata->channel, plen); r = src->ops->dsi.set_max_rx_packet_size(src, ddata->channel, plen);
if (r) if (r)
goto err2; goto err2;
...@@ -1108,7 +1106,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1108,7 +1106,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
u8 dcs_cmd = first ? 0x2e : 0x3e; u8 dcs_cmd = first ? 0x2e : 0x3e;
first = 0; first = 0;
r = in->ops->dsi.dcs_read(in, ddata->channel, dcs_cmd, r = src->ops->dsi.dcs_read(src, ddata->channel, dcs_cmd,
buf + buf_used, size - buf_used); buf + buf_used, size - buf_used);
if (r < 0) { if (r < 0) {
...@@ -1134,9 +1132,9 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1134,9 +1132,9 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,
r = buf_used; r = buf_used;
err3: err3:
in->ops->dsi.set_max_rx_packet_size(in, ddata->channel, 1); src->ops->dsi.set_max_rx_packet_size(src, ddata->channel, 1);
err2: err2:
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
err1: err1:
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
...@@ -1147,7 +1145,7 @@ static void dsicm_ulps_work(struct work_struct *work) ...@@ -1147,7 +1145,7 @@ static void dsicm_ulps_work(struct work_struct *work)
struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, struct panel_drv_data *ddata = container_of(work, struct panel_drv_data,
ulps_work.work); ulps_work.work);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
struct omap_dss_device *in = ddata->in; struct omap_dss_device *src = dssdev->src;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -1156,11 +1154,11 @@ static void dsicm_ulps_work(struct work_struct *work) ...@@ -1156,11 +1154,11 @@ static void dsicm_ulps_work(struct work_struct *work)
return; return;
} }
in->ops->dsi.bus_lock(in); src->ops->dsi.bus_lock(src);
dsicm_enter_ulps(ddata); dsicm_enter_ulps(ddata);
in->ops->dsi.bus_unlock(in); src->ops->dsi.bus_unlock(src);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
} }
......
...@@ -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