From: Conor Dooley <conor@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Changhuang Liang <changhuang.liang@starfivetech.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v4 1/2] dt-bindings: hwmon: Add starfive,jhb100-fan-tach
Date: Tue, 1 Sep 2026 11:17:45 +0100 [thread overview]
Message-ID: <20260901-rascal-accompany-019414202877@spud> (raw)
In-Reply-To: <9f4e99f4-5135-4db8-8534-46c91bf4f7d2@roeck-us.net>
[-- Attachment #1: Type: text/plain, Size: 5474 bytes --]
On Mon, Aug 31, 2026 at 10:54:32AM -0700, Guenter Roeck wrote:
> On 8/31/26 09:32, Conor Dooley wrote:
> > On Sat, Aug 29, 2026 at 06:19:40PM -0700, Changhuang Liang wrote:
> > > Add compatible "starfive,jhb100-fan-tach" for StarFive JHB100 Fan-Tach
> > > controller.
> > >
> > > Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
> > > ---
> > > .../hwmon/starfive,jhb100-fan-tach.yaml | 93 +++++++++++++++++++
> > > 1 file changed, 93 insertions(+)
> > > create mode 100644 Documentation/devicetree/bindings/hwmon/starfive,jhb100-fan-tach.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/hwmon/starfive,jhb100-fan-tach.yaml b/Documentation/devicetree/bindings/hwmon/starfive,jhb100-fan-tach.yaml
> > > new file mode 100644
> > > index 000000000000..1dcd4932768f
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/hwmon/starfive,jhb100-fan-tach.yaml
> > > @@ -0,0 +1,93 @@
> > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/hwmon/starfive,jhb100-fan-tach.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: StarFive JHB100 Fan-Tach controller
> > > +
> > > +maintainers:
> > > + - Changhuang Liang <changhuang.liang@starfivetech.com>
> > > +
> > > +description:
> > > + The StarFive Fan-Tach controller can support up to 16 fan tach input.
> > > +
> > > +properties:
> > > + compatible:
> > > + enum:
> > > + - starfive,jhb100-fan-tach
> > > +
> > > + reg:
> > > + maxItems: 1
> > > +
> > > + clocks:
> > > + maxItems: 1
> > > +
> > > + resets:
> > > + maxItems: 1
> > > +
> > > + interrupts:
> > > + maxItems: 1
> > > +
> > > + "#address-cells":
> > > + const: 1
> > > +
> > > + "#size-cells":
> > > + const: 0
> > > +
> > > +patternProperties:
> > > + "^fan@[0-9a-f]+$":
> > > + $ref: fan-common.yaml#
> > > + unevaluatedProperties: false
> > > +
> > > + properties:
> > > + reg:
> > > + description:
> > > + PWM channel index. The driver allows two fans to share the same
> > > + PWM channel, or each fan to use a dedicated channel.
> >
> > Doesn't matter what the driver can do, the description should describe
> > what the hardware supports.
> > pw-bot: changes-requested
> >
> > Does this fan-tach controller provide the PWMs?
> > If so (although Guenter may correct me), I think the fan-tach controller
> > needs to be.
> >
> > If you don't do that, I think you're going to run into problems with
> > having multiple nodes with the same unit address when two fans share a
> > pwm?
> >
>
> Depends on how the controller works. Normally fan controllers have a feedback
> mechanism which can be either temperature -> pwm output or fan speed -> pwm output.
> I don't know how this controller works, specifically if the fan speed inputs are
> internally associated with pwm outputs or if they are completely independent
> of each other. If it is the latter, aspeed,g6-pwm-tach.yaml would probably
> be a good baseline.
Judging from the other reply, it probably isn't a good baseline because
this is not a pwm provider.
> > I think what you're supposed to do is drop "reg" and replace it with
> > "pwms", but once again Guenter may correct me there.
> > e.g. aspeed,g6-pwm-tach.yaml
> >
>
> Sorry, when it comes to devicetree properties, I am completely clueless.
> Usually the devicetree and pwm maintainers insist that all fan controllers
> are modeled as pwm controllers because they have pwm outputs. My approach
> is "use whatever bindings are acceptable by DT maintainers".
Would you mind taking a look at my question in the other reply about how
the feedback path works (or doesn't) in that case? My lack of
familiarity with the subsystem has me scratching my head about how the
tach would be used to adjust the pwm duty cycle with the dt setup
described there!
Thanks,
Conor.
>
> Guenter
>
> > Cheers,
> > Conor.
> >
> > > + maximum: 15
> > > +
> > > + tach-ch:
> > > + description:
> > > + The tachometer channel(s) wired to the fan(s) driven by this PWM
> > > + channel. Integer values in the range 0-15.
> > > + minItems: 1
> > > + maxItems: 2
> > > + items:
> > > + maximum: 15
> > > +
> > > + required:
> > > + - reg
> > > + - tach-ch
> > > +
> > > +required:
> > > + - compatible
> > > + - reg
> > > + - clocks
> > > + - resets
> > > + - interrupts
> > > +
> > > +additionalProperties: false
> > > +
> > > +examples:
> > > + - |
> > > + fan-controller@11be0000 {
> > > + compatible = "starfive,jhb100-fan-tach";
> > > + reg = <0x11be0000 0x400>;
> > > + interrupts = <128>;
> > > + clocks = <&per2crg 33>;
> > > + resets = <&per2crg 5>;
> > > + #address-cells = <1>;
> > > + #size-cells = <0>;
> > > +
> > > + fan@0 {
> > > + reg = <0x0>;
> > > + tach-ch = /bits/ 8 <0x0 0x8>;
> > > + pulses-per-revolution = <2>;
> > > + };
> > > + fan@1 {
> > > + reg = <0x1>;
> > > + tach-ch = /bits/ 8 <0x1>;
> > > + pulses-per-revolution = <2>;
> > > + };
> > > + };
> > > --
> > > 2.25.1
> > >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-09-01 10:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 1:19 [PATCH v4 0/2] Add JHB100 Fan-Tach support Changhuang Liang
2026-08-30 1:19 ` [PATCH v4 1/2] dt-bindings: hwmon: Add starfive,jhb100-fan-tach Changhuang Liang
2026-08-30 3:56 ` sashiko-bot
2026-08-31 16:32 ` Conor Dooley
2026-08-31 17:54 ` Guenter Roeck
2026-09-01 10:17 ` Conor Dooley [this message]
2026-09-01 1:24 ` Changhuang Liang
2026-09-01 10:14 ` Conor Dooley
2026-09-01 15:52 ` Guenter Roeck
2026-08-30 1:19 ` [PATCH v4 2/2] hwmon: (starfive-fan-tach) Add fan tach driver for StarFive JHB100 Changhuang Liang
2026-08-30 3:58 ` sashiko-bot
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=20260901-rascal-accompany-019414202877@spud \
--to=conor@kernel.org \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh@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