Skip to content

Commit eda080e

Browse files
committed
drivers: bus: simple-pm-bus: Fix compatibility with simple-bus for auxdata
After converting am335x to probe devices with simple-pm-bus I noticed that we are not passing auxdata for of_platform_populate() like we do with simple-bus. While device tree using SoCs should no longer need platform data, there are still quite a few drivers that still need it as can be seen with git grep OF_DEV_AUXDATA. We want to have simple-pm-bus be usable as a replacement for simple-bus also for cases where OF_DEV_AUXDATA is still needed. Let's fix the issue by passing auxdata as platform data to simple-pm-bus. That way the SoCs needing this can pass the auxdata with OF_DEV_AUXDATA. And let's pass the auxdata for omaps to fix the issue for am335x. As an alternative solution, adding simple-pm-bus handling directly to drivers/of/platform.c was considered, but we would still need simple-pm-bus device driver. So passing auxdata as platform data seems like the simplest solution. Fixes: 5a23052 ("ARM: dts: Use simple-pm-bus for genpd for am3 l4_wkup") Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 2a39af3 commit eda080e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

arch/arm/mach-omap2/pdata-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {
522522
&dra7_ipu1_dsp_iommu_pdata),
523523
#endif
524524
/* Common auxdata */
525+
OF_DEV_AUXDATA("simple-pm-bus", 0, NULL, omap_auxdata_lookup),
525526
OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
526527
OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
527528
OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata),

drivers/bus/simple-pm-bus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616

1717
static int simple_pm_bus_probe(struct platform_device *pdev)
1818
{
19+
const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev);
1920
struct device_node *np = pdev->dev.of_node;
2021

2122
dev_dbg(&pdev->dev, "%s\n", __func__);
2223

2324
pm_runtime_enable(&pdev->dev);
2425

2526
if (np)
26-
of_platform_populate(np, NULL, NULL, &pdev->dev);
27+
of_platform_populate(np, NULL, lookup, &pdev->dev);
2728

2829
return 0;
2930
}

0 commit comments

Comments
 (0)