Commit b93109d7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: dss: Move common device operations to common structure

The various types of omapdss_*_ops structures define multiple operations
that are not specific to a bus type. To simplify the code and remove
dependencies on specific bus types move those operations to a common
structure. Operations that are specific to a bus type are kept in the
specialized ops structures.
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 e10bd354
...@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev) ...@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.atv->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev) ...@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.atv->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -99,9 +99,9 @@ static int tvc_enable(struct omap_dss_device *dssdev) ...@@ -99,9 +99,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.atv->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.atv->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -120,7 +120,7 @@ static void tvc_disable(struct omap_dss_device *dssdev) ...@@ -120,7 +120,7 @@ static void tvc_disable(struct omap_dss_device *dssdev)
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops.atv->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -133,7 +133,7 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, ...@@ -133,7 +133,7 @@ static void tvc_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.atv->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void tvc_get_timings(struct omap_dss_device *dssdev, static void tvc_get_timings(struct omap_dss_device *dssdev,
...@@ -150,7 +150,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev, ...@@ -150,7 +150,7 @@ static int tvc_check_timings(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 *in = ddata->in;
return in->ops.atv->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver tvc_driver = { static const struct omap_dss_driver tvc_driver = {
......
...@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev) ...@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dvi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev) ...@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dvi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -108,9 +108,9 @@ static int dvic_enable(struct omap_dss_device *dssdev) ...@@ -108,9 +108,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.dvi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dvi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -127,7 +127,7 @@ static void dvic_disable(struct omap_dss_device *dssdev) ...@@ -127,7 +127,7 @@ static void dvic_disable(struct omap_dss_device *dssdev)
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops.dvi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -140,7 +140,7 @@ static void dvic_set_timings(struct omap_dss_device *dssdev, ...@@ -140,7 +140,7 @@ static void dvic_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dvi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void dvic_get_timings(struct omap_dss_device *dssdev, static void dvic_get_timings(struct omap_dss_device *dssdev,
...@@ -157,7 +157,7 @@ static int dvic_check_timings(struct omap_dss_device *dssdev, ...@@ -157,7 +157,7 @@ static int dvic_check_timings(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 *in = ddata->in;
return in->ops.dvi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static int dvic_ddc_read(struct i2c_adapter *adapter, static int dvic_ddc_read(struct i2c_adapter *adapter,
......
...@@ -69,7 +69,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev) ...@@ -69,7 +69,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.hdmi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -89,7 +89,7 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev) ...@@ -89,7 +89,7 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.hdmi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -109,9 +109,9 @@ static int hdmic_enable(struct omap_dss_device *dssdev) ...@@ -109,9 +109,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.hdmi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.hdmi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -130,7 +130,7 @@ static void hdmic_disable(struct omap_dss_device *dssdev) ...@@ -130,7 +130,7 @@ static void hdmic_disable(struct omap_dss_device *dssdev)
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops.hdmi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -143,7 +143,7 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev, ...@@ -143,7 +143,7 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.hdmi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void hdmic_get_timings(struct omap_dss_device *dssdev, static void hdmic_get_timings(struct omap_dss_device *dssdev,
...@@ -160,7 +160,7 @@ static int hdmic_check_timings(struct omap_dss_device *dssdev, ...@@ -160,7 +160,7 @@ static int hdmic_check_timings(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 *in = ddata->in;
return in->ops.hdmi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static int hdmic_read_edid(struct omap_dss_device *dssdev, static int hdmic_read_edid(struct omap_dss_device *dssdev,
...@@ -169,7 +169,7 @@ static int hdmic_read_edid(struct omap_dss_device *dssdev, ...@@ -169,7 +169,7 @@ static int hdmic_read_edid(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 *in = ddata->in;
return in->ops.hdmi->read_edid(in, edid, len); return in->ops->hdmi.read_edid(in, edid, len);
} }
static bool hdmic_detect(struct omap_dss_device *dssdev) static bool hdmic_detect(struct omap_dss_device *dssdev)
...@@ -181,9 +181,9 @@ static bool hdmic_detect(struct omap_dss_device *dssdev) ...@@ -181,9 +181,9 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
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 = in->ops->hdmi.detect(in);
if (!connected && in->ops.hdmi->lost_hotplug) if (!connected && in->ops->hdmi.lost_hotplug)
in->ops.hdmi->lost_hotplug(in); in->ops->hdmi.lost_hotplug(in);
return connected; return connected;
} }
...@@ -201,8 +201,8 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ...@@ -201,8 +201,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 (in->ops->hdmi.register_hpd_cb) {
return in->ops.hdmi->register_hpd_cb(in, cb, cb_data); return in->ops->hdmi.register_hpd_cb(in, cb, cb_data);
} }
return -ENOTSUPP; return -ENOTSUPP;
...@@ -218,8 +218,8 @@ static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev) ...@@ -218,8 +218,8 @@ static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev)
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 (in->ops->hdmi.unregister_hpd_cb) {
in->ops.hdmi->unregister_hpd_cb(in); in->ops->hdmi.unregister_hpd_cb(in);
} }
} }
...@@ -232,8 +232,8 @@ static void hdmic_enable_hpd(struct omap_dss_device *dssdev) ...@@ -232,8 +232,8 @@ static void hdmic_enable_hpd(struct omap_dss_device *dssdev)
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 (in->ops->hdmi.enable_hpd) {
in->ops.hdmi->enable_hpd(in); in->ops->hdmi.enable_hpd(in);
} }
} }
...@@ -246,8 +246,8 @@ static void hdmic_disable_hpd(struct omap_dss_device *dssdev) ...@@ -246,8 +246,8 @@ static void hdmic_disable_hpd(struct omap_dss_device *dssdev)
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 (in->ops->hdmi.disable_hpd) {
in->ops.hdmi->disable_hpd(in); in->ops->hdmi.disable_hpd(in);
} }
} }
...@@ -256,7 +256,7 @@ static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode) ...@@ -256,7 +256,7 @@ static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
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 *in = ddata->in;
return in->ops.hdmi->set_hdmi_mode(in, hdmi_mode); return in->ops->hdmi.set_hdmi_mode(in, hdmi_mode);
} }
static int hdmic_set_infoframe(struct omap_dss_device *dssdev, static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
...@@ -265,7 +265,7 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev, ...@@ -265,7 +265,7 @@ static int hdmic_set_infoframe(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 *in = ddata->in;
return in->ops.hdmi->set_infoframe(in, avi); return in->ops->hdmi.set_infoframe(in, avi);
} }
static const struct omap_dss_driver hdmic_driver = { static const struct omap_dss_driver hdmic_driver = {
......
...@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev, ...@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.atv->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, ...@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,
dst->src = NULL; dst->src = NULL;
dssdev->dst = NULL; dssdev->dst = NULL;
in->ops.atv->disconnect(in, &ddata->dssdev); in->ops->disconnect(in, &ddata->dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -102,9 +102,9 @@ static int opa362_enable(struct omap_dss_device *dssdev) ...@@ -102,9 +102,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.atv->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.atv->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -129,7 +129,7 @@ static void opa362_disable(struct omap_dss_device *dssdev) ...@@ -129,7 +129,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.atv->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -144,7 +144,7 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, ...@@ -144,7 +144,7 @@ static void opa362_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.atv->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static int opa362_check_timings(struct omap_dss_device *dssdev, static int opa362_check_timings(struct omap_dss_device *dssdev,
...@@ -155,16 +155,14 @@ static int opa362_check_timings(struct omap_dss_device *dssdev, ...@@ -155,16 +155,14 @@ static int opa362_check_timings(struct omap_dss_device *dssdev,
dev_dbg(dssdev->dev, "check_timings\n"); dev_dbg(dssdev->dev, "check_timings\n");
return in->ops.atv->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omapdss_atv_ops opa362_atv_ops = { static const struct omap_dss_device_ops opa362_ops = {
.connect = opa362_connect, .connect = opa362_connect,
.disconnect = opa362_disconnect, .disconnect = opa362_disconnect,
.enable = opa362_enable, .enable = opa362_enable,
.disable = opa362_disable, .disable = opa362_disable,
.check_timings = opa362_check_timings, .check_timings = opa362_check_timings,
.set_timings = opa362_set_timings, .set_timings = opa362_set_timings,
}; };
...@@ -191,7 +189,7 @@ static int opa362_probe(struct platform_device *pdev) ...@@ -191,7 +189,7 @@ static int opa362_probe(struct platform_device *pdev)
ddata->enable_gpio = gpio; ddata->enable_gpio = gpio;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->ops.atv = &opa362_atv_ops; dssdev->ops = &opa362_ops;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_VENC; dssdev->type = OMAP_DISPLAY_TYPE_VENC;
dssdev->output_type = OMAP_DISPLAY_TYPE_VENC; dssdev->output_type = OMAP_DISPLAY_TYPE_VENC;
......
...@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev, ...@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, ...@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,
dst->src = NULL; dst->src = NULL;
dssdev->dst = NULL; dssdev->dst = NULL;
in->ops.dpi->disconnect(in, &ddata->dssdev); in->ops->disconnect(in, &ddata->dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -92,9 +92,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev) ...@@ -92,9 +92,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -117,7 +117,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev) ...@@ -117,7 +117,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.dpi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -138,7 +138,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, ...@@ -138,7 +138,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static int tfp410_check_timings(struct omap_dss_device *dssdev, static int tfp410_check_timings(struct omap_dss_device *dssdev,
...@@ -149,16 +149,14 @@ static int tfp410_check_timings(struct omap_dss_device *dssdev, ...@@ -149,16 +149,14 @@ static int tfp410_check_timings(struct omap_dss_device *dssdev,
tfp410_fix_timings(vm); tfp410_fix_timings(vm);
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omapdss_dvi_ops tfp410_dvi_ops = { static const struct omap_dss_device_ops tfp410_ops = {
.connect = tfp410_connect, .connect = tfp410_connect,
.disconnect = tfp410_disconnect, .disconnect = tfp410_disconnect,
.enable = tfp410_enable, .enable = tfp410_enable,
.disable = tfp410_disable, .disable = tfp410_disable,
.check_timings = tfp410_check_timings, .check_timings = tfp410_check_timings,
.set_timings = tfp410_set_timings, .set_timings = tfp410_set_timings,
}; };
...@@ -209,7 +207,7 @@ static int tfp410_probe(struct platform_device *pdev) ...@@ -209,7 +207,7 @@ static int tfp410_probe(struct platform_device *pdev)
} }
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->ops.dvi = &tfp410_dvi_ops; dssdev->ops = &tfp410_ops;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->output_type = OMAP_DISPLAY_TYPE_DVI; dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
......
...@@ -49,7 +49,7 @@ static int tpd_connect(struct omap_dss_device *dssdev, ...@@ -49,7 +49,7 @@ static int tpd_connect(struct omap_dss_device *dssdev,
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.hdmi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -85,7 +85,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, ...@@ -85,7 +85,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev,
dst->src = NULL; dst->src = NULL;
dssdev->dst = NULL; dssdev->dst = NULL;
in->ops.hdmi->disconnect(in, &ddata->dssdev); in->ops->disconnect(in, &ddata->dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -100,9 +100,9 @@ static int tpd_enable(struct omap_dss_device *dssdev) ...@@ -100,9 +100,9 @@ static int tpd_enable(struct omap_dss_device *dssdev)
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0; return 0;
in->ops.hdmi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.hdmi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -119,7 +119,7 @@ static void tpd_disable(struct omap_dss_device *dssdev) ...@@ -119,7 +119,7 @@ static void tpd_disable(struct omap_dss_device *dssdev)
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return; return;
in->ops.hdmi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -132,7 +132,7 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, ...@@ -132,7 +132,7 @@ static void tpd_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.hdmi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static int tpd_check_timings(struct omap_dss_device *dssdev, static int tpd_check_timings(struct omap_dss_device *dssdev,
...@@ -142,7 +142,7 @@ static int tpd_check_timings(struct omap_dss_device *dssdev, ...@@ -142,7 +142,7 @@ static int tpd_check_timings(struct omap_dss_device *dssdev,
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
int r; int r;
r = in->ops.hdmi->check_timings(in, vm); r = in->ops->check_timings(in, vm);
return r; return r;
} }
...@@ -156,7 +156,7 @@ static int tpd_read_edid(struct omap_dss_device *dssdev, ...@@ -156,7 +156,7 @@ static int tpd_read_edid(struct omap_dss_device *dssdev,
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 in->ops->hdmi.read_edid(in, edid, len);
} }
static bool tpd_detect(struct omap_dss_device *dssdev) static bool tpd_detect(struct omap_dss_device *dssdev)
...@@ -165,8 +165,8 @@ static bool tpd_detect(struct omap_dss_device *dssdev) ...@@ -165,8 +165,8 @@ static bool tpd_detect(struct omap_dss_device *dssdev)
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
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 && in->ops->hdmi.lost_hotplug)
in->ops.hdmi->lost_hotplug(in); in->ops->hdmi.lost_hotplug(in);
return connected; return connected;
} }
...@@ -219,7 +219,7 @@ static int tpd_set_infoframe(struct omap_dss_device *dssdev, ...@@ -219,7 +219,7 @@ static int tpd_set_infoframe(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 *in = ddata->in;
return in->ops.hdmi->set_infoframe(in, avi); return in->ops->hdmi.set_infoframe(in, avi);
} }
static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev, static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,
...@@ -228,19 +228,18 @@ static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev, ...@@ -228,19 +228,18 @@ static int tpd_set_hdmi_mode(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 *in = ddata->in;
return in->ops.hdmi->set_hdmi_mode(in, hdmi_mode); return in->ops->hdmi.set_hdmi_mode(in, hdmi_mode);
} }
static const struct omapdss_hdmi_ops tpd_hdmi_ops = { static const struct omap_dss_device_ops tpd_ops = {
.connect = tpd_connect, .connect = tpd_connect,
.disconnect = tpd_disconnect, .disconnect = tpd_disconnect,
.enable = tpd_enable, .enable = tpd_enable,
.disable = tpd_disable, .disable = tpd_disable,
.check_timings = tpd_check_timings, .check_timings = tpd_check_timings,
.set_timings = tpd_set_timings, .set_timings = tpd_set_timings,
.hdmi = {
.read_edid = tpd_read_edid, .read_edid = tpd_read_edid,
.detect = tpd_detect, .detect = tpd_detect,
.register_hpd_cb = tpd_register_hpd_cb, .register_hpd_cb = tpd_register_hpd_cb,
...@@ -249,6 +248,7 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = { ...@@ -249,6 +248,7 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
.disable_hpd = tpd_disable_hpd, .disable_hpd = tpd_disable_hpd,
.set_infoframe = tpd_set_infoframe, .set_infoframe = tpd_set_infoframe,
.set_hdmi_mode = tpd_set_hdmi_mode, .set_hdmi_mode = tpd_set_hdmi_mode,
},
}; };
static irqreturn_t tpd_hpd_isr(int irq, void *data) static irqreturn_t tpd_hpd_isr(int irq, void *data)
...@@ -315,7 +315,7 @@ static int tpd_probe(struct platform_device *pdev) ...@@ -315,7 +315,7 @@ static int tpd_probe(struct platform_device *pdev)
return r; return r;
dssdev = &ddata->dssdev; dssdev = &ddata->dssdev;
dssdev->ops.hdmi = &tpd_hdmi_ops; dssdev->ops = &tpd_ops;
dssdev->dev = &pdev->dev; dssdev->dev = &pdev->dev;
dssdev->type = OMAP_DISPLAY_TYPE_HDMI; dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI; dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
......
...@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev) ...@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev) ...@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -86,15 +86,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) ...@@ -86,15 +86,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
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.dpi->disable(in); in->ops->disable(in);
return r; return r;
} }
...@@ -119,7 +119,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) ...@@ -119,7 +119,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.dpi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -132,7 +132,7 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev, ...@@ -132,7 +132,7 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void panel_dpi_get_timings(struct omap_dss_device *dssdev, static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
...@@ -149,7 +149,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev, ...@@ -149,7 +149,7 @@ static int panel_dpi_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver panel_dpi_ops = { static const struct omap_dss_driver panel_dpi_ops = {
......
...@@ -146,7 +146,7 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) ...@@ -146,7 +146,7 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
int r; int r;
u8 buf[1]; u8 buf[1];
r = in->ops.dsi->dcs_read(in, ddata->channel, dcs_cmd, buf, 1); r = in->ops->dsi.dcs_read(in, ddata->channel, dcs_cmd, buf, 1);
if (r < 0) if (r < 0)
return r; return r;
...@@ -159,7 +159,7 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data) ...@@ -159,7 +159,7 @@ 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 *in = ddata->in;
return in->ops.dsi->dcs_write(in, ddata->channel, &dcs_cmd, 1); return in->ops->dsi.dcs_write(in, 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)
...@@ -167,7 +167,7 @@ static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param) ...@@ -167,7 +167,7 @@ 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 *in = ddata->in;
u8 buf[2] = { dcs_cmd, param }; u8 buf[2] = { dcs_cmd, param };
return in->ops.dsi->dcs_write(in, ddata->channel, buf, 2); return in->ops->dsi.dcs_write(in, ddata->channel, buf, 2);
} }
static int dsicm_sleep_in(struct panel_drv_data *ddata) static int dsicm_sleep_in(struct panel_drv_data *ddata)
...@@ -180,7 +180,7 @@ static int dsicm_sleep_in(struct panel_drv_data *ddata) ...@@ -180,7 +180,7 @@ static int dsicm_sleep_in(struct panel_drv_data *ddata)
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 = in->ops->dsi.dcs_write_nosync(in, ddata->channel, &cmd, 1);
if (r) if (r)
return r; return r;
...@@ -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 = in->ops->dsi.dcs_write_nosync(in, 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 = in->ops->dsi.dcs_write_nosync(in, ddata->channel, buf, sizeof(buf));
if (r) if (r)
return r; return r;
in->ops.dsi->bta_sync(in, ddata->channel); in->ops->dsi.bta_sync(in, ddata->channel);
return r; return r;
} }
...@@ -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); in->ops->dsi.disable(in, false, true);
ddata->ulps_enabled = true; ddata->ulps_enabled = true;
...@@ -315,13 +315,13 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata) ...@@ -315,13 +315,13 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata)
if (!ddata->ulps_enabled) if (!ddata->ulps_enabled)
return 0; return 0;
r = in->ops.dsi->enable(in); r = in->ops->enable(in);
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); in->ops->dsi.enable_hs(in, ddata->channel, true);
r = _dsicm_enable_te(ddata, true); r = _dsicm_enable_te(ddata, true);
if (r) { if (r) {
...@@ -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); in->ops->dsi.bus_lock(in);
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); in->ops->dsi.bus_unlock(in);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -421,14 +421,14 @@ static ssize_t dsicm_num_errors_show(struct device *dev, ...@@ -421,14 +421,14 @@ static ssize_t dsicm_num_errors_show(struct device *dev,
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops.dsi->bus_lock(in); in->ops->dsi.bus_lock(in);
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); in->ops->dsi.bus_unlock(in);
} else { } else {
r = -ENODEV; r = -ENODEV;
} }
...@@ -453,13 +453,13 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, ...@@ -453,13 +453,13 @@ static ssize_t dsicm_hw_revision_show(struct device *dev,
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->enabled) { if (ddata->enabled) {
in->ops.dsi->bus_lock(in); in->ops->dsi.bus_lock(in);
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); in->ops->dsi.bus_unlock(in);
} else { } else {
r = -ENODEV; r = -ENODEV;
} }
...@@ -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); in->ops->dsi.bus_lock(in);
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); in->ops->dsi.bus_unlock(in);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -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); in->ops->dsi.bus_lock(in);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
} }
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
...@@ -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 = in->ops->dsi.configure_pins(in, &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 = in->ops->dsi.set_config(in, &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.dsi->enable(in); r = in->ops->enable(in);
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); in->ops->dsi.enable_hs(in, 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 = in->ops->dsi.enable_video_output(in, 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); in->ops->dsi.enable_hs(in, 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); in->ops->dsi.disable(in, true, false);
err_vddi: err_vddi:
if (ddata->vddi) if (ddata->vddi)
regulator_disable(ddata->vddi); regulator_disable(ddata->vddi);
...@@ -725,7 +725,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata) ...@@ -725,7 +725,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
int r; int r;
in->ops.dsi->disable_video_output(in, ddata->channel); in->ops->dsi.disable_video_output(in, 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); in->ops->dsi.disable(in, true, false);
if (ddata->vddi) if (ddata->vddi)
regulator_disable(ddata->vddi); regulator_disable(ddata->vddi);
...@@ -772,19 +772,19 @@ static int dsicm_connect(struct omap_dss_device *dssdev) ...@@ -772,19 +772,19 @@ static int dsicm_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dsi->connect(in, dssdev); r = in->ops->connect(in, 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 = in->ops->dsi.request_vc(in, &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 = in->ops->dsi.set_vc_id(in, 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;
...@@ -794,9 +794,9 @@ static int dsicm_connect(struct omap_dss_device *dssdev) ...@@ -794,9 +794,9 @@ static int dsicm_connect(struct omap_dss_device *dssdev)
return 0; return 0;
err_vc_id: err_vc_id:
in->ops.dsi->release_vc(in, ddata->channel); in->ops->dsi.release_vc(in, ddata->channel);
err_req_vc: err_req_vc:
in->ops.dsi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
err_connect: err_connect:
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -810,8 +810,8 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev) ...@@ -810,8 +810,8 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dsi->release_vc(in, ddata->channel); in->ops->dsi.release_vc(in, ddata->channel);
in->ops.dsi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -837,11 +837,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev) ...@@ -837,11 +837,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev)
goto err; goto err;
} }
in->ops.dsi->bus_lock(in); in->ops->dsi.bus_lock(in);
r = dsicm_power_on(ddata); r = dsicm_power_on(ddata);
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
if (r) if (r)
goto err; goto err;
...@@ -873,7 +873,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -873,7 +873,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); in->ops->dsi.bus_lock(in);
if (omapdss_device_is_enabled(dssdev)) { if (omapdss_device_is_enabled(dssdev)) {
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
...@@ -881,7 +881,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev) ...@@ -881,7 +881,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)
dsicm_power_off(ddata); dsicm_power_off(ddata);
} }
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
...@@ -894,7 +894,7 @@ static void dsicm_framedone_cb(int err, void *data) ...@@ -894,7 +894,7 @@ static void dsicm_framedone_cb(int err, void *data)
struct omap_dss_device *in = ddata->in; struct omap_dss_device *in = ddata->in;
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); in->ops->dsi.bus_unlock(ddata->in);
} }
static irqreturn_t dsicm_te_isr(int irq, void *data) static irqreturn_t dsicm_te_isr(int irq, void *data)
...@@ -909,7 +909,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data) ...@@ -909,7 +909,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 = in->ops->dsi.update(in, ddata->channel, dsicm_framedone_cb,
ddata); ddata);
if (r) if (r)
goto err; goto err;
...@@ -918,7 +918,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data) ...@@ -918,7 +918,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); in->ops->dsi.bus_unlock(in);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -931,7 +931,7 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work) ...@@ -931,7 +931,7 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work)
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); in->ops->dsi.bus_unlock(in);
} }
static int dsicm_update(struct omap_dss_device *dssdev, static int dsicm_update(struct omap_dss_device *dssdev,
...@@ -944,7 +944,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -944,7 +944,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,
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); in->ops->dsi.bus_lock(in);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (r) if (r)
...@@ -966,7 +966,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -966,7 +966,7 @@ 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 = in->ops->dsi.update(in, ddata->channel, dsicm_framedone_cb,
ddata); ddata);
if (r) if (r)
goto err; goto err;
...@@ -976,7 +976,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, ...@@ -976,7 +976,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return 0; return 0;
err: err:
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
} }
...@@ -989,8 +989,8 @@ static int dsicm_sync(struct omap_dss_device *dssdev) ...@@ -989,8 +989,8 @@ static int dsicm_sync(struct omap_dss_device *dssdev)
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); in->ops->dsi.bus_lock(in);
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
dev_dbg(&ddata->pdev->dev, "sync done\n"); dev_dbg(&ddata->pdev->dev, "sync done\n");
...@@ -1009,7 +1009,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) ...@@ -1009,7 +1009,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); in->ops->dsi.enable_te(in, enable);
/* possible panel bug */ /* possible panel bug */
msleep(100); msleep(100);
...@@ -1028,7 +1028,7 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -1028,7 +1028,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); in->ops->dsi.bus_lock(in);
if (ddata->enabled) { if (ddata->enabled) {
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
...@@ -1042,13 +1042,13 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ...@@ -1042,13 +1042,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); in->ops->dsi.bus_unlock(in);
end: end:
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return 0; return 0;
err: err:
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
...@@ -1090,7 +1090,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1090,7 +1090,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); in->ops->dsi.bus_lock(in);
r = dsicm_wake_up(ddata); r = dsicm_wake_up(ddata);
if (r) if (r)
...@@ -1106,7 +1106,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1106,7 +1106,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 = in->ops->dsi.set_max_rx_packet_size(in, ddata->channel, plen);
if (r) if (r)
goto err2; goto err2;
...@@ -1114,7 +1114,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1114,7 +1114,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 = in->ops->dsi.dcs_read(in, ddata->channel, dcs_cmd,
buf + buf_used, size - buf_used); buf + buf_used, size - buf_used);
if (r < 0) { if (r < 0) {
...@@ -1140,9 +1140,9 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, ...@@ -1140,9 +1140,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); in->ops->dsi.set_max_rx_packet_size(in, ddata->channel, 1);
err2: err2:
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
err1: err1:
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
return r; return r;
...@@ -1162,11 +1162,11 @@ static void dsicm_ulps_work(struct work_struct *work) ...@@ -1162,11 +1162,11 @@ static void dsicm_ulps_work(struct work_struct *work)
return; return;
} }
in->ops.dsi->bus_lock(in); in->ops->dsi.bus_lock(in);
dsicm_enter_ulps(ddata); dsicm_enter_ulps(ddata);
in->ops.dsi->bus_unlock(in); in->ops->dsi.bus_unlock(in);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
} }
......
...@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev) ...@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev) ...@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -169,9 +169,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev) ...@@ -169,9 +169,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -194,7 +194,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev) ...@@ -194,7 +194,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.dpi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -207,7 +207,7 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev, ...@@ -207,7 +207,7 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void lb035q02_get_timings(struct omap_dss_device *dssdev, static void lb035q02_get_timings(struct omap_dss_device *dssdev,
...@@ -224,7 +224,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev, ...@@ -224,7 +224,7 @@ static int lb035q02_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver lb035q02_ops = { static const struct omap_dss_driver lb035q02_ops = {
......
...@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev) ...@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev) ...@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -163,9 +163,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev) ...@@ -163,9 +163,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -188,7 +188,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev) ...@@ -188,7 +188,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.dpi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -201,7 +201,7 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev, ...@@ -201,7 +201,7 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void nec_8048_get_timings(struct omap_dss_device *dssdev, static void nec_8048_get_timings(struct omap_dss_device *dssdev,
...@@ -218,7 +218,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev, ...@@ -218,7 +218,7 @@ static int nec_8048_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver nec_8048_ops = { static const struct omap_dss_driver nec_8048_ops = {
......
...@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev) ...@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev) ...@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -109,7 +109,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -109,7 +109,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
if (ddata->vcc) { if (ddata->vcc) {
r = regulator_enable(ddata->vcc); r = regulator_enable(ddata->vcc);
...@@ -117,7 +117,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev) ...@@ -117,7 +117,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)
return r; return r;
} }
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) { if (r) {
regulator_disable(ddata->vcc); regulator_disable(ddata->vcc);
return r; return r;
...@@ -155,7 +155,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev) ...@@ -155,7 +155,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)
msleep(100); msleep(100);
in->ops.dpi->disable(in); in->ops->disable(in);
if (ddata->vcc) if (ddata->vcc)
regulator_disable(ddata->vcc); regulator_disable(ddata->vcc);
...@@ -171,7 +171,7 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev, ...@@ -171,7 +171,7 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void sharp_ls_get_timings(struct omap_dss_device *dssdev, static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
...@@ -188,7 +188,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev, ...@@ -188,7 +188,7 @@ static int sharp_ls_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver sharp_ls_ops = { static const struct omap_dss_driver sharp_ls_ops = {
......
...@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev) ...@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.sdi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev) ...@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.sdi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -554,9 +554,9 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev) ...@@ -554,9 +554,9 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
dev_dbg(&ddata->spi->dev, "%s\n", __func__); dev_dbg(&ddata->spi->dev, "%s\n", __func__);
in->ops.sdi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.sdi->enable(in); r = in->ops->enable(in);
if (r) { if (r) {
pr_err("%s sdi enable failed\n", __func__); pr_err("%s sdi enable failed\n", __func__);
return r; return r;
...@@ -621,7 +621,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev) ...@@ -621,7 +621,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.sdi->disable(in); in->ops->disable(in);
} }
static int acx565akm_enable(struct omap_dss_device *dssdev) static int acx565akm_enable(struct omap_dss_device *dssdev)
...@@ -672,7 +672,7 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev, ...@@ -672,7 +672,7 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.sdi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void acx565akm_get_timings(struct omap_dss_device *dssdev, static void acx565akm_get_timings(struct omap_dss_device *dssdev,
...@@ -689,7 +689,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev, ...@@ -689,7 +689,7 @@ static int acx565akm_check_timings(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 *in = ddata->in;
return in->ops.sdi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver acx565akm_ops = { static const struct omap_dss_driver acx565akm_ops = {
......
...@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev) ...@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev) ...@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -217,9 +217,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) ...@@ -217,9 +217,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -328,7 +328,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) ...@@ -328,7 +328,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.dpi->disable(in); in->ops->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
...@@ -341,7 +341,7 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, ...@@ -341,7 +341,7 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev, static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
...@@ -358,7 +358,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev, ...@@ -358,7 +358,7 @@ static int td028ttec1_panel_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver td028ttec1_ops = { static const struct omap_dss_driver td028ttec1_ops = {
......
...@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev) ...@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)
return PTR_ERR(in); return PTR_ERR(in);
} }
r = in->ops.dpi->connect(in, dssdev); r = in->ops->connect(in, dssdev);
if (r) { if (r) {
omap_dss_put_device(in); omap_dss_put_device(in);
return r; return r;
...@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev) ...@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)
if (!omapdss_device_is_connected(dssdev)) if (!omapdss_device_is_connected(dssdev))
return; return;
in->ops.dpi->disconnect(in, dssdev); in->ops->disconnect(in, dssdev);
omap_dss_put_device(in); omap_dss_put_device(in);
ddata->in = NULL; ddata->in = NULL;
...@@ -388,9 +388,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -388,9 +388,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.dpi->set_timings(in, &ddata->vm); in->ops->set_timings(in, &ddata->vm);
r = in->ops.dpi->enable(in); r = in->ops->enable(in);
if (r) if (r)
return r; return r;
...@@ -401,7 +401,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev) ...@@ -401,7 +401,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.dpi->disable(in); in->ops->disable(in);
return r; return r;
} }
} }
...@@ -419,7 +419,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev) ...@@ -419,7 +419,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)
if (!omapdss_device_is_enabled(dssdev)) if (!omapdss_device_is_enabled(dssdev))
return; return;
in->ops.dpi->disable(in); in->ops->disable(in);
if (!ddata->spi_suspended) if (!ddata->spi_suspended)
tpo_td043_power_off(ddata); tpo_td043_power_off(ddata);
...@@ -435,7 +435,7 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev, ...@@ -435,7 +435,7 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
ddata->vm = *vm; ddata->vm = *vm;
in->ops.dpi->set_timings(in, vm); in->ops->set_timings(in, vm);
} }
static void tpo_td043_get_timings(struct omap_dss_device *dssdev, static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
...@@ -452,7 +452,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev, ...@@ -452,7 +452,7 @@ static int tpo_td043_check_timings(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 *in = ddata->in;
return in->ops.dpi->check_timings(in, vm); return in->ops->check_timings(in, vm);
} }
static const struct omap_dss_driver tpo_td043_ops = { static const struct omap_dss_driver tpo_td043_ops = {
......
...@@ -681,7 +681,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev, ...@@ -681,7 +681,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev,
dss_mgr_disconnect(&dpi->output, dssdev); dss_mgr_disconnect(&dpi->output, dssdev);
} }
static const struct omapdss_dpi_ops dpi_ops = { static const struct omap_dss_device_ops dpi_ops = {
.connect = dpi_connect, .connect = dpi_connect,
.disconnect = dpi_disconnect, .disconnect = dpi_disconnect,
...@@ -720,7 +720,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port) ...@@ -720,7 +720,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
out->output_type = OMAP_DISPLAY_TYPE_DPI; out->output_type = OMAP_DISPLAY_TYPE_DPI;
out->dispc_channel = dpi_get_channel(dpi, port_num); out->dispc_channel = dpi_get_channel(dpi, port_num);
out->port_num = port_num; out->port_num = port_num;
out->ops.dpi = &dpi_ops; out->ops = &dpi_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
...@@ -5000,14 +5000,15 @@ static void dsi_disconnect(struct omap_dss_device *dssdev, ...@@ -5000,14 +5000,15 @@ static void dsi_disconnect(struct omap_dss_device *dssdev,
dss_mgr_disconnect(&dsi->output, dssdev); dss_mgr_disconnect(&dsi->output, dssdev);
} }
static const struct omapdss_dsi_ops dsi_ops = { static const struct omap_dss_device_ops dsi_ops = {
.connect = dsi_connect, .connect = dsi_connect,
.disconnect = dsi_disconnect, .disconnect = dsi_disconnect,
.enable = dsi_display_enable,
.dsi = {
.bus_lock = dsi_bus_lock, .bus_lock = dsi_bus_lock,
.bus_unlock = dsi_bus_unlock, .bus_unlock = dsi_bus_unlock,
.enable = dsi_display_enable,
.disable = dsi_display_disable, .disable = dsi_display_disable,
.enable_hs = dsi_vc_enable_hs, .enable_hs = dsi_vc_enable_hs,
...@@ -5037,6 +5038,7 @@ static const struct omapdss_dsi_ops dsi_ops = { ...@@ -5037,6 +5038,7 @@ static const struct omapdss_dsi_ops dsi_ops = {
.bta_sync = dsi_vc_send_bta_sync, .bta_sync = dsi_vc_send_bta_sync,
.set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size, .set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size,
},
}; };
static void dsi_init_output(struct dsi_data *dsi) static void dsi_init_output(struct dsi_data *dsi)
...@@ -5050,7 +5052,7 @@ static void dsi_init_output(struct dsi_data *dsi) ...@@ -5050,7 +5052,7 @@ static void dsi_init_output(struct dsi_data *dsi)
out->output_type = OMAP_DISPLAY_TYPE_DSI; out->output_type = OMAP_DISPLAY_TYPE_DSI;
out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1"; out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1";
out->dispc_channel = dsi_get_channel(dsi); out->dispc_channel = dsi_get_channel(dsi);
out->ops.dsi = &dsi_ops; out->ops = &dsi_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
...@@ -540,7 +540,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev, ...@@ -540,7 +540,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,
return 0; return 0;
} }
static const struct omapdss_hdmi_ops hdmi_ops = { static const struct omap_dss_device_ops hdmi_ops = {
.connect = hdmi_connect, .connect = hdmi_connect,
.disconnect = hdmi_disconnect, .disconnect = hdmi_disconnect,
...@@ -550,10 +550,12 @@ static const struct omapdss_hdmi_ops hdmi_ops = { ...@@ -550,10 +550,12 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
.check_timings = hdmi_display_check_timing, .check_timings = hdmi_display_check_timing,
.set_timings = hdmi_display_set_timing, .set_timings = hdmi_display_set_timing,
.hdmi = {
.read_edid = hdmi_read_edid, .read_edid = hdmi_read_edid,
.lost_hotplug = hdmi_lost_hotplug, .lost_hotplug = hdmi_lost_hotplug,
.set_infoframe = hdmi_set_infoframe, .set_infoframe = hdmi_set_infoframe,
.set_hdmi_mode = hdmi_set_hdmi_mode, .set_hdmi_mode = hdmi_set_hdmi_mode,
},
}; };
static void hdmi_init_output(struct omap_hdmi *hdmi) static void hdmi_init_output(struct omap_hdmi *hdmi)
...@@ -565,7 +567,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) ...@@ -565,7 +567,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi)
out->output_type = OMAP_DISPLAY_TYPE_HDMI; out->output_type = OMAP_DISPLAY_TYPE_HDMI;
out->name = "hdmi.0"; out->name = "hdmi.0";
out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
out->ops.hdmi = &hdmi_ops; out->ops = &hdmi_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
...@@ -532,7 +532,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev, ...@@ -532,7 +532,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,
return 0; return 0;
} }
static const struct omapdss_hdmi_ops hdmi_ops = { static const struct omap_dss_device_ops hdmi_ops = {
.connect = hdmi_connect, .connect = hdmi_connect,
.disconnect = hdmi_disconnect, .disconnect = hdmi_disconnect,
...@@ -542,9 +542,11 @@ static const struct omapdss_hdmi_ops hdmi_ops = { ...@@ -542,9 +542,11 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
.check_timings = hdmi_display_check_timing, .check_timings = hdmi_display_check_timing,
.set_timings = hdmi_display_set_timing, .set_timings = hdmi_display_set_timing,
.hdmi = {
.read_edid = hdmi_read_edid, .read_edid = hdmi_read_edid,
.set_infoframe = hdmi_set_infoframe, .set_infoframe = hdmi_set_infoframe,
.set_hdmi_mode = hdmi_set_hdmi_mode, .set_hdmi_mode = hdmi_set_hdmi_mode,
},
}; };
static void hdmi_init_output(struct omap_hdmi *hdmi) static void hdmi_init_output(struct omap_hdmi *hdmi)
...@@ -556,7 +558,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) ...@@ -556,7 +558,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi)
out->output_type = OMAP_DISPLAY_TYPE_HDMI; out->output_type = OMAP_DISPLAY_TYPE_HDMI;
out->name = "hdmi.0"; out->name = "hdmi.0";
out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
out->ops.hdmi = &hdmi_ops; out->ops = &hdmi_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
...@@ -296,80 +296,7 @@ struct omap_dss_writeback_info { ...@@ -296,80 +296,7 @@ struct omap_dss_writeback_info {
u8 pre_mult_alpha; u8 pre_mult_alpha;
}; };
struct omapdss_dpi_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
};
struct omapdss_sdi_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
};
struct omapdss_dvi_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
};
struct omapdss_atv_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
};
struct omapdss_hdmi_ops { struct omapdss_hdmi_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len); int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
void (*lost_hotplug)(struct omap_dss_device *dssdev); void (*lost_hotplug)(struct omap_dss_device *dssdev);
bool (*detect)(struct omap_dss_device *dssdev); bool (*detect)(struct omap_dss_device *dssdev);
...@@ -388,12 +315,6 @@ struct omapdss_hdmi_ops { ...@@ -388,12 +315,6 @@ struct omapdss_hdmi_ops {
}; };
struct omapdss_dsi_ops { struct omapdss_dsi_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev, bool disconnect_lanes, void (*disable)(struct omap_dss_device *dssdev, bool disconnect_lanes,
bool enter_ulps); bool enter_ulps);
...@@ -444,6 +365,26 @@ struct omapdss_dsi_ops { ...@@ -444,6 +365,26 @@ struct omapdss_dsi_ops {
int channel, u16 plen); int channel, u16 plen);
}; };
struct omap_dss_device_ops {
int (*connect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
void (*set_timings)(struct omap_dss_device *dssdev,
struct videomode *vm);
union {
const struct omapdss_hdmi_ops hdmi;
const struct omapdss_dsi_ops dsi;
};
};
struct omap_dss_device { struct omap_dss_device {
struct kobject kobj; struct kobject kobj;
struct device *dev; struct device *dev;
...@@ -461,15 +402,7 @@ struct omap_dss_device { ...@@ -461,15 +402,7 @@ struct omap_dss_device {
const char *name; const char *name;
const struct omap_dss_driver *driver; const struct omap_dss_driver *driver;
const struct omap_dss_device_ops *ops;
union {
const struct omapdss_dpi_ops *dpi;
const struct omapdss_sdi_ops *sdi;
const struct omapdss_dvi_ops *dvi;
const struct omapdss_hdmi_ops *hdmi;
const struct omapdss_atv_ops *atv;
const struct omapdss_dsi_ops *dsi;
} ops;
/* helper variable for driver suspend/resume */ /* helper variable for driver suspend/resume */
bool activate_after_resume; bool activate_after_resume;
......
...@@ -311,7 +311,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev, ...@@ -311,7 +311,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev,
dss_mgr_disconnect(&sdi->output, dssdev); dss_mgr_disconnect(&sdi->output, dssdev);
} }
static const struct omapdss_sdi_ops sdi_ops = { static const struct omap_dss_device_ops sdi_ops = {
.connect = sdi_connect, .connect = sdi_connect,
.disconnect = sdi_disconnect, .disconnect = sdi_disconnect,
...@@ -333,7 +333,7 @@ static void sdi_init_output(struct sdi_device *sdi) ...@@ -333,7 +333,7 @@ static void sdi_init_output(struct sdi_device *sdi)
out->dispc_channel = OMAP_DSS_CHANNEL_LCD; out->dispc_channel = OMAP_DSS_CHANNEL_LCD;
/* We have SDI only on OMAP3, where it's on port 1 */ /* We have SDI only on OMAP3, where it's on port 1 */
out->port_num = 1; out->port_num = 1;
out->ops.sdi = &sdi_ops; out->ops = &sdi_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
...@@ -750,7 +750,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev, ...@@ -750,7 +750,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev,
dss_mgr_disconnect(&venc->output, dssdev); dss_mgr_disconnect(&venc->output, dssdev);
} }
static const struct omapdss_atv_ops venc_ops = { static const struct omap_dss_device_ops venc_ops = {
.connect = venc_connect, .connect = venc_connect,
.disconnect = venc_disconnect, .disconnect = venc_disconnect,
...@@ -770,7 +770,7 @@ static void venc_init_output(struct venc_device *venc) ...@@ -770,7 +770,7 @@ static void venc_init_output(struct venc_device *venc)
out->output_type = OMAP_DISPLAY_TYPE_VENC; out->output_type = OMAP_DISPLAY_TYPE_VENC;
out->name = "venc.0"; out->name = "venc.0";
out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
out->ops.atv = &venc_ops; out->ops = &venc_ops;
out->owner = THIS_MODULE; out->owner = THIS_MODULE;
omapdss_register_output(out); omapdss_register_output(out);
......
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