Lines Matching +full:bcm2835 +full:- +full:pm
1 // SPDX-License-Identifier: GPL-2.0+
3 * PM MFD driver for Broadcom BCM2835
5 * This driver binds to the PM block and creates the MFD device for
11 #include <linux/mfd/bcm2835-pm.h>
21 { .name = "bcm2835-wdt" },
25 { .name = "bcm2835-power" },
29 struct bcm2835_pm *pm) in bcm2835_pm_get_pdata() argument
31 if (of_property_present(pm->dev->of_node, "reg-names")) { in bcm2835_pm_get_pdata()
34 pm->base = devm_platform_ioremap_resource_byname(pdev, "pm"); in bcm2835_pm_get_pdata()
35 if (IS_ERR(pm->base)) in bcm2835_pm_get_pdata()
36 return PTR_ERR(pm->base); in bcm2835_pm_get_pdata()
40 pm->asb = devm_ioremap_resource(&pdev->dev, res); in bcm2835_pm_get_pdata()
41 if (IS_ERR(pm->asb)) in bcm2835_pm_get_pdata()
42 pm->asb = NULL; in bcm2835_pm_get_pdata()
48 pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res); in bcm2835_pm_get_pdata()
49 if (IS_ERR(pm->rpivid_asb)) in bcm2835_pm_get_pdata()
50 pm->rpivid_asb = NULL; in bcm2835_pm_get_pdata()
56 /* If no 'reg-names' property is found we can assume we're using old DTB. */ in bcm2835_pm_get_pdata()
57 pm->base = devm_platform_ioremap_resource(pdev, 0); in bcm2835_pm_get_pdata()
58 if (IS_ERR(pm->base)) in bcm2835_pm_get_pdata()
59 return PTR_ERR(pm->base); in bcm2835_pm_get_pdata()
61 pm->asb = devm_platform_ioremap_resource(pdev, 1); in bcm2835_pm_get_pdata()
62 if (IS_ERR(pm->asb)) in bcm2835_pm_get_pdata()
63 pm->asb = NULL; in bcm2835_pm_get_pdata()
65 pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2); in bcm2835_pm_get_pdata()
66 if (IS_ERR(pm->rpivid_asb)) in bcm2835_pm_get_pdata()
67 pm->rpivid_asb = NULL; in bcm2835_pm_get_pdata()
74 struct device *dev = &pdev->dev; in bcm2835_pm_probe()
75 struct bcm2835_pm *pm; in bcm2835_pm_probe() local
78 pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL); in bcm2835_pm_probe()
79 if (!pm) in bcm2835_pm_probe()
80 return -ENOMEM; in bcm2835_pm_probe()
81 platform_set_drvdata(pdev, pm); in bcm2835_pm_probe()
83 pm->dev = dev; in bcm2835_pm_probe()
85 ret = bcm2835_pm_get_pdata(pdev, pm); in bcm2835_pm_probe()
89 ret = devm_mfd_add_devices(dev, -1, in bcm2835_pm_probe()
97 * bcm2835-pm binding as the key for whether we can reference in bcm2835_pm_probe()
98 * the full PM register range and support power domains. in bcm2835_pm_probe()
100 if (pm->asb) in bcm2835_pm_probe()
101 return devm_mfd_add_devices(dev, -1, bcm2835_power_devs, in bcm2835_pm_probe()
108 { .compatible = "brcm,bcm2835-pm-wdt", },
109 { .compatible = "brcm,bcm2835-pm", },
110 { .compatible = "brcm,bcm2711-pm", },
118 .name = "bcm2835-pm",
125 MODULE_DESCRIPTION("Driver for Broadcom BCM2835 PM MFD");