Commit c90ba34216fcb6dd0fd1f21d9adee53c97a38581

Authored by Dan Murphy

Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-lin…

…ux-kernel/audio-display-linux-feature-tree into ti-linux-3.14.y

TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  drm/omap: ensure all displays have been probed

Signed-off-by: Dan Murphy <DMurphy@ti.com>

Showing 1 changed file Side-by-side Diff

drivers/gpu/drm/omapdrm/omap_drv.c
... ... @@ -94,11 +94,38 @@
94 94 dssdev->driver->disconnect(dssdev);
95 95 }
96 96  
  97 +static bool dssdev_with_alias_exists(const char *alias)
  98 +{
  99 + struct omap_dss_device *dssdev = NULL;
  100 +
  101 + for_each_dss_dev(dssdev) {
  102 + if (strcmp(alias, dssdev->alias) == 0) {
  103 + omap_dss_put_device(dssdev);
  104 + return true;
  105 + }
  106 + }
  107 +
  108 + return false;
  109 +}
  110 +
97 111 static int omap_connect_dssdevs(void)
98 112 {
99 113 int r;
100 114 struct omap_dss_device *dssdev = NULL;
101 115 bool no_displays = true;
  116 + struct device_node *aliases;
  117 + struct property *pp;
  118 +
  119 + aliases = of_find_node_by_path("/aliases");
  120 + if (aliases) {
  121 + for_each_property_of_node(aliases, pp) {
  122 + if (strncmp(pp->name, "display", 7) != 0)
  123 + continue;
  124 +
  125 + if (dssdev_with_alias_exists(pp->name) == false)
  126 + return -EPROBE_DEFER;
  127 + }
  128 + }
102 129  
103 130 for_each_dss_dev(dssdev) {
104 131 r = dssdev->driver->connect(dssdev);