From: Andrea della Porta <andrea.porta@suse.com>
To: Guenter Roeck <linux@roeck-us.net>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
linux-doc@vger.kernel.org,
"Uwe Kleine-König" <ukleinek@kernel.org>,
linux-pwm@vger.kernel.org, "Gary Guo" <gary@garyguo.net>,
"Andrea della Porta" <andrea.porta@suse.com>
Subject: [PATCH v2 0/1] hwmon: Add fan tachometer support for Raspberry Pi RP1
Date: Tue, 24 Nov 2026 18:38:59 +0100 [thread overview]
Message-ID: <20261124173900.31266-1-andrea.porta@suse.com> (raw)
Hi,
This patch adds fan tachometer / RPM monitoring support for the
Raspberry Pi RP1 southbridge found on the Raspberry Pi 5.
The fan speed is measured by the RP1 Cortex-M firmware, which writes the
computed RPM value into a register of the RP1 PWM controller block.
Following the discussion on the RFC [1], the driver is now implemented
as an auxiliary driver: the RP1 PWM driver registers a "fan" auxiliary
device (pwm_rp1.fan.<id>) and this driver binds to it, reading the RPM
through rp1_pwm_read_tachometer(), exported by the PWM driver in the
'RP1_PWM' symbol namespace (as suggested in the auxiliary bus
documentation and agreed in [2]).
This series depends on the RP1 PWM series [3], which provides both the
auxiliary device and the exported accessor.
Changes since RFC:
- converted from platform driver to auxiliary driver
- dropped the 'raspberrypi,rp1-fan' DT binding and the DTS node: the
device is now instantiated by the PWM driver
- dropped the DT phandle lookup, device link and reference handling:
the auxiliary device is a child of the PWM controller, so the driver
model already guarantees the correct lifetime and unbind ordering
- rp1_pwm_read_tachometer() now takes the auxiliary device and returns
the RPM through a pointer, separating it from the error code
- Kconfig: depend on PWM_RASPBERRYPI_RP1 without the COMPILE_TEST
alternative, fixing the link error reported by the kernel test robot
when the hwmon driver is built-in and the PWM driver is a module
- removed <linux/mod_devicetable.h> and the other unneeded includes (Uwe)
- updated Documentation/hwmon/rp1-fan.rst to reflect the changes
- added a dedicated MAINTAINERS entry for the driver, instead of adding
it to the RP1 PCI driver entry
[1] - https://lore.kernel.org/all/cover.1792748690.git.andrea.porta@suse.com/
[2] - https://lore.kernel.org/all/ae9a4df9-b1f2-4f00-ab86-d9cf8d9bc387@roeck-us.net/
[3] - https://lore.kernel.org/all/20261124173658.31030-1-andrea.porta@suse.com/
Thanks,
Andrea
This version has been prepared with the help of an AI coding assistant
(Claude Opus 5.5).
Andrea della Porta (1):
hwmon: Add driver for Raspberry Pi RP1 fan tachometer
Documentation/hwmon/index.rst | 1 +
Documentation/hwmon/rp1-fan.rst | 43 ++++++++++++++++++
MAINTAINERS | 7 +++
drivers/hwmon/Kconfig | 11 +++++
drivers/hwmon/Makefile | 1 +
drivers/hwmon/rp1-hwmon.c | 78 +++++++++++++++++++++++++++++++++
6 files changed, 141 insertions(+)
create mode 100644 Documentation/hwmon/rp1-fan.rst
create mode 100644 drivers/hwmon/rp1-hwmon.c
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
prerequisite-patch-id: 8a9c7c53e94bfc4dd1dc40e8277f22c1f410f404
prerequisite-patch-id: 3053bded44bcd6a78ecae5a255ae876c5a9cb49b
prerequisite-patch-id: ade915a82dd15722ecb44802d307ff9d60a79228
--
2.51.0
next reply other threads:[~2026-11-24 17:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 17:38 Andrea della Porta [this message]
2026-11-24 17:39 ` [PATCH v2 1/1] hwmon: Add driver for Raspberry Pi RP1 fan tachometer Andrea della Porta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124173900.31266-1-andrea.porta@suse.com \
--to=andrea.porta@suse.com \
--cc=corbet@lwn.net \
--cc=gary@garyguo.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®