aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-06 02:50:52 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-03-19 05:03:06 -0400
commita6ec216493da705a5f6fc96098c5f4af10e2be44 (patch)
tree477a2d01597b2e1c84e987a6c255ecf71a31441d
parent4b13defce85d4e3cbd7ddfd701856a78772de373 (diff)
OMAPFB: search for default display with DT alias
Improve the search for the default display in two ways: * compare the given display name to the display's alias * if no display name is given, look for "display0" DT alias Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Archit Taneja <archit@ti.com>
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index b7469636f15c..f121e87b30be 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2423,7 +2423,10 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
2423 const char *def_name; 2423 const char *def_name;
2424 int i; 2424 int i;
2425 2425
2426 /* search with the display name from the user or the board file */ 2426 /*
2427 * Search with the display name from the user or the board file,
2428 * comparing to display names and aliases
2429 */
2427 2430
2428 def_name = omapdss_get_default_display_name(); 2431 def_name = omapdss_get_default_display_name();
2429 2432
@@ -2435,12 +2438,30 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
2435 2438
2436 if (dssdev->name && strcmp(def_name, dssdev->name) == 0) 2439 if (dssdev->name && strcmp(def_name, dssdev->name) == 0)
2437 return dssdev; 2440 return dssdev;
2441
2442 if (strcmp(def_name, dssdev->alias) == 0)
2443 return dssdev;
2438 } 2444 }
2439 2445
2440 /* def_name given but not found */ 2446 /* def_name given but not found */
2441 return NULL; 2447 return NULL;
2442 } 2448 }
2443 2449
2450 /* then look for DT alias display0 */
2451 for (i = 0; i < fbdev->num_displays; ++i) {
2452 struct omap_dss_device *dssdev;
2453 int id;
2454
2455 dssdev = fbdev->displays[i].dssdev;
2456
2457 if (dssdev->dev->of_node == NULL)
2458 continue;
2459
2460 id = of_alias_get_id(dssdev->dev->of_node, "display");
2461 if (id == 0)
2462 return dssdev;
2463 }
2464
2444 /* return the first display we have in the list */ 2465 /* return the first display we have in the list */
2445 return fbdev->displays[0].dssdev; 2466 return fbdev->displays[0].dssdev;
2446} 2467}