All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Andrea della Porta" <andrea.porta@suse.com>,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	linux-pwm@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, devicetree@vger.kernel.org,
	florian.fainelli@broadcom.com, rjui@broadcom.com,
	sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: <naush@raspberrypi.com>, <svarbanov@suse.de>, <gary@garyguo.net>,
	<linux@roeck-us.net>, <linux-hwmon@vger.kernel.org>,
	<krzysztof.kozlowski@oss.qualcomm.com>
Subject: Re: [PATCH v14 0/3] Add RP1 PWM controller support
Date: Tue, 01 Dec 2026 20:21:34 +0000	[thread overview]
Message-ID: <DN9OC65WVO66.2BAM8DHB9OLS3@garyguo.net> (raw)
In-Reply-To: <20261125162453.23573-1-andrea.porta@suse.com>

On Wed Nov 25, 2026 at 4:24 PM GMT, Andrea della Porta wrote:
> 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/ae9a4df9-b1f2-4f00-ab86-d9cf8d9bc387@roeck-us.net/
> [2] - https://lore.kernel.org/all/7c437a10-985b-402c-b3ac-cfa97c53d014@broadcom.com/
> [3] - https://lore.kernel.org/all/20261102192302.GA882027-robh@kernel.org/
> [4] - https://lore.kernel.org/all/sashiko-outbox-231741@kernel.org/
>
> 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

Reviewed-by: Gary Guo <gary@garyguo.net>
Tested-by: Gary Guo <gary@garyguo.net>

Best,
Gary

>
>  .../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



      parent reply	other threads:[~2026-12-01 20:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 16:24 [PATCH v14 0/3] Add RP1 PWM controller support Andrea della Porta
2026-11-25 16:24 ` [PATCH v14 1/3] dt-bindings: pwm: Add Raspberry Pi RP1 PWM controller Andrea della Porta
2026-11-25 16:24 ` [PATCH v14 2/3] pwm: rp1: Add RP1 PWM controller driver Andrea della Porta
2026-12-01 21:25   ` Gary Guo
2026-11-25 16:24 ` [PATCH v14 3/3] pwm: rp1: Register auxiliary device for the fan tachometer Andrea della Porta
2026-11-25 16:30 ` [PATCH v14 0/3] Add RP1 PWM controller support sashiko-bot
2026-12-01 20:21 ` Gary Guo [this message]

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=DN9OC65WVO66.2BAM8DHB9OLS3@garyguo.net \
    --to=gary@garyguo.net \
    --cc=andrea.porta@suse.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux@roeck-us.net \
    --cc=naush@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=robh@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=svarbanov@suse.de \
    --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 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.