Commit ecc8b370 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: Add panel dev pointer to dssdev

We are about to remove the dss bus support, which also means that the
omap_dss_device won't be a real device anymore. This means that the
embedded "dev" struct needs to be removed from omap_dss_device.

After we've finished the removal of the dss bus, we see the following
changes:

- struct omap_dss_device won't be a real Linux device anymore, but more
  like a "display entity".
- struct omap_dss_driver won't be a Linux device driver, but "display
  entity ops".
- The panel devices/drivers won't be omapdss devices/drivers, but
  platform/i2c/spi/etc devices/drivers, whichever fits the control
  mechanism of the panel.
- The panel drivers will create omap_dss_device and omap_dss_driver,
  fill the required fields, and register the omap_dss_device to
  omapdss.
- omap_dss_device won't have an embedded dev struct anymore, but a
  dev pointer to the actual device that manages the omap_dss_device.

The model described above resembles the model that has been discussed
with CDF (common display framework).

For the duration of the conversion, we temporarily have two devs in the
dssdev, the old "old_dev", which is a full embedded device struct, and the
new "dev", which is a pointer to the device. "old_dev" will be removed
in the future.

For devices belonging to dss bus the dev is initialized to point to
old_dev. This way all the code can just use the dev, for both old and
new style panels.

Both the new and old style panel drivers work during the conversion, and
only after the dss bus support is removed will the old style panels stop
to compile.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 94140f0d
...@@ -510,7 +510,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev) ...@@ -510,7 +510,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
int max_brightness, brightness; int max_brightness, brightness;
struct backlight_properties props; struct backlight_properties props;
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
if (!panel_data) if (!panel_data)
return -EINVAL; return -EINVAL;
...@@ -519,7 +519,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev) ...@@ -519,7 +519,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = acx_panel_timings; dssdev->panel.timings = acx_panel_timings;
if (gpio_is_valid(panel_data->reset_gpio)) { if (gpio_is_valid(panel_data->reset_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, panel_data->reset_gpio, r = devm_gpio_request_one(dssdev->dev, panel_data->reset_gpio,
GPIOF_OUT_INIT_LOW, "lcd reset"); GPIOF_OUT_INIT_LOW, "lcd reset");
if (r) if (r)
return r; return r;
...@@ -538,7 +538,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev) ...@@ -538,7 +538,7 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
r = panel_detect(md); r = panel_detect(md);
if (r) { if (r) {
dev_err(&dssdev->dev, "%s panel detect error\n", __func__); dev_err(dssdev->dev, "%s panel detect error\n", __func__);
if (!md->enabled && gpio_is_valid(panel_data->reset_gpio)) if (!md->enabled && gpio_is_valid(panel_data->reset_gpio))
gpio_set_value(panel_data->reset_gpio, 0); gpio_set_value(panel_data->reset_gpio, 0);
...@@ -593,7 +593,7 @@ static void acx_panel_remove(struct omap_dss_device *dssdev) ...@@ -593,7 +593,7 @@ static void acx_panel_remove(struct omap_dss_device *dssdev)
{ {
struct acx565akm_device *md = &acx_dev; struct acx565akm_device *md = &acx_dev;
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group); sysfs_remove_group(&md->bl_dev->dev.kobj, &bldev_attr_group);
backlight_device_unregister(md->bl_dev); backlight_device_unregister(md->bl_dev);
mutex_lock(&acx_dev.mutex); mutex_lock(&acx_dev.mutex);
...@@ -607,7 +607,7 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev) ...@@ -607,7 +607,7 @@ static int acx_panel_power_on(struct omap_dss_device *dssdev)
struct panel_acx565akm_data *panel_data = get_panel_data(dssdev); struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
int r; int r;
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
return 0; return 0;
...@@ -667,7 +667,7 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev) ...@@ -667,7 +667,7 @@ static void acx_panel_power_off(struct omap_dss_device *dssdev)
struct acx565akm_device *md = &acx_dev; struct acx565akm_device *md = &acx_dev;
struct panel_acx565akm_data *panel_data = get_panel_data(dssdev); struct panel_acx565akm_data *panel_data = get_panel_data(dssdev);
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return; return;
...@@ -704,7 +704,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev) ...@@ -704,7 +704,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev)
{ {
int r; int r;
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
r = acx_panel_power_on(dssdev); r = acx_panel_power_on(dssdev);
if (r) if (r)
...@@ -716,7 +716,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev) ...@@ -716,7 +716,7 @@ static int acx_panel_enable(struct omap_dss_device *dssdev)
static void acx_panel_disable(struct omap_dss_device *dssdev) static void acx_panel_disable(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "%s\n", __func__); dev_dbg(dssdev->dev, "%s\n", __func__);
acx_panel_power_off(dssdev); acx_panel_power_off(dssdev);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
} }
......
...@@ -536,7 +536,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev) ...@@ -536,7 +536,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
{ {
int r, i; int r, i;
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev); struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
struct panel_config *panel_config = drv_data->panel_config; struct panel_config *panel_config = drv_data->panel_config;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
...@@ -567,7 +567,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev) ...@@ -567,7 +567,7 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev) static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev)
{ {
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev); struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
struct panel_config *panel_config = drv_data->panel_config; struct panel_config *panel_config = drv_data->panel_config;
int i; int i;
...@@ -593,7 +593,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) ...@@ -593,7 +593,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
struct panel_drv_data *drv_data = NULL; struct panel_drv_data *drv_data = NULL;
int i, r; int i, r;
dev_dbg(&dssdev->dev, "probe\n"); dev_dbg(dssdev->dev, "probe\n");
if (!panel_data || !panel_data->name) if (!panel_data || !panel_data->name)
return -EINVAL; return -EINVAL;
...@@ -609,7 +609,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) ...@@ -609,7 +609,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
return -EINVAL; return -EINVAL;
for (i = 0; i < panel_data->num_gpios; ++i) { for (i = 0; i < panel_data->num_gpios; ++i) {
r = devm_gpio_request_one(&dssdev->dev, panel_data->gpios[i], r = devm_gpio_request_one(dssdev->dev, panel_data->gpios[i],
panel_data->gpio_invert[i] ? panel_data->gpio_invert[i] ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
"panel gpio"); "panel gpio");
...@@ -619,7 +619,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) ...@@ -619,7 +619,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = panel_config->timings; dssdev->panel.timings = panel_config->timings;
drv_data = devm_kzalloc(&dssdev->dev, sizeof(*drv_data), GFP_KERNEL); drv_data = devm_kzalloc(dssdev->dev, sizeof(*drv_data), GFP_KERNEL);
if (!drv_data) if (!drv_data)
return -ENOMEM; return -ENOMEM;
...@@ -628,21 +628,21 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) ...@@ -628,21 +628,21 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
mutex_init(&drv_data->lock); mutex_init(&drv_data->lock);
dev_set_drvdata(&dssdev->dev, drv_data); dev_set_drvdata(dssdev->dev, drv_data);
return 0; return 0;
} }
static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev) static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "remove\n"); dev_dbg(dssdev->dev, "remove\n");
dev_set_drvdata(&dssdev->dev, NULL); dev_set_drvdata(dssdev->dev, NULL);
} }
static int generic_dpi_panel_enable(struct omap_dss_device *dssdev) static int generic_dpi_panel_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
int r; int r;
mutex_lock(&drv_data->lock); mutex_lock(&drv_data->lock);
...@@ -660,7 +660,7 @@ static int generic_dpi_panel_enable(struct omap_dss_device *dssdev) ...@@ -660,7 +660,7 @@ static int generic_dpi_panel_enable(struct omap_dss_device *dssdev)
static void generic_dpi_panel_disable(struct omap_dss_device *dssdev) static void generic_dpi_panel_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
mutex_lock(&drv_data->lock); mutex_lock(&drv_data->lock);
...@@ -674,7 +674,7 @@ static void generic_dpi_panel_disable(struct omap_dss_device *dssdev) ...@@ -674,7 +674,7 @@ static void generic_dpi_panel_disable(struct omap_dss_device *dssdev)
static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev, static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
mutex_lock(&drv_data->lock); mutex_lock(&drv_data->lock);
...@@ -688,7 +688,7 @@ static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev, ...@@ -688,7 +688,7 @@ static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev, static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
mutex_lock(&drv_data->lock); mutex_lock(&drv_data->lock);
...@@ -700,7 +700,7 @@ static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev, ...@@ -700,7 +700,7 @@ static void generic_dpi_panel_get_timings(struct omap_dss_device *dssdev,
static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev, static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *drv_data = dev_get_drvdata(dssdev->dev);
int r; int r;
mutex_lock(&drv_data->lock); mutex_lock(&drv_data->lock);
......
...@@ -109,12 +109,12 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev) ...@@ -109,12 +109,12 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = lb035q02_timings; dssdev->panel.timings = lb035q02_timings;
ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL); ld = devm_kzalloc(dssdev->dev, sizeof(*ld), GFP_KERNEL);
if (!ld) if (!ld)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < panel_data->num_gpios; ++i) { for (i = 0; i < panel_data->num_gpios; ++i) {
r = devm_gpio_request_one(&dssdev->dev, panel_data->gpios[i], r = devm_gpio_request_one(dssdev->dev, panel_data->gpios[i],
panel_data->gpio_invert[i] ? panel_data->gpio_invert[i] ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW, GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
"panel gpio"); "panel gpio");
...@@ -123,7 +123,7 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev) ...@@ -123,7 +123,7 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
} }
mutex_init(&ld->lock); mutex_init(&ld->lock);
dev_set_drvdata(&dssdev->dev, ld); dev_set_drvdata(dssdev->dev, ld);
return 0; return 0;
} }
...@@ -134,7 +134,7 @@ static void lb035q02_panel_remove(struct omap_dss_device *dssdev) ...@@ -134,7 +134,7 @@ static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
static int lb035q02_panel_enable(struct omap_dss_device *dssdev) static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
{ {
struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev); struct lb035q02_data *ld = dev_get_drvdata(dssdev->dev);
int r; int r;
mutex_lock(&ld->lock); mutex_lock(&ld->lock);
...@@ -153,7 +153,7 @@ static int lb035q02_panel_enable(struct omap_dss_device *dssdev) ...@@ -153,7 +153,7 @@ static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
static void lb035q02_panel_disable(struct omap_dss_device *dssdev) static void lb035q02_panel_disable(struct omap_dss_device *dssdev)
{ {
struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev); struct lb035q02_data *ld = dev_get_drvdata(dssdev->dev);
mutex_lock(&ld->lock); mutex_lock(&ld->lock);
......
...@@ -311,16 +311,16 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev) ...@@ -311,16 +311,16 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
switch (rev & 0xfc) { switch (rev & 0xfc) {
case 0x9c: case 0x9c:
ddata->blizzard_ver = BLIZZARD_VERSION_S1D13744; ddata->blizzard_ver = BLIZZARD_VERSION_S1D13744;
dev_info(&dssdev->dev, "s1d13744 LCD controller rev %d " dev_info(dssdev->dev, "s1d13744 LCD controller rev %d "
"initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
break; break;
case 0xa4: case 0xa4:
ddata->blizzard_ver = BLIZZARD_VERSION_S1D13745; ddata->blizzard_ver = BLIZZARD_VERSION_S1D13745;
dev_info(&dssdev->dev, "s1d13745 LCD controller rev %d " dev_info(dssdev->dev, "s1d13745 LCD controller rev %d "
"initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07); "initialized (CNF pins %x)\n", rev & 0x03, conf & 0x07);
break; break;
default: default:
dev_err(&dssdev->dev, "invalid s1d1374x revision %02x\n", rev); dev_err(dssdev->dev, "invalid s1d1374x revision %02x\n", rev);
r = -ENODEV; r = -ENODEV;
goto err_inv_chip; goto err_inv_chip;
} }
...@@ -341,13 +341,13 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev) ...@@ -341,13 +341,13 @@ static int n8x0_panel_power_on(struct omap_dss_device *dssdev)
panel_name = "ls041y3"; panel_name = "ls041y3";
break; break;
default: default:
dev_err(&dssdev->dev, "invalid display ID 0x%x\n", dev_err(dssdev->dev, "invalid display ID 0x%x\n",
display_id[0]); display_id[0]);
r = -ENODEV; r = -ENODEV;
goto err_inv_panel; goto err_inv_panel;
} }
dev_info(&dssdev->dev, "%s rev %02x LCD detected\n", dev_info(dssdev->dev, "%s rev %02x LCD detected\n",
panel_name, display_id[1]); panel_name, display_id[1]);
send_sleep_out(spi); send_sleep_out(spi);
...@@ -416,7 +416,7 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) ...@@ -416,7 +416,7 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
struct panel_drv_data *ddata; struct panel_drv_data *ddata;
int r; int r;
dev_dbg(&dssdev->dev, "probe\n"); dev_dbg(dssdev->dev, "probe\n");
if (!bdata) if (!bdata)
return -EINVAL; return -EINVAL;
...@@ -434,14 +434,14 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) ...@@ -434,14 +434,14 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE; dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
if (gpio_is_valid(bdata->panel_reset)) { if (gpio_is_valid(bdata->panel_reset)) {
r = devm_gpio_request_one(&dssdev->dev, bdata->panel_reset, r = devm_gpio_request_one(dssdev->dev, bdata->panel_reset,
GPIOF_OUT_INIT_LOW, "PANEL RESET"); GPIOF_OUT_INIT_LOW, "PANEL RESET");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(bdata->ctrl_pwrdown)) { if (gpio_is_valid(bdata->ctrl_pwrdown)) {
r = devm_gpio_request_one(&dssdev->dev, bdata->ctrl_pwrdown, r = devm_gpio_request_one(dssdev->dev, bdata->ctrl_pwrdown,
GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN"); GPIOF_OUT_INIT_LOW, "PANEL PWRDOWN");
if (r) if (r)
return r; return r;
...@@ -452,9 +452,9 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev) ...@@ -452,9 +452,9 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
static void n8x0_panel_remove(struct omap_dss_device *dssdev) static void n8x0_panel_remove(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "remove\n"); dev_dbg(dssdev->dev, "remove\n");
dev_set_drvdata(&dssdev->dev, NULL); dev_set_drvdata(dssdev->dev, NULL);
} }
static int n8x0_panel_enable(struct omap_dss_device *dssdev) static int n8x0_panel_enable(struct omap_dss_device *dssdev)
...@@ -462,7 +462,7 @@ static int n8x0_panel_enable(struct omap_dss_device *dssdev) ...@@ -462,7 +462,7 @@ static int n8x0_panel_enable(struct omap_dss_device *dssdev)
struct panel_drv_data *ddata = get_drv_data(dssdev); struct panel_drv_data *ddata = get_drv_data(dssdev);
int r; int r;
dev_dbg(&dssdev->dev, "enable\n"); dev_dbg(dssdev->dev, "enable\n");
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -488,7 +488,7 @@ static void n8x0_panel_disable(struct omap_dss_device *dssdev) ...@@ -488,7 +488,7 @@ static void n8x0_panel_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = get_drv_data(dssdev); struct panel_drv_data *ddata = get_drv_data(dssdev);
dev_dbg(&dssdev->dev, "disable\n"); dev_dbg(dssdev->dev, "disable\n");
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -521,13 +521,13 @@ static int n8x0_panel_update(struct omap_dss_device *dssdev, ...@@ -521,13 +521,13 @@ static int n8x0_panel_update(struct omap_dss_device *dssdev,
struct panel_drv_data *ddata = get_drv_data(dssdev); struct panel_drv_data *ddata = get_drv_data(dssdev);
u16 dw, dh; u16 dw, dh;
dev_dbg(&dssdev->dev, "update\n"); dev_dbg(dssdev->dev, "update\n");
dw = dssdev->panel.timings.x_res; dw = dssdev->panel.timings.x_res;
dh = dssdev->panel.timings.y_res; dh = dssdev->panel.timings.y_res;
if (x != 0 || y != 0 || w != dw || h != dh) { if (x != 0 || y != 0 || w != dw || h != dh) {
dev_err(&dssdev->dev, "invaid update region %d, %d, %d, %d\n", dev_err(dssdev->dev, "invaid update region %d, %d, %d, %d\n",
x, y, w, h); x, y, w, h);
return -EINVAL; return -EINVAL;
} }
...@@ -548,7 +548,7 @@ static int n8x0_panel_sync(struct omap_dss_device *dssdev) ...@@ -548,7 +548,7 @@ static int n8x0_panel_sync(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = get_drv_data(dssdev); struct panel_drv_data *ddata = get_drv_data(dssdev);
dev_dbg(&dssdev->dev, "sync\n"); dev_dbg(dssdev->dev, "sync\n");
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
rfbi_bus_lock(); rfbi_bus_lock();
......
...@@ -98,14 +98,14 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev) ...@@ -98,14 +98,14 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = nec_8048_panel_timings; dssdev->panel.timings = nec_8048_panel_timings;
if (gpio_is_valid(pd->qvga_gpio)) { if (gpio_is_valid(pd->qvga_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->qvga_gpio, r = devm_gpio_request_one(dssdev->dev, pd->qvga_gpio,
GPIOF_OUT_INIT_HIGH, "lcd QVGA"); GPIOF_OUT_INIT_HIGH, "lcd QVGA");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(pd->res_gpio)) { if (gpio_is_valid(pd->res_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->res_gpio, r = devm_gpio_request_one(dssdev->dev, pd->res_gpio,
GPIOF_OUT_INIT_LOW, "lcd RES"); GPIOF_OUT_INIT_LOW, "lcd RES");
if (r) if (r)
return r; return r;
......
...@@ -351,7 +351,7 @@ static struct i2c_driver picodlp_i2c_driver = { ...@@ -351,7 +351,7 @@ static struct i2c_driver picodlp_i2c_driver = {
static int picodlp_panel_power_on(struct omap_dss_device *dssdev) static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
{ {
int r, trial = 100; int r, trial = 100;
struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev); struct picodlp_panel_data *picodlp_pdata = get_panel_data(dssdev);
gpio_set_value(picodlp_pdata->pwrgood_gpio, 0); gpio_set_value(picodlp_pdata->pwrgood_gpio, 0);
...@@ -360,7 +360,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev) ...@@ -360,7 +360,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) { while (!gpio_get_value(picodlp_pdata->emu_done_gpio)) {
if (!trial--) { if (!trial--) {
dev_err(&dssdev->dev, "emu_done signal not" dev_err(dssdev->dev, "emu_done signal not"
" going high\n"); " going high\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -378,7 +378,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev) ...@@ -378,7 +378,7 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
r = omapdss_dpi_display_enable(dssdev); r = omapdss_dpi_display_enable(dssdev);
if (r) { if (r) {
dev_err(&dssdev->dev, "failed to enable DPI\n"); dev_err(dssdev->dev, "failed to enable DPI\n");
goto err1; goto err1;
} }
...@@ -418,7 +418,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev) ...@@ -418,7 +418,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
if (!picodlp_pdata) if (!picodlp_pdata)
return -EINVAL; return -EINVAL;
picod = devm_kzalloc(&dssdev->dev, sizeof(*picod), GFP_KERNEL); picod = devm_kzalloc(dssdev->dev, sizeof(*picod), GFP_KERNEL);
if (!picod) if (!picod)
return -ENOMEM; return -ENOMEM;
...@@ -428,23 +428,23 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev) ...@@ -428,23 +428,23 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
adapter = i2c_get_adapter(picodlp_adapter_id); adapter = i2c_get_adapter(picodlp_adapter_id);
if (!adapter) { if (!adapter) {
dev_err(&dssdev->dev, "can't get i2c adapter\n"); dev_err(dssdev->dev, "can't get i2c adapter\n");
return -ENODEV; return -ENODEV;
} }
picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info); picodlp_i2c_client = i2c_new_device(adapter, &picodlp_i2c_board_info);
if (!picodlp_i2c_client) { if (!picodlp_i2c_client) {
dev_err(&dssdev->dev, "can't add i2c device::" dev_err(dssdev->dev, "can't add i2c device::"
" picodlp_i2c_client is NULL\n"); " picodlp_i2c_client is NULL\n");
return -ENODEV; return -ENODEV;
} }
picod->picodlp_i2c_client = picodlp_i2c_client; picod->picodlp_i2c_client = picodlp_i2c_client;
dev_set_drvdata(&dssdev->dev, picod); dev_set_drvdata(dssdev->dev, picod);
if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) { if (gpio_is_valid(picodlp_pdata->emu_done_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, r = devm_gpio_request_one(dssdev->dev,
picodlp_pdata->emu_done_gpio, picodlp_pdata->emu_done_gpio,
GPIOF_IN, "DLP EMU DONE"); GPIOF_IN, "DLP EMU DONE");
if (r) if (r)
...@@ -452,7 +452,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev) ...@@ -452,7 +452,7 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
} }
if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) { if (gpio_is_valid(picodlp_pdata->pwrgood_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, r = devm_gpio_request_one(dssdev->dev,
picodlp_pdata->pwrgood_gpio, picodlp_pdata->pwrgood_gpio,
GPIOF_OUT_INIT_LOW, "DLP PWRGOOD"); GPIOF_OUT_INIT_LOW, "DLP PWRGOOD");
if (r) if (r)
...@@ -464,21 +464,21 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev) ...@@ -464,21 +464,21 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
static void picodlp_panel_remove(struct omap_dss_device *dssdev) static void picodlp_panel_remove(struct omap_dss_device *dssdev)
{ {
struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
i2c_unregister_device(picod->picodlp_i2c_client); i2c_unregister_device(picod->picodlp_i2c_client);
dev_set_drvdata(&dssdev->dev, NULL); dev_set_drvdata(dssdev->dev, NULL);
dev_dbg(&dssdev->dev, "removing picodlp panel\n"); dev_dbg(dssdev->dev, "removing picodlp panel\n");
kfree(picod); kfree(picod);
} }
static int picodlp_panel_enable(struct omap_dss_device *dssdev) static int picodlp_panel_enable(struct omap_dss_device *dssdev)
{ {
struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
int r; int r;
dev_dbg(&dssdev->dev, "enabling picodlp panel\n"); dev_dbg(dssdev->dev, "enabling picodlp panel\n");
mutex_lock(&picod->lock); mutex_lock(&picod->lock);
if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) { if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
...@@ -494,7 +494,7 @@ static int picodlp_panel_enable(struct omap_dss_device *dssdev) ...@@ -494,7 +494,7 @@ static int picodlp_panel_enable(struct omap_dss_device *dssdev)
static void picodlp_panel_disable(struct omap_dss_device *dssdev) static void picodlp_panel_disable(struct omap_dss_device *dssdev)
{ {
struct picodlp_data *picod = dev_get_drvdata(&dssdev->dev); struct picodlp_data *picod = dev_get_drvdata(dssdev->dev);
mutex_lock(&picod->lock); mutex_lock(&picod->lock);
/* Turn off DLP Power */ /* Turn off DLP Power */
...@@ -504,7 +504,7 @@ static void picodlp_panel_disable(struct omap_dss_device *dssdev) ...@@ -504,7 +504,7 @@ static void picodlp_panel_disable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_DISABLED; dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
mutex_unlock(&picod->lock); mutex_unlock(&picod->lock);
dev_dbg(&dssdev->dev, "disabling picodlp panel\n"); dev_dbg(dssdev->dev, "disabling picodlp panel\n");
} }
static void picodlp_get_resolution(struct omap_dss_device *dssdev, static void picodlp_get_resolution(struct omap_dss_device *dssdev,
......
...@@ -66,35 +66,35 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev) ...@@ -66,35 +66,35 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = sharp_ls_timings; dssdev->panel.timings = sharp_ls_timings;
if (gpio_is_valid(pd->mo_gpio)) { if (gpio_is_valid(pd->mo_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->mo_gpio, r = devm_gpio_request_one(dssdev->dev, pd->mo_gpio,
GPIOF_OUT_INIT_LOW, "lcd MO"); GPIOF_OUT_INIT_LOW, "lcd MO");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(pd->lr_gpio)) { if (gpio_is_valid(pd->lr_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->lr_gpio, r = devm_gpio_request_one(dssdev->dev, pd->lr_gpio,
GPIOF_OUT_INIT_HIGH, "lcd LR"); GPIOF_OUT_INIT_HIGH, "lcd LR");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(pd->ud_gpio)) { if (gpio_is_valid(pd->ud_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->ud_gpio, r = devm_gpio_request_one(dssdev->dev, pd->ud_gpio,
GPIOF_OUT_INIT_HIGH, "lcd UD"); GPIOF_OUT_INIT_HIGH, "lcd UD");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(pd->resb_gpio)) { if (gpio_is_valid(pd->resb_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->resb_gpio, r = devm_gpio_request_one(dssdev->dev, pd->resb_gpio,
GPIOF_OUT_INIT_LOW, "lcd RESB"); GPIOF_OUT_INIT_LOW, "lcd RESB");
if (r) if (r)
return r; return r;
} }
if (gpio_is_valid(pd->ini_gpio)) { if (gpio_is_valid(pd->ini_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, pd->ini_gpio, r = devm_gpio_request_one(dssdev->dev, pd->ini_gpio,
GPIOF_OUT_INIT_LOW, "lcd INI"); GPIOF_OUT_INIT_LOW, "lcd INI");
if (r) if (r)
return r; return r;
......
This diff is collapsed.
...@@ -59,7 +59,7 @@ struct panel_drv_data { ...@@ -59,7 +59,7 @@ struct panel_drv_data {
static int tfp410_power_on(struct omap_dss_device *dssdev) static int tfp410_power_on(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
...@@ -82,7 +82,7 @@ static int tfp410_power_on(struct omap_dss_device *dssdev) ...@@ -82,7 +82,7 @@ static int tfp410_power_on(struct omap_dss_device *dssdev)
static void tfp410_power_off(struct omap_dss_device *dssdev) static void tfp410_power_off(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return; return;
...@@ -99,7 +99,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -99,7 +99,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
int r; int r;
int i2c_bus_num; int i2c_bus_num;
ddata = devm_kzalloc(&dssdev->dev, sizeof(*ddata), GFP_KERNEL); ddata = devm_kzalloc(dssdev->dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata) if (!ddata)
return -ENOMEM; return -ENOMEM;
...@@ -119,10 +119,10 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -119,10 +119,10 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
} }
if (gpio_is_valid(ddata->pd_gpio)) { if (gpio_is_valid(ddata->pd_gpio)) {
r = devm_gpio_request_one(&dssdev->dev, ddata->pd_gpio, r = devm_gpio_request_one(dssdev->dev, ddata->pd_gpio,
GPIOF_OUT_INIT_LOW, "tfp410 pd"); GPIOF_OUT_INIT_LOW, "tfp410 pd");
if (r) { if (r) {
dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", dev_err(dssdev->dev, "Failed to request PD GPIO %d\n",
ddata->pd_gpio); ddata->pd_gpio);
return r; return r;
} }
...@@ -133,7 +133,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -133,7 +133,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
adapter = i2c_get_adapter(i2c_bus_num); adapter = i2c_get_adapter(i2c_bus_num);
if (!adapter) { if (!adapter) {
dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", dev_err(dssdev->dev, "Failed to get I2C adapter, bus %d\n",
i2c_bus_num); i2c_bus_num);
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
...@@ -141,28 +141,28 @@ static int tfp410_probe(struct omap_dss_device *dssdev) ...@@ -141,28 +141,28 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
ddata->i2c_adapter = adapter; ddata->i2c_adapter = adapter;
} }
dev_set_drvdata(&dssdev->dev, ddata); dev_set_drvdata(dssdev->dev, ddata);
return 0; return 0;
} }
static void __exit tfp410_remove(struct omap_dss_device *dssdev) static void __exit tfp410_remove(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
if (ddata->i2c_adapter) if (ddata->i2c_adapter)
i2c_put_adapter(ddata->i2c_adapter); i2c_put_adapter(ddata->i2c_adapter);
dev_set_drvdata(&dssdev->dev, NULL); dev_set_drvdata(dssdev->dev, NULL);
mutex_unlock(&ddata->lock); mutex_unlock(&ddata->lock);
} }
static int tfp410_enable(struct omap_dss_device *dssdev) static int tfp410_enable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
int r; int r;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -178,7 +178,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev) ...@@ -178,7 +178,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 = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -192,7 +192,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev) ...@@ -192,7 +192,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)
static void tfp410_set_timings(struct omap_dss_device *dssdev, static void tfp410_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
omapdss_dpi_set_timings(dssdev, timings); omapdss_dpi_set_timings(dssdev, timings);
...@@ -203,7 +203,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, ...@@ -203,7 +203,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
static void tfp410_get_timings(struct omap_dss_device *dssdev, static void tfp410_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
*timings = dssdev->panel.timings; *timings = dssdev->panel.timings;
...@@ -213,7 +213,7 @@ static void tfp410_get_timings(struct omap_dss_device *dssdev, ...@@ -213,7 +213,7 @@ static void tfp410_get_timings(struct omap_dss_device *dssdev,
static int tfp410_check_timings(struct omap_dss_device *dssdev, static int tfp410_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
int r; int r;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -258,7 +258,7 @@ static int tfp410_ddc_read(struct i2c_adapter *adapter, ...@@ -258,7 +258,7 @@ static int tfp410_ddc_read(struct i2c_adapter *adapter,
static int tfp410_read_edid(struct omap_dss_device *dssdev, static int tfp410_read_edid(struct omap_dss_device *dssdev,
u8 *edid, int len) u8 *edid, int len)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
int r, l, bytes_read; int r, l, bytes_read;
mutex_lock(&ddata->lock); mutex_lock(&ddata->lock);
...@@ -298,7 +298,7 @@ static int tfp410_read_edid(struct omap_dss_device *dssdev, ...@@ -298,7 +298,7 @@ static int tfp410_read_edid(struct omap_dss_device *dssdev,
static bool tfp410_detect(struct omap_dss_device *dssdev) static bool tfp410_detect(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev); struct panel_drv_data *ddata = dev_get_drvdata(dssdev->dev);
unsigned char out; unsigned char out;
int r; int r;
......
...@@ -126,7 +126,7 @@ static int tpo_td043_write_mirror(struct spi_device *spi, bool h, bool v) ...@@ -126,7 +126,7 @@ static int tpo_td043_write_mirror(struct spi_device *spi, bool h, bool v)
static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable) static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable)
{ {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
tpo_td043->hmirror = enable; tpo_td043->hmirror = enable;
return tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror, return tpo_td043_write_mirror(tpo_td043->spi, tpo_td043->hmirror,
...@@ -135,7 +135,7 @@ static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable) ...@@ -135,7 +135,7 @@ static int tpo_td043_set_hmirror(struct omap_dss_device *dssdev, bool enable)
static bool tpo_td043_get_hmirror(struct omap_dss_device *dssdev) static bool tpo_td043_get_hmirror(struct omap_dss_device *dssdev)
{ {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
return tpo_td043->hmirror; return tpo_td043->hmirror;
} }
...@@ -338,7 +338,7 @@ static void tpo_td043_power_off(struct tpo_td043_device *tpo_td043) ...@@ -338,7 +338,7 @@ static void tpo_td043_power_off(struct tpo_td043_device *tpo_td043)
static int tpo_td043_enable_dss(struct omap_dss_device *dssdev) static int tpo_td043_enable_dss(struct omap_dss_device *dssdev)
{ {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
int r; int r;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
...@@ -372,7 +372,7 @@ static int tpo_td043_enable_dss(struct omap_dss_device *dssdev) ...@@ -372,7 +372,7 @@ static int tpo_td043_enable_dss(struct omap_dss_device *dssdev)
static void tpo_td043_disable_dss(struct omap_dss_device *dssdev) static void tpo_td043_disable_dss(struct omap_dss_device *dssdev)
{ {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
return; return;
...@@ -385,14 +385,14 @@ static void tpo_td043_disable_dss(struct omap_dss_device *dssdev) ...@@ -385,14 +385,14 @@ static void tpo_td043_disable_dss(struct omap_dss_device *dssdev)
static int tpo_td043_enable(struct omap_dss_device *dssdev) static int tpo_td043_enable(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "enable\n"); dev_dbg(dssdev->dev, "enable\n");
return tpo_td043_enable_dss(dssdev); return tpo_td043_enable_dss(dssdev);
} }
static void tpo_td043_disable(struct omap_dss_device *dssdev) static void tpo_td043_disable(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "disable\n"); dev_dbg(dssdev->dev, "disable\n");
tpo_td043_disable_dss(dssdev); tpo_td043_disable_dss(dssdev);
...@@ -405,10 +405,10 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) ...@@ -405,10 +405,10 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
struct panel_tpo_td043_data *pdata = get_panel_data(dssdev); struct panel_tpo_td043_data *pdata = get_panel_data(dssdev);
int ret = 0; int ret = 0;
dev_dbg(&dssdev->dev, "probe\n"); dev_dbg(dssdev->dev, "probe\n");
if (tpo_td043 == NULL) { if (tpo_td043 == NULL) {
dev_err(&dssdev->dev, "missing tpo_td043_device\n"); dev_err(dssdev->dev, "missing tpo_td043_device\n");
return -ENODEV; return -ENODEV;
} }
...@@ -423,28 +423,28 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) ...@@ -423,28 +423,28 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
tpo_td043->mode = TPO_R02_MODE_800x480; tpo_td043->mode = TPO_R02_MODE_800x480;
memcpy(tpo_td043->gamma, tpo_td043_def_gamma, sizeof(tpo_td043->gamma)); memcpy(tpo_td043->gamma, tpo_td043_def_gamma, sizeof(tpo_td043->gamma));
tpo_td043->vcc_reg = regulator_get(&dssdev->dev, "vcc"); tpo_td043->vcc_reg = regulator_get(dssdev->dev, "vcc");
if (IS_ERR(tpo_td043->vcc_reg)) { if (IS_ERR(tpo_td043->vcc_reg)) {
dev_err(&dssdev->dev, "failed to get LCD VCC regulator\n"); dev_err(dssdev->dev, "failed to get LCD VCC regulator\n");
ret = PTR_ERR(tpo_td043->vcc_reg); ret = PTR_ERR(tpo_td043->vcc_reg);
goto fail_regulator; goto fail_regulator;
} }
if (gpio_is_valid(tpo_td043->nreset_gpio)) { if (gpio_is_valid(tpo_td043->nreset_gpio)) {
ret = devm_gpio_request_one(&dssdev->dev, ret = devm_gpio_request_one(dssdev->dev,
tpo_td043->nreset_gpio, GPIOF_OUT_INIT_LOW, tpo_td043->nreset_gpio, GPIOF_OUT_INIT_LOW,
"lcd reset"); "lcd reset");
if (ret < 0) { if (ret < 0) {
dev_err(&dssdev->dev, "couldn't request reset GPIO\n"); dev_err(dssdev->dev, "couldn't request reset GPIO\n");
goto fail_gpio_req; goto fail_gpio_req;
} }
} }
ret = sysfs_create_group(&dssdev->dev.kobj, &tpo_td043_attr_group); ret = sysfs_create_group(&dssdev->dev->kobj, &tpo_td043_attr_group);
if (ret) if (ret)
dev_warn(&dssdev->dev, "failed to create sysfs files\n"); dev_warn(dssdev->dev, "failed to create sysfs files\n");
dev_set_drvdata(&dssdev->dev, tpo_td043); dev_set_drvdata(dssdev->dev, tpo_td043);
return 0; return 0;
...@@ -457,11 +457,11 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) ...@@ -457,11 +457,11 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
static void tpo_td043_remove(struct omap_dss_device *dssdev) static void tpo_td043_remove(struct omap_dss_device *dssdev)
{ {
struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); struct tpo_td043_device *tpo_td043 = dev_get_drvdata(dssdev->dev);
dev_dbg(&dssdev->dev, "remove\n"); dev_dbg(dssdev->dev, "remove\n");
sysfs_remove_group(&dssdev->dev.kobj, &tpo_td043_attr_group); sysfs_remove_group(&dssdev->dev->kobj, &tpo_td043_attr_group);
regulator_put(tpo_td043->vcc_reg); regulator_put(tpo_td043->vcc_reg);
} }
......
...@@ -437,30 +437,32 @@ struct omap_dss_device *dss_alloc_and_init_device(struct device *parent) ...@@ -437,30 +437,32 @@ struct omap_dss_device *dss_alloc_and_init_device(struct device *parent)
if (!dssdev) if (!dssdev)
return NULL; return NULL;
dssdev->dev.bus = &dss_bus_type; dssdev->old_dev.bus = &dss_bus_type;
dssdev->dev.parent = parent; dssdev->old_dev.parent = parent;
dssdev->dev.release = omap_dss_dev_release; dssdev->old_dev.release = omap_dss_dev_release;
dev_set_name(&dssdev->dev, "display%d", disp_num_counter++); dev_set_name(&dssdev->old_dev, "display%d", disp_num_counter++);
device_initialize(&dssdev->dev); device_initialize(&dssdev->old_dev);
return dssdev; return dssdev;
} }
int dss_add_device(struct omap_dss_device *dssdev) int dss_add_device(struct omap_dss_device *dssdev)
{ {
dssdev->dev = &dssdev->old_dev;
omapdss_register_display(dssdev); omapdss_register_display(dssdev);
return device_add(&dssdev->dev); return device_add(&dssdev->old_dev);
} }
void dss_put_device(struct omap_dss_device *dssdev) void dss_put_device(struct omap_dss_device *dssdev)
{ {
put_device(&dssdev->dev); put_device(&dssdev->old_dev);
} }
void dss_unregister_device(struct omap_dss_device *dssdev) void dss_unregister_device(struct omap_dss_device *dssdev)
{ {
device_unregister(&dssdev->dev); device_unregister(&dssdev->old_dev);
omapdss_unregister_display(dssdev); omapdss_unregister_display(dssdev);
} }
......
...@@ -33,7 +33,7 @@ static struct omap_dss_device *to_dss_device_sysfs(struct device *dev) ...@@ -33,7 +33,7 @@ static struct omap_dss_device *to_dss_device_sysfs(struct device *dev)
struct omap_dss_device *dssdev = NULL; struct omap_dss_device *dssdev = NULL;
for_each_dss_dev(dssdev) { for_each_dss_dev(dssdev) {
if (&dssdev->dev == dev) { if (dssdev->dev == dev) {
omap_dss_put_device(dssdev); omap_dss_put_device(dssdev);
return dssdev; return dssdev;
} }
...@@ -308,7 +308,7 @@ int display_init_sysfs(struct platform_device *pdev) ...@@ -308,7 +308,7 @@ int display_init_sysfs(struct platform_device *pdev)
int r; int r;
for_each_dss_dev(dssdev) { for_each_dss_dev(dssdev) {
struct kobject *kobj = &dssdev->dev.kobj; struct kobject *kobj = &dssdev->dev->kobj;
r = sysfs_create_files(kobj, display_sysfs_attrs); r = sysfs_create_files(kobj, display_sysfs_attrs);
if (r) { if (r) {
...@@ -339,6 +339,7 @@ void display_uninit_sysfs(struct platform_device *pdev) ...@@ -339,6 +339,7 @@ void display_uninit_sysfs(struct platform_device *pdev)
for_each_dss_dev(dssdev) { for_each_dss_dev(dssdev) {
sysfs_remove_link(&pdev->dev.kobj, dssdev->alias); sysfs_remove_link(&pdev->dev.kobj, dssdev->alias);
sysfs_remove_files(&dssdev->dev.kobj, display_sysfs_attrs); sysfs_remove_files(&dssdev->dev->kobj,
display_sysfs_attrs);
} }
} }
...@@ -160,13 +160,13 @@ EXPORT_SYMBOL(omapdss_unregister_display); ...@@ -160,13 +160,13 @@ EXPORT_SYMBOL(omapdss_unregister_display);
void omap_dss_get_device(struct omap_dss_device *dssdev) void omap_dss_get_device(struct omap_dss_device *dssdev)
{ {
get_device(&dssdev->dev); get_device(dssdev->dev);
} }
EXPORT_SYMBOL(omap_dss_get_device); EXPORT_SYMBOL(omap_dss_get_device);
void omap_dss_put_device(struct omap_dss_device *dssdev) void omap_dss_put_device(struct omap_dss_device *dssdev)
{ {
put_device(&dssdev->dev); put_device(dssdev->dev);
} }
EXPORT_SYMBOL(omap_dss_put_device); EXPORT_SYMBOL(omap_dss_put_device);
...@@ -240,9 +240,8 @@ int omap_dss_start_device(struct omap_dss_device *dssdev) ...@@ -240,9 +240,8 @@ int omap_dss_start_device(struct omap_dss_device *dssdev)
return -ENODEV; return -ENODEV;
} }
if (!try_module_get(dssdev->dev.driver->owner)) { if (!try_module_get(dssdev->dev->driver->owner))
return -ENODEV; return -ENODEV;
}
return 0; return 0;
} }
...@@ -250,7 +249,7 @@ EXPORT_SYMBOL(omap_dss_start_device); ...@@ -250,7 +249,7 @@ EXPORT_SYMBOL(omap_dss_start_device);
void omap_dss_stop_device(struct omap_dss_device *dssdev) void omap_dss_stop_device(struct omap_dss_device *dssdev)
{ {
module_put(dssdev->dev.driver->owner); module_put(dssdev->dev->driver->owner);
} }
EXPORT_SYMBOL(omap_dss_stop_device); EXPORT_SYMBOL(omap_dss_stop_device);
......
...@@ -107,19 +107,19 @@ static int venc_panel_probe(struct omap_dss_device *dssdev) ...@@ -107,19 +107,19 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
dssdev->panel.timings = default_timings; dssdev->panel.timings = default_timings;
return device_create_file(&dssdev->dev, &dev_attr_output_type); return device_create_file(dssdev->dev, &dev_attr_output_type);
} }
static void venc_panel_remove(struct omap_dss_device *dssdev) static void venc_panel_remove(struct omap_dss_device *dssdev)
{ {
device_remove_file(&dssdev->dev, &dev_attr_output_type); device_remove_file(dssdev->dev, &dev_attr_output_type);
} }
static int venc_panel_enable(struct omap_dss_device *dssdev) static int venc_panel_enable(struct omap_dss_device *dssdev)
{ {
int r; int r;
dev_dbg(&dssdev->dev, "venc_panel_enable\n"); dev_dbg(dssdev->dev, "venc_panel_enable\n");
mutex_lock(&venc_panel.lock); mutex_lock(&venc_panel.lock);
...@@ -150,7 +150,7 @@ static int venc_panel_enable(struct omap_dss_device *dssdev) ...@@ -150,7 +150,7 @@ static int venc_panel_enable(struct omap_dss_device *dssdev)
static void venc_panel_disable(struct omap_dss_device *dssdev) static void venc_panel_disable(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "venc_panel_disable\n"); dev_dbg(dssdev->dev, "venc_panel_disable\n");
mutex_lock(&venc_panel.lock); mutex_lock(&venc_panel.lock);
...@@ -167,7 +167,7 @@ static void venc_panel_disable(struct omap_dss_device *dssdev) ...@@ -167,7 +167,7 @@ static void venc_panel_disable(struct omap_dss_device *dssdev)
static void venc_panel_set_timings(struct omap_dss_device *dssdev, static void venc_panel_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
dev_dbg(&dssdev->dev, "venc_panel_set_timings\n"); dev_dbg(dssdev->dev, "venc_panel_set_timings\n");
mutex_lock(&venc_panel.lock); mutex_lock(&venc_panel.lock);
...@@ -180,21 +180,21 @@ static void venc_panel_set_timings(struct omap_dss_device *dssdev, ...@@ -180,21 +180,21 @@ static void venc_panel_set_timings(struct omap_dss_device *dssdev,
static int venc_panel_check_timings(struct omap_dss_device *dssdev, static int venc_panel_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings) struct omap_video_timings *timings)
{ {
dev_dbg(&dssdev->dev, "venc_panel_check_timings\n"); dev_dbg(dssdev->dev, "venc_panel_check_timings\n");
return omapdss_venc_check_timings(dssdev, timings); return omapdss_venc_check_timings(dssdev, timings);
} }
static u32 venc_panel_get_wss(struct omap_dss_device *dssdev) static u32 venc_panel_get_wss(struct omap_dss_device *dssdev)
{ {
dev_dbg(&dssdev->dev, "venc_panel_get_wss\n"); dev_dbg(dssdev->dev, "venc_panel_get_wss\n");
return omapdss_venc_get_wss(dssdev); return omapdss_venc_get_wss(dssdev);
} }
static int venc_panel_set_wss(struct omap_dss_device *dssdev, u32 wss) static int venc_panel_set_wss(struct omap_dss_device *dssdev, u32 wss)
{ {
dev_dbg(&dssdev->dev, "venc_panel_set_wss\n"); dev_dbg(dssdev->dev, "venc_panel_set_wss\n");
return omapdss_venc_set_wss(dssdev, wss); return omapdss_venc_set_wss(dssdev, wss);
} }
......
...@@ -596,7 +596,11 @@ struct omap_dss_output { ...@@ -596,7 +596,11 @@ struct omap_dss_output {
}; };
struct omap_dss_device { struct omap_dss_device {
struct device dev; /* old device, to be removed */
struct device old_dev;
/* new device, pointer to panel device */
struct device *dev;
struct list_head panel_list; struct list_head panel_list;
...@@ -856,7 +860,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, ...@@ -856,7 +860,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
bool mem_to_mem); bool mem_to_mem);
#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) #define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
bool enable); bool enable);
......
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