aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/dss
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-11-10 06:16:51 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-11-12 04:50:13 -0500
commite0c827aca0730b51f38081aa4e8ecf0912aab55f (patch)
tree42c304076e53e801b6e46eaf9d83dab95e38fc8f /drivers/gpu/drm/omapdrm/dss
parent23d8003907d094f77cf959228e2248d6db819fa7 (diff)
drm/omap: Populate DSS children in omapdss driver
The DSS DT node contains children that describe the DSS components (DISPC and internal encoders). Each of those components is handled by a platform driver, and thus needs to be backed by a platform device. The corresponding platform devices are created in mach-omap2 code by a call to of_platform_populate(). While this approach has worked so far, it doesn't model the hardware architecture very well, as it creates child devices before the parent is ready to handle them. This would be akin to creating I2C slaves before the I2C master is available. The task can be easily performed in the omapdss driver code instead, simplifying mach-omap2 code. We however can't remove the mach-omap2 code completely as the omap2fb driver still depends on it, but we can move it to the omap2fb-specific section, where it can stay until the omap2fb driver gets removed. This has the added benefit of not allowing DSS components to probe before the DSS itself, which led to runtime PM issues when the DSS probe is deferred. Fixes: 27d624527d99 ("drm/omap: dss: Acquire next dssdev at probe time") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181110111654.4387-2-laurent.pinchart@ideasonboard.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 1aaf260aa9b8..7553c7fc1c45 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1484,16 +1484,23 @@ static int dss_probe(struct platform_device *pdev)
1484 dss); 1484 dss);
1485 1485
1486 /* Add all the child devices as components. */ 1486 /* Add all the child devices as components. */
1487 r = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
1488 if (r)
1489 goto err_uninit_debugfs;
1490
1487 omapdss_gather_components(&pdev->dev); 1491 omapdss_gather_components(&pdev->dev);
1488 1492
1489 device_for_each_child(&pdev->dev, &match, dss_add_child_component); 1493 device_for_each_child(&pdev->dev, &match, dss_add_child_component);
1490 1494
1491 r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); 1495 r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match);
1492 if (r) 1496 if (r)
1493 goto err_uninit_debugfs; 1497 goto err_of_depopulate;
1494 1498
1495 return 0; 1499 return 0;
1496 1500
1501err_of_depopulate:
1502 of_platform_depopulate(&pdev->dev);
1503
1497err_uninit_debugfs: 1504err_uninit_debugfs:
1498 dss_debugfs_remove_file(dss->debugfs.clk); 1505 dss_debugfs_remove_file(dss->debugfs.clk);
1499 dss_debugfs_remove_file(dss->debugfs.dss); 1506 dss_debugfs_remove_file(dss->debugfs.dss);
@@ -1522,6 +1529,8 @@ static int dss_remove(struct platform_device *pdev)
1522{ 1529{
1523 struct dss_device *dss = platform_get_drvdata(pdev); 1530 struct dss_device *dss = platform_get_drvdata(pdev);
1524 1531
1532 of_platform_depopulate(&pdev->dev);
1533
1525 component_master_del(&pdev->dev, &dss_component_ops); 1534 component_master_del(&pdev->dev, &dss_component_ops);
1526 1535
1527 dss_debugfs_remove_file(dss->debugfs.clk); 1536 dss_debugfs_remove_file(dss->debugfs.clk);