summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/display.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-16 17:45:26 +0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 15:00:48 +0400
commit2e7e3dc79492953c2c1192d8d4129ac86ee70aec (patch)
tree3d79db98c7697e285267248b404c4e05e03835d4 /drivers/video/omap2/dss/display.c
parent7ae9a71e09d098deecce1140acf4f5e529211270 (diff)
downloadlinux-2e7e3dc79492953c2c1192d8d4129ac86ee70aec.tar.xz
OMAPDSS: add panel list
We currently use the omapdss bus (which contains all the available displays) to iterate the displays. As the omapdss bus is on its way out, this needs to be changed. Instead of using the dss bus to iterate displays, this patch adds our own list of displays which we manage. The panels on the dss bus are automatically added to this new list. An "alias" field is also added to omap_dss_device. This field is set to "display%d", the same way as omap_dss_device's dev name is set. This alias is later used to keep backward compatibility, when the embedded dev is no longer used. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/display.c')
-rw-r--r--drivers/video/omap2/dss/display.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 72ac058a56d3..1c175a4e7f6b 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -146,6 +146,38 @@ void dss_disable_all_devices(void)
bus_for_each_dev(bus, NULL, NULL, dss_disable_device);
}
+static LIST_HEAD(panel_list);
+static DEFINE_MUTEX(panel_list_mutex);
+static int disp_num_counter;
+
+int omapdss_register_display(struct omap_dss_device *dssdev)
+{
+ struct omap_dss_driver *drv = dssdev->driver;
+
+ snprintf(dssdev->alias, sizeof(dssdev->alias),
+ "display%d", disp_num_counter++);
+
+ if (drv && drv->get_resolution == NULL)
+ drv->get_resolution = omapdss_default_get_resolution;
+ if (drv && drv->get_recommended_bpp == NULL)
+ drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
+ if (drv && drv->get_timings == NULL)
+ drv->get_timings = omapdss_default_get_timings;
+
+ mutex_lock(&panel_list_mutex);
+ list_add_tail(&dssdev->panel_list, &panel_list);
+ mutex_unlock(&panel_list_mutex);
+ 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);
+}
+EXPORT_SYMBOL(omapdss_unregister_display);
void omap_dss_get_device(struct omap_dss_device *dssdev)
{