Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Phil Elwell and committed by
Lee Jones
fe0e422c c7be85a3

+11 -3
+4 -3
drivers/mfd/bcm2835-pm.c
··· 81 81 platform_set_drvdata(pdev, pm); 82 82 83 83 pm->dev = dev; 84 + pm->soc = (uintptr_t)device_get_match_data(dev); 84 85 85 86 ret = bcm2835_pm_get_pdata(pdev, pm); 86 87 if (ret) ··· 107 106 108 107 static const struct of_device_id bcm2835_pm_of_match[] = { 109 108 { .compatible = "brcm,bcm2835-pm-wdt", }, 110 - { .compatible = "brcm,bcm2835-pm", }, 111 - { .compatible = "brcm,bcm2711-pm", }, 112 - { .compatible = "brcm,bcm2712-pm", }, 109 + { .compatible = "brcm,bcm2835-pm", .data = (void *)BCM2835_PM_SOC_BCM2835 }, 110 + { .compatible = "brcm,bcm2711-pm", .data = (void *)BCM2835_PM_SOC_BCM2711 }, 111 + { .compatible = "brcm,bcm2712-pm", .data = (void *)BCM2835_PM_SOC_BCM2712 }, 113 112 {}, 114 113 }; 115 114 MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
+7
include/linux/mfd/bcm2835-pm.h
··· 5 5 6 6 #include <linux/regmap.h> 7 7 8 + enum bcm2835_soc { 9 + BCM2835_PM_SOC_BCM2835, 10 + BCM2835_PM_SOC_BCM2711, 11 + BCM2835_PM_SOC_BCM2712, 12 + }; 13 + 8 14 struct bcm2835_pm { 9 15 struct device *dev; 10 16 void __iomem *base; 11 17 void __iomem *asb; 12 18 void __iomem *rpivid_asb; 19 + enum bcm2835_soc soc; 13 20 }; 14 21 15 22 #endif /* BCM2835_MFD_PM_H */