Commit 67822ae1 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: dss: Remove panel devices list

The panel devices list isn't used anymore, all panel devices are
accessed through the global devices list. Remove it.
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 4e0bb06c
...@@ -154,7 +154,6 @@ static int tvc_probe(struct platform_device *pdev) ...@@ -154,7 +154,6 @@ static int tvc_probe(struct platform_device *pdev)
{ {
struct panel_drv_data *ddata; struct panel_drv_data *ddata;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
int r;
ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata) if (!ddata)
...@@ -172,11 +171,7 @@ static int tvc_probe(struct platform_device *pdev) ...@@ -172,11 +171,7 @@ static int tvc_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&pdev->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -186,7 +181,7 @@ static int __exit tvc_remove(struct platform_device *pdev) ...@@ -186,7 +181,7 @@ static int __exit tvc_remove(struct platform_device *pdev)
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(&ddata->dssdev); omapdss_device_unregister(&ddata->dssdev);
tvc_disable(dssdev); tvc_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -391,19 +391,9 @@ static int dvic_probe(struct platform_device *pdev) ...@@ -391,19 +391,9 @@ static int dvic_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&pdev->dev, "Failed to register panel\n");
goto err_reg;
}
return 0; return 0;
err_reg:
i2c_put_adapter(ddata->i2c_adapter);
mutex_destroy(&ddata->hpd_lock);
return r;
} }
static int __exit dvic_remove(struct platform_device *pdev) static int __exit dvic_remove(struct platform_device *pdev)
...@@ -411,7 +401,7 @@ static int __exit dvic_remove(struct platform_device *pdev) ...@@ -411,7 +401,7 @@ static int __exit dvic_remove(struct platform_device *pdev)
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(&ddata->dssdev); omapdss_device_unregister(&ddata->dssdev);
dvic_disable(dssdev); dvic_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -351,11 +351,7 @@ static int hdmic_probe(struct platform_device *pdev) ...@@ -351,11 +351,7 @@ static int hdmic_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&pdev->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -365,7 +361,7 @@ static int __exit hdmic_remove(struct platform_device *pdev) ...@@ -365,7 +361,7 @@ static int __exit hdmic_remove(struct platform_device *pdev)
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(&ddata->dssdev); omapdss_device_unregister(&ddata->dssdev);
hdmic_disable(dssdev); hdmic_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -219,11 +219,7 @@ static int panel_dpi_probe(struct platform_device *pdev) ...@@ -219,11 +219,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&pdev->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -233,7 +229,7 @@ static int __exit panel_dpi_remove(struct platform_device *pdev) ...@@ -233,7 +229,7 @@ static int __exit panel_dpi_remove(struct platform_device *pdev)
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
panel_dpi_disable(dssdev); panel_dpi_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -1329,11 +1329,7 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1329,11 +1329,7 @@ static int dsicm_probe(struct platform_device *pdev)
OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(dev, "Failed to register panel\n");
goto err_reg;
}
mutex_init(&ddata->lock); mutex_init(&ddata->lock);
...@@ -1404,7 +1400,7 @@ static int __exit dsicm_remove(struct platform_device *pdev) ...@@ -1404,7 +1400,7 @@ static int __exit dsicm_remove(struct platform_device *pdev)
dev_dbg(&pdev->dev, "remove\n"); dev_dbg(&pdev->dev, "remove\n");
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
dsicm_disable(dssdev); dsicm_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -271,11 +271,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) ...@@ -271,11 +271,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&spi->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -285,7 +281,7 @@ static int lb035q02_panel_spi_remove(struct spi_device *spi) ...@@ -285,7 +281,7 @@ static int lb035q02_panel_spi_remove(struct spi_device *spi)
struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
lb035q02_disable(dssdev); lb035q02_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -294,11 +294,7 @@ static int nec_8048_probe(struct spi_device *spi) ...@@ -294,11 +294,7 @@ static int nec_8048_probe(struct spi_device *spi)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&spi->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -310,7 +306,7 @@ static int nec_8048_remove(struct spi_device *spi) ...@@ -310,7 +306,7 @@ static int nec_8048_remove(struct spi_device *spi)
dev_dbg(&ddata->spi->dev, "%s\n", __func__); dev_dbg(&ddata->spi->dev, "%s\n", __func__);
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
nec_8048_disable(dssdev); nec_8048_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -270,11 +270,7 @@ static int sharp_ls_probe(struct platform_device *pdev) ...@@ -270,11 +270,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&pdev->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -284,7 +280,7 @@ static int __exit sharp_ls_remove(struct platform_device *pdev) ...@@ -284,7 +280,7 @@ static int __exit sharp_ls_remove(struct platform_device *pdev)
struct panel_drv_data *ddata = platform_get_drvdata(pdev); struct panel_drv_data *ddata = platform_get_drvdata(pdev);
struct omap_dss_device *dssdev = &ddata->dssdev; struct omap_dss_device *dssdev = &ddata->dssdev;
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
sharp_ls_disable(dssdev); sharp_ls_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -733,7 +733,7 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -733,7 +733,7 @@ static int acx565akm_probe(struct spi_device *spi)
r = devm_gpio_request_one(&spi->dev, ddata->reset_gpio, r = devm_gpio_request_one(&spi->dev, ddata->reset_gpio,
GPIOF_OUT_INIT_LOW, "lcd reset"); GPIOF_OUT_INIT_LOW, "lcd reset");
if (r) if (r)
goto err_gpio; return r;
} }
if (gpio_is_valid(ddata->reset_gpio)) if (gpio_is_valid(ddata->reset_gpio))
...@@ -754,7 +754,7 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -754,7 +754,7 @@ static int acx565akm_probe(struct spi_device *spi)
if (r) { if (r) {
dev_err(&spi->dev, "%s panel detect error\n", __func__); dev_err(&spi->dev, "%s panel detect error\n", __func__);
goto err_detect; return r;
} }
memset(&props, 0, sizeof(props)); memset(&props, 0, sizeof(props));
...@@ -764,17 +764,15 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -764,17 +764,15 @@ static int acx565akm_probe(struct spi_device *spi)
bldev = backlight_device_register("acx565akm", &ddata->spi->dev, bldev = backlight_device_register("acx565akm", &ddata->spi->dev,
ddata, &acx565akm_bl_ops, &props); ddata, &acx565akm_bl_ops, &props);
if (IS_ERR(bldev)) { if (IS_ERR(bldev))
r = PTR_ERR(bldev); return PTR_ERR(bldev);
goto err_reg_bl;
}
ddata->bl_dev = bldev; ddata->bl_dev = bldev;
if (ddata->has_cabc) { if (ddata->has_cabc) {
r = sysfs_create_group(&bldev->dev.kobj, &bldev_attr_group); r = sysfs_create_group(&bldev->dev.kobj, &bldev_attr_group);
if (r) { if (r) {
dev_err(&bldev->dev, dev_err(&bldev->dev,
"%s failed to create sysfs files\n", __func__); "%s failed to create sysfs files\n", __func__);
goto err_sysfs; goto err_backlight_unregister;
} }
ddata->cabc_mode = get_hw_cabc_mode(ddata); ddata->cabc_mode = get_hw_cabc_mode(ddata);
} }
...@@ -801,21 +799,12 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -801,21 +799,12 @@ static int acx565akm_probe(struct spi_device *spi)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&spi->dev, "Failed to register panel\n");
goto err_reg;
}
return 0; return 0;
err_reg: err_backlight_unregister:
sysfs_remove_group(&bldev->dev.kobj, &bldev_attr_group);
err_sysfs:
backlight_device_unregister(bldev); backlight_device_unregister(bldev);
err_reg_bl:
err_detect:
err_gpio:
return r; return r;
} }
...@@ -829,7 +818,7 @@ static int acx565akm_remove(struct spi_device *spi) ...@@ -829,7 +818,7 @@ static int acx565akm_remove(struct spi_device *spi)
sysfs_remove_group(&ddata->bl_dev->dev.kobj, &bldev_attr_group); sysfs_remove_group(&ddata->bl_dev->dev.kobj, &bldev_attr_group);
backlight_device_unregister(ddata->bl_dev); backlight_device_unregister(ddata->bl_dev);
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
acx565akm_disable(dssdev); acx565akm_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -395,11 +395,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ...@@ -395,11 +395,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&spi->dev, "Failed to register panel\n");
return r;
}
return 0; return 0;
} }
...@@ -411,7 +407,7 @@ static int td028ttec1_panel_remove(struct spi_device *spi) ...@@ -411,7 +407,7 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
dev_dbg(&ddata->spi_dev->dev, "%s\n", __func__); dev_dbg(&ddata->spi_dev->dev, "%s\n", __func__);
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
td028ttec1_panel_disable(dssdev); td028ttec1_panel_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -509,8 +509,7 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -509,8 +509,7 @@ static int tpo_td043_probe(struct spi_device *spi)
ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc"); ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
if (IS_ERR(ddata->vcc_reg)) { if (IS_ERR(ddata->vcc_reg)) {
dev_err(&spi->dev, "failed to get LCD VCC regulator\n"); dev_err(&spi->dev, "failed to get LCD VCC regulator\n");
r = PTR_ERR(ddata->vcc_reg); return PTR_ERR(ddata->vcc_reg);
goto err_regulator;
} }
if (gpio_is_valid(ddata->nreset_gpio)) { if (gpio_is_valid(ddata->nreset_gpio)) {
...@@ -519,14 +518,14 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -519,14 +518,14 @@ static int tpo_td043_probe(struct spi_device *spi)
"lcd reset"); "lcd reset");
if (r < 0) { if (r < 0) {
dev_err(&spi->dev, "couldn't request reset GPIO\n"); dev_err(&spi->dev, "couldn't request reset GPIO\n");
goto err_gpio_req; return r;
} }
} }
r = sysfs_create_group(&spi->dev.kobj, &tpo_td043_attr_group); r = sysfs_create_group(&spi->dev.kobj, &tpo_td043_attr_group);
if (r) { if (r) {
dev_err(&spi->dev, "failed to create sysfs files\n"); dev_err(&spi->dev, "failed to create sysfs files\n");
goto err_sysfs; return r;
} }
ddata->vm = tpo_td043_vm; ddata->vm = tpo_td043_vm;
...@@ -538,20 +537,9 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -538,20 +537,9 @@ static int tpo_td043_probe(struct spi_device *spi)
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev); omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); omapdss_device_register(dssdev);
if (r) {
dev_err(&spi->dev, "Failed to register panel\n");
goto err_reg;
}
return 0; return 0;
err_reg:
sysfs_remove_group(&spi->dev.kobj, &tpo_td043_attr_group);
err_sysfs:
err_gpio_req:
err_regulator:
return r;
} }
static int tpo_td043_remove(struct spi_device *spi) static int tpo_td043_remove(struct spi_device *spi)
...@@ -561,7 +549,7 @@ static int tpo_td043_remove(struct spi_device *spi) ...@@ -561,7 +549,7 @@ static int tpo_td043_remove(struct spi_device *spi)
dev_dbg(&ddata->spi->dev, "%s\n", __func__); dev_dbg(&ddata->spi->dev, "%s\n", __func__);
omapdss_unregister_display(dssdev); omapdss_device_unregister(dssdev);
tpo_td043_disable(dssdev); tpo_td043_disable(dssdev);
omapdss_device_disconnect(dssdev, NULL); omapdss_device_disconnect(dssdev, NULL);
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include "omapdss.h" #include "omapdss.h"
static LIST_HEAD(panel_list);
static DEFINE_MUTEX(panel_list_mutex);
static int disp_num_counter; static int disp_num_counter;
void omapdss_display_init(struct omap_dss_device *dssdev) void omapdss_display_init(struct omap_dss_device *dssdev)
...@@ -55,27 +53,6 @@ void omapdss_display_init(struct omap_dss_device *dssdev) ...@@ -55,27 +53,6 @@ void omapdss_display_init(struct omap_dss_device *dssdev)
} }
EXPORT_SYMBOL_GPL(omapdss_display_init); EXPORT_SYMBOL_GPL(omapdss_display_init);
int omapdss_register_display(struct omap_dss_device *dssdev)
{
mutex_lock(&panel_list_mutex);
list_add_tail(&dssdev->panel_list, &panel_list);
mutex_unlock(&panel_list_mutex);
omapdss_device_register(dssdev);
return 0;
}
EXPORT_SYMBOL(omapdss_register_display);
void omapdss_unregister_display(struct omap_dss_device *dssdev)
{
mutex_lock(&panel_list_mutex);
list_del(&dssdev->panel_list);
mutex_unlock(&panel_list_mutex);
omapdss_device_register(dssdev);
}
EXPORT_SYMBOL(omapdss_unregister_display);
struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev) struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev)
{ {
if (!try_module_get(dssdev->owner)) if (!try_module_get(dssdev->owner))
......
...@@ -395,7 +395,6 @@ struct omap_dss_device { ...@@ -395,7 +395,6 @@ struct omap_dss_device {
struct omap_dss_device *dst; struct omap_dss_device *dst;
struct list_head list; struct list_head list;
struct list_head panel_list;
unsigned int alias_id; unsigned int alias_id;
...@@ -488,8 +487,6 @@ static inline bool omapdss_is_initialized(void) ...@@ -488,8 +487,6 @@ static inline bool omapdss_is_initialized(void)
} }
void omapdss_display_init(struct omap_dss_device *dssdev); void omapdss_display_init(struct omap_dss_device *dssdev);
int omapdss_register_display(struct omap_dss_device *dssdev);
void omapdss_unregister_display(struct omap_dss_device *dssdev);
#define for_each_dss_display(d) \ #define for_each_dss_display(d) \
while ((d = omapdss_device_get_next(d, true)) != NULL) while ((d = omapdss_device_get_next(d, true)) != NULL)
......
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