Skip to content

Commit a12650e

Browse files
pelwellpopcornmix
authored andcommitted
mfd: bcm2835-pm: Add support for BCM2712
BCM2712 lacks the "asb" and "rpivid_asb" register ranges, but still requires the use of the bcm2835-power driver to reset the V3D block. Signed-off-by: Phil Elwell <[email protected]>
1 parent 60e63b5 commit a12650e

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

drivers/mfd/bcm2835-pm.c

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,30 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev,
6969
return 0;
7070
}
7171

72+
static const struct of_device_id bcm2835_pm_of_match[] = {
73+
{ .compatible = "brcm,bcm2835-pm-wdt", },
74+
{ .compatible = "brcm,bcm2835-pm", },
75+
{ .compatible = "brcm,bcm2711-pm", },
76+
{ .compatible = "brcm,bcm2712-pm", .data = (const void *)1},
77+
{},
78+
};
79+
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
80+
7281
static int bcm2835_pm_probe(struct platform_device *pdev)
7382
{
83+
const struct of_device_id *of_id;
7484
struct device *dev = &pdev->dev;
7585
struct bcm2835_pm *pm;
86+
bool is_2712;
7687
int ret;
7788

89+
of_id = of_match_node(bcm2835_pm_of_match, pdev->dev.of_node);
90+
if (!of_id) {
91+
dev_err(&pdev->dev, "Failed to match compatible string\n");
92+
return -EINVAL;
93+
}
94+
is_2712 = !!of_id->data;
95+
7896
pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL);
7997
if (!pm)
8098
return -ENOMEM;
@@ -97,22 +115,13 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
97115
* bcm2835-pm binding as the key for whether we can reference
98116
* the full PM register range and support power domains.
99117
*/
100-
if (pm->asb)
118+
if (pm->asb || is_2712)
101119
return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
102120
ARRAY_SIZE(bcm2835_power_devs),
103121
NULL, 0, NULL);
104122
return 0;
105123
}
106124

107-
static const struct of_device_id bcm2835_pm_of_match[] = {
108-
{ .compatible = "brcm,bcm2835-pm-wdt", },
109-
{ .compatible = "brcm,bcm2835-pm", },
110-
{ .compatible = "brcm,bcm2711-pm", },
111-
{ .compatible = "brcm,bcm2712-pm", },
112-
{},
113-
};
114-
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
115-
116125
static struct platform_driver bcm2835_pm_driver = {
117126
.probe = bcm2835_pm_probe,
118127
.driver = {

0 commit comments

Comments
 (0)