Skip to content

Commit fe0e422

Browse files
pelwelllag-linaro
authored andcommitted
mfd: bcm2835-pm: Introduce SoC-specific type identifier
Power management blocks across the BCM2835 family share a common base but require variant-specific handling. For instance, the BCM2712 lacks ASB register space, yet it manages the power domain for the V3D graphics block. Add a hardware type identifier to the driver's private data. This allows the driver to distinguish between SoC models and implement custom quirks or features as needed. Signed-off-by: Phil Elwell <phil@raspberrypi.com> Co-developed-by: Stanimir Varbanov <svarbanov@suse.de> Signed-off-by: Stanimir Varbanov <svarbanov@suse.de> Signed-off-by: Andrea della Porta <andrea.porta@suse.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://patch.msgid.link/c4bb218654e91f312a01b419d3d408e5131f7673.1772839224.git.andrea.porta@suse.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent c7be85a commit fe0e422

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

drivers/mfd/bcm2835-pm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
8181
platform_set_drvdata(pdev, pm);
8282

8383
pm->dev = dev;
84+
pm->soc = (uintptr_t)device_get_match_data(dev);
8485

8586
ret = bcm2835_pm_get_pdata(pdev, pm);
8687
if (ret)
@@ -106,9 +107,9 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
106107

107108
static const struct of_device_id bcm2835_pm_of_match[] = {
108109
{ .compatible = "brcm,bcm2835-pm-wdt", },
109-
{ .compatible = "brcm,bcm2835-pm", },
110-
{ .compatible = "brcm,bcm2711-pm", },
111-
{ .compatible = "brcm,bcm2712-pm", },
110+
{ .compatible = "brcm,bcm2835-pm", .data = (void *)BCM2835_PM_SOC_BCM2835 },
111+
{ .compatible = "brcm,bcm2711-pm", .data = (void *)BCM2835_PM_SOC_BCM2711 },
112+
{ .compatible = "brcm,bcm2712-pm", .data = (void *)BCM2835_PM_SOC_BCM2712 },
112113
{},
113114
};
114115
MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);

include/linux/mfd/bcm2835-pm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55

66
#include <linux/regmap.h>
77

8+
enum bcm2835_soc {
9+
BCM2835_PM_SOC_BCM2835,
10+
BCM2835_PM_SOC_BCM2711,
11+
BCM2835_PM_SOC_BCM2712,
12+
};
13+
814
struct bcm2835_pm {
915
struct device *dev;
1016
void __iomem *base;
1117
void __iomem *asb;
1218
void __iomem *rpivid_asb;
19+
enum bcm2835_soc soc;
1320
};
1421

1522
#endif /* BCM2835_MFD_PM_H */

0 commit comments

Comments
 (0)