diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-08-06 02:41:32 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-03-19 05:03:04 -0400 |
commit | 7f2bcd06558a40deecd4a294acbd0b3f659be911 (patch) | |
tree | 873cfa17c0605da4504255902c9fee4a48586752 /drivers/video/omap2 | |
parent | 6a0e6b3872f09550bf8e0587d375940092580360 (diff) |
OMAPDSS: add 'label' support for DT
Add support to get the label (i.e. a "nickname") for a display from the
DT data. If there is no label defined, use the display's alias (e.g.
'display0') as a name.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/display.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 669a81fdf58e..012ada38a29d 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/jiffies.h> | 27 | #include <linux/jiffies.h> |
28 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
29 | #include <linux/of.h> | ||
29 | 30 | ||
30 | #include <video/omapdss.h> | 31 | #include <video/omapdss.h> |
31 | #include "dss.h" | 32 | #include "dss.h" |
@@ -137,6 +138,14 @@ int omapdss_register_display(struct omap_dss_device *dssdev) | |||
137 | snprintf(dssdev->alias, sizeof(dssdev->alias), | 138 | snprintf(dssdev->alias, sizeof(dssdev->alias), |
138 | "display%d", disp_num_counter++); | 139 | "display%d", disp_num_counter++); |
139 | 140 | ||
141 | /* Use 'label' property for name, if it exists */ | ||
142 | if (dssdev->dev->of_node) | ||
143 | of_property_read_string(dssdev->dev->of_node, "label", | ||
144 | &dssdev->name); | ||
145 | |||
146 | if (dssdev->name == NULL) | ||
147 | dssdev->name = dssdev->alias; | ||
148 | |||
140 | if (drv && drv->get_resolution == NULL) | 149 | if (drv && drv->get_resolution == NULL) |
141 | drv->get_resolution = omapdss_default_get_resolution; | 150 | drv->get_resolution = omapdss_default_get_resolution; |
142 | if (drv && drv->get_recommended_bpp == NULL) | 151 | if (drv && drv->get_recommended_bpp == NULL) |