Commit 4e0bb06c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: dss: Split omapdss_register_display()

Split the function into omapdss_display_init() to perform
display-specific initialization of the omap_dss_device, and
omapdss_register_display() to register the device. The latter will then
be replaced by more generic registration.
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 b9f4d2eb
...@@ -171,6 +171,7 @@ static int tvc_probe(struct platform_device *pdev) ...@@ -171,6 +171,7 @@ static int tvc_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_VENC; dssdev->type = OMAP_DISPLAY_TYPE_VENC;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register panel\n"); dev_err(&pdev->dev, "Failed to register panel\n");
......
...@@ -390,6 +390,7 @@ static int dvic_probe(struct platform_device *pdev) ...@@ -390,6 +390,7 @@ static int dvic_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_DVI; dssdev->type = OMAP_DISPLAY_TYPE_DVI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register panel\n"); dev_err(&pdev->dev, "Failed to register panel\n");
......
...@@ -350,6 +350,7 @@ static int hdmic_probe(struct platform_device *pdev) ...@@ -350,6 +350,7 @@ static int hdmic_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_HDMI; dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register panel\n"); dev_err(&pdev->dev, "Failed to register panel\n");
......
...@@ -218,6 +218,7 @@ static int panel_dpi_probe(struct platform_device *pdev) ...@@ -218,6 +218,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register panel\n"); dev_err(&pdev->dev, "Failed to register panel\n");
......
...@@ -1328,6 +1328,7 @@ static int dsicm_probe(struct platform_device *pdev) ...@@ -1328,6 +1328,7 @@ static int dsicm_probe(struct platform_device *pdev)
dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE | dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
OMAP_DSS_DISPLAY_CAP_TEAR_ELIM; OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(dev, "Failed to register panel\n"); dev_err(dev, "Failed to register panel\n");
......
...@@ -270,6 +270,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) ...@@ -270,6 +270,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&spi->dev, "Failed to register panel\n"); dev_err(&spi->dev, "Failed to register panel\n");
......
...@@ -293,6 +293,7 @@ static int nec_8048_probe(struct spi_device *spi) ...@@ -293,6 +293,7 @@ static int nec_8048_probe(struct spi_device *spi)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&spi->dev, "Failed to register panel\n"); dev_err(&spi->dev, "Failed to register panel\n");
......
...@@ -269,6 +269,7 @@ static int sharp_ls_probe(struct platform_device *pdev) ...@@ -269,6 +269,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&pdev->dev, "Failed to register panel\n"); dev_err(&pdev->dev, "Failed to register panel\n");
......
...@@ -800,6 +800,7 @@ static int acx565akm_probe(struct spi_device *spi) ...@@ -800,6 +800,7 @@ static int acx565akm_probe(struct spi_device *spi)
dssdev->type = OMAP_DISPLAY_TYPE_SDI; dssdev->type = OMAP_DISPLAY_TYPE_SDI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&spi->dev, "Failed to register panel\n"); dev_err(&spi->dev, "Failed to register panel\n");
......
...@@ -394,6 +394,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ...@@ -394,6 +394,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&spi->dev, "Failed to register panel\n"); dev_err(&spi->dev, "Failed to register panel\n");
......
...@@ -537,6 +537,7 @@ static int tpo_td043_probe(struct spi_device *spi) ...@@ -537,6 +537,7 @@ static int tpo_td043_probe(struct spi_device *spi)
dssdev->type = OMAP_DISPLAY_TYPE_DPI; dssdev->type = OMAP_DISPLAY_TYPE_DPI;
dssdev->owner = THIS_MODULE; dssdev->owner = THIS_MODULE;
omapdss_display_init(dssdev);
r = omapdss_register_display(dssdev); r = omapdss_register_display(dssdev);
if (r) { if (r) {
dev_err(&spi->dev, "Failed to register panel\n"); dev_err(&spi->dev, "Failed to register panel\n");
......
...@@ -32,7 +32,7 @@ static LIST_HEAD(panel_list); ...@@ -32,7 +32,7 @@ static LIST_HEAD(panel_list);
static DEFINE_MUTEX(panel_list_mutex); static DEFINE_MUTEX(panel_list_mutex);
static int disp_num_counter; static int disp_num_counter;
int omapdss_register_display(struct omap_dss_device *dssdev) void omapdss_display_init(struct omap_dss_device *dssdev)
{ {
int id; int id;
...@@ -52,7 +52,11 @@ int omapdss_register_display(struct omap_dss_device *dssdev) ...@@ -52,7 +52,11 @@ int omapdss_register_display(struct omap_dss_device *dssdev)
if (dssdev->name == NULL) if (dssdev->name == NULL)
dssdev->name = devm_kasprintf(dssdev->dev, GFP_KERNEL, dssdev->name = devm_kasprintf(dssdev->dev, GFP_KERNEL,
"display%u", id); "display%u", id);
}
EXPORT_SYMBOL_GPL(omapdss_display_init);
int omapdss_register_display(struct omap_dss_device *dssdev)
{
mutex_lock(&panel_list_mutex); mutex_lock(&panel_list_mutex);
list_add_tail(&dssdev->panel_list, &panel_list); list_add_tail(&dssdev->panel_list, &panel_list);
mutex_unlock(&panel_list_mutex); mutex_unlock(&panel_list_mutex);
......
...@@ -487,6 +487,7 @@ static inline bool omapdss_is_initialized(void) ...@@ -487,6 +487,7 @@ static inline bool omapdss_is_initialized(void)
return !!omapdss_get_dss(); return !!omapdss_get_dss();
} }
void omapdss_display_init(struct omap_dss_device *dssdev);
int omapdss_register_display(struct omap_dss_device *dssdev); int omapdss_register_display(struct omap_dss_device *dssdev);
void omapdss_unregister_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) \
......
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