aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-23 08:05:10 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:14 -0400
commit4e17763c321f085e40e1fabef9677628d0fb84fe (patch)
treec2f1184f0c3eb4efd3fb6630003d126087ebc6b7
parent30b71761957c541cd9dfd6cd10e3feb21a8ddca1 (diff)
drm/omap: Whitelist DT nodes to fixup with omapdss, prefix
The omapdss driver patches DT at runtime to prepend an "omapdss," prefix to the compatible string of all encoders, panels and connectors. This mechanism ensures they get bound to the omapdss-specific drivers instead of generic drivers. Now that we have drm_bridge support in omapdrm, we need to selectively disable this mechanism. Add a whitelist of compatible strings to patch, and fill it with all the devices we support. They will be removed one by one once corresponding drm_bridge drivers become available and get successfully tested with omapdrm. The omapdss components load check code is updated accordingly to ignore devices managed by external bridge drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/dss/base.c20
-rw-r--r--drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c21
2 files changed, 33 insertions, 8 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 3c088cd2ceab..f8dad99013e8 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -303,6 +303,7 @@ struct omapdss_comp_node {
303 struct list_head list; 303 struct list_head list;
304 struct device_node *node; 304 struct device_node *node;
305 bool dss_core_component; 305 bool dss_core_component;
306 const char *compat;
306}; 307};
307 308
308static bool omapdss_list_contains(const struct device_node *node) 309static bool omapdss_list_contains(const struct device_node *node)
@@ -320,13 +321,20 @@ static bool omapdss_list_contains(const struct device_node *node)
320static void omapdss_walk_device(struct device *dev, struct device_node *node, 321static void omapdss_walk_device(struct device *dev, struct device_node *node,
321 bool dss_core) 322 bool dss_core)
322{ 323{
324 struct omapdss_comp_node *comp;
323 struct device_node *n; 325 struct device_node *n;
324 struct omapdss_comp_node *comp = devm_kzalloc(dev, sizeof(*comp), 326 const char *compat;
325 GFP_KERNEL); 327 int ret;
328
329 ret = of_property_read_string(node, "compatible", &compat);
330 if (ret < 0)
331 return;
326 332
333 comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
327 if (comp) { 334 if (comp) {
328 comp->node = node; 335 comp->node = node;
329 comp->dss_core_component = dss_core; 336 comp->dss_core_component = dss_core;
337 comp->compat = compat;
330 list_add(&comp->list, &omapdss_comp_list); 338 list_add(&comp->list, &omapdss_comp_list);
331 } 339 }
332 340
@@ -366,12 +374,8 @@ void omapdss_gather_components(struct device *dev)
366 374
367 omapdss_walk_device(dev, dev->of_node, true); 375 omapdss_walk_device(dev, dev->of_node, true);
368 376
369 for_each_available_child_of_node(dev->of_node, child) { 377 for_each_available_child_of_node(dev->of_node, child)
370 if (!of_find_property(child, "compatible", NULL))
371 continue;
372
373 omapdss_walk_device(dev, child, true); 378 omapdss_walk_device(dev, child, true);
374 }
375} 379}
376EXPORT_SYMBOL(omapdss_gather_components); 380EXPORT_SYMBOL(omapdss_gather_components);
377 381
@@ -379,6 +383,8 @@ static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp)
379{ 383{
380 if (comp->dss_core_component) 384 if (comp->dss_core_component)
381 return true; 385 return true;
386 if (!strstarts(comp->compat, "omapdss,"))
387 return true;
382 if (omapdss_device_is_registered(comp->node)) 388 if (omapdss_device_is_registered(comp->node))
383 return true; 389 return true;
384 390
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
index 3bfb95d230e0..309b7b453e98 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c
@@ -184,6 +184,25 @@ static const struct of_device_id omapdss_of_match[] __initconst = {
184 {}, 184 {},
185}; 185};
186 186
187static const struct of_device_id omapdss_of_fixups_whitelist[] __initconst = {
188 { .compatible = "composite-video-connector" },
189 { .compatible = "dvi-connector" },
190 { .compatible = "hdmi-connector" },
191 { .compatible = "lgphilips,lb035q02" },
192 { .compatible = "nec,nl8048hl11" },
193 { .compatible = "panel-dpi" },
194 { .compatible = "panel-dsi-cm" },
195 { .compatible = "sharp,ls037v7dw01" },
196 { .compatible = "sony,acx565akm" },
197 { .compatible = "svideo-connector" },
198 { .compatible = "ti,opa362" },
199 { .compatible = "ti,tfp410" },
200 { .compatible = "ti,tpd12s015" },
201 { .compatible = "toppoly,td028ttec1" },
202 { .compatible = "tpo,td028ttec1" },
203 { .compatible = "tpo,td043mtea1" },
204};
205
187static int __init omapdss_boot_init(void) 206static int __init omapdss_boot_init(void)
188{ 207{
189 struct device_node *dss, *child; 208 struct device_node *dss, *child;
@@ -210,7 +229,7 @@ static int __init omapdss_boot_init(void)
210 n = list_first_entry(&dss_conv_list, struct dss_conv_node, 229 n = list_first_entry(&dss_conv_list, struct dss_conv_node,
211 list); 230 list);
212 231
213 if (!n->root) 232 if (of_match_node(omapdss_of_fixups_whitelist, n->node))
214 omapdss_omapify_node(n->node); 233 omapdss_omapify_node(n->node);
215 234
216 list_del(&n->list); 235 list_del(&n->list);