Add RP1 PWM controller support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v14 Latest3 patches 0 repliesNew
- v133 patches 0 repliesSuperseded
- v122 patches 4 repliesSuperseded
Earlier versions · 12
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v10 posting 2/2 | 3 patches | 2 replies | Applied | |
| v11 | 0 of 3 patches | 0 replies | Superseded | |
| v10 posting 1/2 | 3 patches | 0 replies | Superseded | |
| v9 | 3 patches | 5 replies | Superseded | |
| v8 | 3 patches | 0 replies | Superseded | |
| v7 | 3 patches | 9 replies | Superseded | |
| v6 | 3 patches | 8 replies | Superseded | |
| v5 | 3 patches | 9 replies | Superseded | |
| v4 | 3 patches | 5 replies | Superseded | |
| v3 | 3 patches | 4 replies | Superseded | |
| v2 | 3 patches | 9 replies | Superseded | |
| v1 | 3 patches | 9 replies | Superseded |
Changes in v14 from the cover letter
- rp1_pwm_round_waveform_fromhw(): fixed a u32 overflow in the duty_offset computation when the period register holds U32_MAX, and return a zeroed duty_length/duty_offset when the inverted output is constantly low, instead of a duty_offset equal to the period, which is rejected by pwm_wf_valid() (reported by Sashiko AI review [4]).
Patches in v14 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | dt-bindings: pwm: Add Raspberry Pi RP1 PWM controllerDocumentation/ | +66 | 0 replies | |
| 2/3 | pwm: rp1: Add RP1 PWM controller driverMAINTAINERS drivers/ drivers/ +1 more | +443 | 0 replies | |
| 3/3 | pwm: rp1: Register auxiliary device for the fan tachometerMAINTAINERS drivers/ drivers/ +1 more | +67 | 0 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Krzysztof Kozlowski |
|---|---|
| 1/3 | R-b |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v14 0/3] Add RP1 PWM controller support
Hi,
This patchset adds support for the PWM controller found in the Raspberry Pi RP1 southbridge, used on the Raspberry Pi 5 to drive the cooling fan.
Since v13, the driver also registers a "fan" auxiliary device (pwm_rp1.fan.<id>). On the Raspberry Pi 5 the RP1 firmware measures the fan tachometer pulses and writes the RPM value in the phase register of PWM channel 2; the companion hwmon driver, sent as a separate series to the hwmon list, binds to that auxiliary device and reads the value through rp1_pwm_read_tachometer(), exported in the 'RP1_PWM' symbol namespace. This is the approach agreed in [1], and it removes the need for any dedicated DT node or binding for the fan.
The DTS node for the controller is already in v7.4-rc1 [2]. The DT binding has been applied by Rob [3] for consistency to v7.4 and is part of v7.4-rc2: as a consequence, patch 1 is included only to make this series apply 'logically' on top of v7.4-rc1 and can be dropped when rebasing.
Changes in v14:
- rp1_pwm_round_waveform_fromhw(): fixed a u32 overflow in the duty_offset computation when the period register holds U32_MAX, and return a zeroed duty_length/duty_offset when the inverted output is constantly low, instead of a duty_offset equal to the period, which is rejected by pwm_wf_valid() (reported by Sashiko AI review [4]).
Changes in v13:
- dropped the DTS patch, already merged.
- add patch 3, registering the auxiliary device for the fan tachometer and exporting the accessor used by the hwmon auxiliary driver. The exported function was originally part of the fan patchset. Since it is really part of the pwm driver to be taken by Uwe, I moved it in this patchset.
- Kconfig: pwm module now depends on AUXILIARY_BUS.
- added a macro to define the phase channel number from which to read the fan speed.
- removed the 'Tested-by' tag from Gary (see V12) since the patchset has been significally changed and need to be tested again.
- the controller private data is passed to the auxiliary device as platform data, so the exported accessor no longer depends on how the parent platform device stores its driver data.
- dropped the unused 'pwm' argument from rp1_pwm_apply_config().
- added a MAINTAINERS entry for the driver, its DT binding and header.
[1] - https://lore.kernel.org/all/[email protected]/
[2] - https://lore.kernel.org/all/[email protected]/
[3] - https://lore.kernel.org/all/[email protected]/
[4] - https://lore.kernel.org/all/[email protected]/
Thanks,
Andrea
This version has been prepared with the help of an AI coding assistant (Claude Opus 5.5).
Andrea della Porta (1):
pwm: rp1: Register auxiliary device for the fan tachometer
Naushir Patuck (2):
dt-bindings: pwm: Add Raspberry Pi RP1 PWM controller
pwm: rp1: Add RP1 PWM controller driver
.../bindings/pwm/raspberrypi,rp1-pwm.yaml | 66 +++ MAINTAINERS | 8 + drivers/pwm/Kconfig | 12 + drivers/pwm/Makefile | 1 + drivers/pwm/pwm-rp1.c | 477 ++++++++++++++++++ include/soc/bcm2835/raspberrypi-pwm-rp1.h | 12 + 6 files changed, 576 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/raspberrypi,rp1-pwm.yaml create mode 100644 drivers/pwm/pwm-rp1.c create mode 100644 include/soc/bcm2835/raspberrypi-pwm-rp1.h
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
Signature · 1 line
2.51.0