All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] hwmon: add Raspberry Pi 5 PMIC driver
@ 2026-11-19 19:55 Sander Speetjens
  2026-11-19 19:55 ` [PATCH v4 1/2] hwmon: add Raspberry Pi " Sander Speetjens
  2026-11-19 19:55 ` [PATCH v4 2/2] firmware: raspberrypi: Register PMIC hwmon driver on Pi 5 Sander Speetjens
  0 siblings, 2 replies; 5+ messages in thread
From: Sander Speetjens @ 2026-11-19 19:55 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Guenter Roeck, Ray Jui, Scott Branden, Jonathan Corbet,
	Shuah Khan, Randy Dunlap
  Cc: linux-kernel, linux-rpi-kernel, linux-arm-kernel, linux-hwmon,
	linux-doc, Peter Robinson, Sander Speetjens

This patch adds an hwmon driver for the PMIC used on the
Raspberry Pi 5.

The PMIC exposes a set of voltage, current and temperature sensors.
Access is only available through the VideoCore firmware mailbox
interface; there is no direct register access from the ARM side.

A structured property tag (0x0003009f) was recently added to the
firmware. It returns the ADC values in binary form (index + length +
array of values), which is much cleaner for a kernel driver than
parsing the text output of the existing gencmd interface.

The driver follows the same instantiation pattern as the Raspberry Pi 5
RTC driver: the raspberrypi-firmware driver creates a platform device
at runtime, and this driver binds to it. All channels are read in a
single mailbox call and a short refresh-on-read cache is used.

The sensors are exposed through the standard hwmon sysfs interface so
tools such as `sensors`, collectd and node-exporter work without
modification.

Dependencies:
- Raspberry Pi firmware that implements property 0x0003009f
- CONFIG_RASPBERRYPI_FIRMWARE

Tested on a Raspberry Pi 5 with recent firmware.

Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com>
---
Changes in v4:
- Fix sashiko reported bug 
- Link to v3: https://lore.kernel.org/r/20261119-hwmon-da9091-v3-0-15956035d7b5@gmail.com

Changes in v3:
- Fix sashiko reported bugs
- Link to v2: https://lore.kernel.org/r/20261119-hwmon-da9091-v2-0-d6c624272a9e@gmail.com

Changes in v2:
- Add documenation
- Split firmware in a separate patch
- Remove DA9091 mention
- Remove extra lock
- Use 64-bit jiffies
- Remove lookup function
- Link to v1: https://lore.kernel.org/r/20261117-hwmon-da9091-v1-1-f55f0af9c6a3@gmail.com

---
Sander Speetjens (2):
      hwmon: add Raspberry Pi PMIC driver
      firmware: raspberrypi: Register PMIC hwmon driver on Pi 5

 Documentation/hwmon/index.rst                  |   1 +
 Documentation/hwmon/raspberrypi-pmic-hwmon.rst |  49 ++++
 drivers/firmware/raspberrypi.c                 |  21 ++
 drivers/hwmon/Kconfig                          |  11 +
 drivers/hwmon/Makefile                         |   1 +
 drivers/hwmon/raspberrypi-pmic-hwmon.c         | 296 +++++++++++++++++++++++++
 include/soc/bcm2835/raspberrypi-firmware.h     |   1 +
 7 files changed, 380 insertions(+)
---
base-commit: 7d51eba9dfa7d30abab0b75570e9f7605366e45b
change-id: 20261117-hwmon-da9091-7aeeac6d8ef8

Best regards,
-- 
Sander Speetjens <sander.speetjens@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-19 20:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 19:55 [PATCH v4 0/2] hwmon: add Raspberry Pi 5 PMIC driver Sander Speetjens
2026-11-19 19:55 ` [PATCH v4 1/2] hwmon: add Raspberry Pi " Sander Speetjens
2026-11-19 20:04   ` sashiko-bot
2026-11-19 19:55 ` [PATCH v4 2/2] firmware: raspberrypi: Register PMIC hwmon driver on Pi 5 Sander Speetjens
2026-11-19 20:05   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.