mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-09 11:00:52 +00:00
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>
This commit is contained in:
parent
4b13defce8
commit
a6ec216493
@ -2423,7 +2423,10 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
|
|||||||
const char *def_name;
|
const char *def_name;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* search with the display name from the user or the board file */
|
/*
|
||||||
|
* Search with the display name from the user or the board file,
|
||||||
|
* comparing to display names and aliases
|
||||||
|
*/
|
||||||
|
|
||||||
def_name = omapdss_get_default_display_name();
|
def_name = omapdss_get_default_display_name();
|
||||||
|
|
||||||
@ -2435,12 +2438,30 @@ omapfb_find_default_display(struct omapfb2_device *fbdev)
|
|||||||
|
|
||||||
if (dssdev->name && strcmp(def_name, dssdev->name) == 0)
|
if (dssdev->name && strcmp(def_name, dssdev->name) == 0)
|
||||||
return dssdev;
|
return dssdev;
|
||||||
|
|
||||||
|
if (strcmp(def_name, dssdev->alias) == 0)
|
||||||
|
return dssdev;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* def_name given but not found */
|
/* def_name given but not found */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* then look for DT alias display0 */
|
||||||
|
for (i = 0; i < fbdev->num_displays; ++i) {
|
||||||
|
struct omap_dss_device *dssdev;
|
||||||
|
int id;
|
||||||
|
|
||||||
|
dssdev = fbdev->displays[i].dssdev;
|
||||||
|
|
||||||
|
if (dssdev->dev->of_node == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
id = of_alias_get_id(dssdev->dev->of_node, "display");
|
||||||
|
if (id == 0)
|
||||||
|
return dssdev;
|
||||||
|
}
|
||||||
|
|
||||||
/* return the first display we have in the list */
|
/* return the first display we have in the list */
|
||||||
return fbdev->displays[0].dssdev;
|
return fbdev->displays[0].dssdev;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user