diff options
-rw-r--r-- | drivers/video/omap2/dss/core.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 32 | ||||
-rw-r--r-- | include/video/omapdss.h | 8 |
3 files changed, 42 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 7b2df2ff5667..17b52343f74c 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -477,6 +477,7 @@ struct omap_dss_device *dss_alloc_and_init_device(struct device *parent) | |||
477 | 477 | ||
478 | int dss_add_device(struct omap_dss_device *dssdev) | 478 | int dss_add_device(struct omap_dss_device *dssdev) |
479 | { | 479 | { |
480 | omapdss_register_display(dssdev); | ||
480 | return device_add(&dssdev->dev); | 481 | return device_add(&dssdev->dev); |
481 | } | 482 | } |
482 | 483 | ||
@@ -488,6 +489,7 @@ void dss_put_device(struct omap_dss_device *dssdev) | |||
488 | void dss_unregister_device(struct omap_dss_device *dssdev) | 489 | void dss_unregister_device(struct omap_dss_device *dssdev) |
489 | { | 490 | { |
490 | device_unregister(&dssdev->dev); | 491 | device_unregister(&dssdev->dev); |
492 | omapdss_unregister_display(dssdev); | ||
491 | } | 493 | } |
492 | 494 | ||
493 | static int dss_unregister_dss_dev(struct device *dev, void *data) | 495 | static int dss_unregister_dss_dev(struct device *dev, void *data) |
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) | |||
146 | bus_for_each_dev(bus, NULL, NULL, dss_disable_device); | 146 | bus_for_each_dev(bus, NULL, NULL, dss_disable_device); |
147 | } | 147 | } |
148 | 148 | ||
149 | static LIST_HEAD(panel_list); | ||
150 | static DEFINE_MUTEX(panel_list_mutex); | ||
151 | static int disp_num_counter; | ||
152 | |||
153 | int omapdss_register_display(struct omap_dss_device *dssdev) | ||
154 | { | ||
155 | struct omap_dss_driver *drv = dssdev->driver; | ||
156 | |||
157 | snprintf(dssdev->alias, sizeof(dssdev->alias), | ||
158 | "display%d", disp_num_counter++); | ||
159 | |||
160 | if (drv && drv->get_resolution == NULL) | ||
161 | drv->get_resolution = omapdss_default_get_resolution; | ||
162 | if (drv && drv->get_recommended_bpp == NULL) | ||
163 | drv->get_recommended_bpp = omapdss_default_get_recommended_bpp; | ||
164 | if (drv && drv->get_timings == NULL) | ||
165 | drv->get_timings = omapdss_default_get_timings; | ||
166 | |||
167 | mutex_lock(&panel_list_mutex); | ||
168 | list_add_tail(&dssdev->panel_list, &panel_list); | ||
169 | mutex_unlock(&panel_list_mutex); | ||
170 | return 0; | ||
171 | } | ||
172 | EXPORT_SYMBOL(omapdss_register_display); | ||
173 | |||
174 | void omapdss_unregister_display(struct omap_dss_device *dssdev) | ||
175 | { | ||
176 | mutex_lock(&panel_list_mutex); | ||
177 | list_del(&dssdev->panel_list); | ||
178 | mutex_unlock(&panel_list_mutex); | ||
179 | } | ||
180 | EXPORT_SYMBOL(omapdss_unregister_display); | ||
149 | 181 | ||
150 | void omap_dss_get_device(struct omap_dss_device *dssdev) | 182 | void omap_dss_get_device(struct omap_dss_device *dssdev) |
151 | { | 183 | { |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 0324c7b8a3e0..ee1645336fc4 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -598,6 +598,11 @@ struct omap_dss_output { | |||
598 | struct omap_dss_device { | 598 | struct omap_dss_device { |
599 | struct device dev; | 599 | struct device dev; |
600 | 600 | ||
601 | struct list_head panel_list; | ||
602 | |||
603 | /* alias in the form of "display%d" */ | ||
604 | char alias[16]; | ||
605 | |||
601 | enum omap_display_type type; | 606 | enum omap_display_type type; |
602 | 607 | ||
603 | /* obsolete, to be removed */ | 608 | /* obsolete, to be removed */ |
@@ -759,6 +764,9 @@ bool omapdss_is_initialized(void); | |||
759 | int omap_dss_register_driver(struct omap_dss_driver *); | 764 | int omap_dss_register_driver(struct omap_dss_driver *); |
760 | void omap_dss_unregister_driver(struct omap_dss_driver *); | 765 | void omap_dss_unregister_driver(struct omap_dss_driver *); |
761 | 766 | ||
767 | int omapdss_register_display(struct omap_dss_device *dssdev); | ||
768 | void omapdss_unregister_display(struct omap_dss_device *dssdev); | ||
769 | |||
762 | void omap_dss_get_device(struct omap_dss_device *dssdev); | 770 | void omap_dss_get_device(struct omap_dss_device *dssdev); |
763 | void omap_dss_put_device(struct omap_dss_device *dssdev); | 771 | void omap_dss_put_device(struct omap_dss_device *dssdev); |
764 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) | 772 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) |