[PATCH v5 2/3] firmware: raspberrypi: Register PMIC hwmon driver on Pi 5
Stefan Wahren
wahrenst at gmx.net
Tue Dec 1 04:40:53 PST 2026
Hi Sander,
Am 26.11.26 um 14:03 schrieb Sander Speetjens:
> Register the raspberrypi-pmic-hwmon platform device
> on BCM2712-based Raspberry Pi 5 systems,
> including the BCM2712 D0 revision.
>
> Store the registered device in the firmware state
> and unregister it during driver removal
> to ensure proper resource cleanup.
>
> Signed-off-by: Sander Speetjens <sander.speetjens at gmail.com>
> ---
> drivers/firmware/raspberrypi.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
> index 68512224e3ce..a694ecc18f9c 100644
> --- a/drivers/firmware/raspberrypi.c
> +++ b/drivers/firmware/raspberrypi.c
> @@ -34,6 +34,7 @@ struct rpi_firmware {
>
> struct platform_device *hwmon_dev;
> struct platform_device *clk_dev;
> + struct platform_device *pmic_dev;
> struct platform_device *rtc_dev;
> };
>
> @@ -249,6 +250,23 @@ static void rpi_register_clk_driver(struct device *dev, struct rpi_firmware *fw)
> fw->clk_dev = pdev;
> }
>
> +static void rpi_register_pmic_driver(struct device *dev, struct rpi_firmware *fw)
> +{
> + struct platform_device *pdev;
> +
> + /* Only present on Pi 5 (bcm2712) */
> + if (!(of_machine_is_compatible("brcm,bcm2712") ||
> + of_machine_is_compatible("brcm,bcm2712-d0")))
> + return;
since the PMIC hwmon driver rely on the recently added
RPI_FIRMWARE_GET_PMIC_ADC, I suggest to check the function of the
firmware tag before registering the driver just like the other hwmon
driver does. I don't know the behavior on non-Pi 5 platforms, but maybe
this also could replace these of_machine_is_compatible() checks?
Best regards
More information about the linux-arm-kernel
mailing list