devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Conor Dooley <conor.dooley@microchip.com>
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>,
	jdelvare@suse.com, linux@roeck-us.net, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, ukleinek@kernel.org,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH v4 1/3] dt-bindings: hwmon: Add adt7475 fan/pwm properties
Date: Tue, 25 Jun 2024 17:22:18 +0100	[thread overview]
Message-ID: <20240625-oppressor-scaling-5713b4719a89@spud> (raw)
In-Reply-To: <20240529-faucet-vending-3e330f8eb67b@wendy>

[-- Attachment #1: Type: text/plain, Size: 3364 bytes --]

Uwe,

On Wed, May 29, 2024 at 08:58:41AM +0100, Conor Dooley wrote:
> On Wed, May 29, 2024 at 10:56:36AM +1200, Chris Packham wrote:
> > Add fan child nodes that allow describing the connections for the
> > ADT7475 to the fans it controls. This also allows setting some
> > initial values for the pwm duty cycle and frequency.
> > 
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > ---
> > 
> > Notes:
> >     I realise there is still some discussion about how to express the
> >     frequency and duty cycle. I have a personal preference for using hertz
> >     for the frequency and 0-255 for the duty cycle but if the consensus is
> >     to express these things some other way I'm fine with doing some math.
> 
> Probably worth carrying a link to it here:
> https://lore.kernel.org/all/4de798f3-069e-4028-a5b5-5e6a639277e3@alliedtelesis.co.nz/
> 
> I asked Uwe to take a look & it's on his todo list.

This is an attempt to bump this up on your todo list a bit!

Thanks,
Conor.

> >     
> >     Changes in v4:
> >     - 0 is not a valid frequency value
> >     Changes in v3:
> >     - Use the pwm provider/consumer bindings
> >     Changes in v2:
> >     - Document 0 as a valid value (leaves hardware as-is)
> > 
> >  .../devicetree/bindings/hwmon/adt7475.yaml    | 25 ++++++++++++++++++-
> >  1 file changed, 24 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/adt7475.yaml b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> > index 051c976ab711..bfef4c803bf7 100644
> > --- a/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> > @@ -51,6 +51,15 @@ properties:
> >        enum: [0, 1]
> >        default: 1
> >  
> > +  "#pwm-cells":
> > +    const: 4
> > +    description: |
> > +      Number of cells in a PWM specifier.
> > +      - 0: The pwm channel
> > +      - 1: The pwm frequency in hertz - 11, 14, 22, 29, 35, 44, 58, 88, 22500
> > +      - 2: PWM flags 0 or PWM_POLARITY_INVERTED
> > +      - 3: The default pwm duty cycle - 0-255
> > +
> >  patternProperties:
> >    "^adi,bypass-attenuator-in[0-4]$":
> >      description: |
> > @@ -81,6 +90,10 @@ patternProperties:
> >        - smbalert#
> >        - gpio
> >  
> > +  "^fan-[0-9]+$":
> > +    $ref: fan-common.yaml#
> > +    unevaluatedProperties: false
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -89,11 +102,12 @@ additionalProperties: false
> >  
> >  examples:
> >    - |
> > +    #include <dt-bindings/pwm/pwm.h>
> >      i2c {
> >        #address-cells = <1>;
> >        #size-cells = <0>;
> >  
> > -      hwmon@2e {
> > +      pwm: hwmon@2e {
> >          compatible = "adi,adt7476";
> >          reg = <0x2e>;
> >          adi,bypass-attenuator-in0 = <1>;
> > @@ -101,5 +115,14 @@ examples:
> >          adi,pwm-active-state = <1 0 1>;
> >          adi,pin10-function = "smbalert#";
> >          adi,pin14-function = "tach4";
> > +        #pwm-cells = <4>;
> > +
> > +        fan-0 {
> > +          pwms = <&pwm 0 22500 PWM_POLARITY_INVERTED 255>;
> > +        };
> > +
> > +        fan-1 {
> > +          pwms = <&pwm 2 22500 PWM_POLARITY_INVERTED 255>;
> > +        };
> >        };
> >      };
> > -- 
> > 2.45.1
> > 



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2024-06-25 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-28 22:56 [PATCH v4 0/3] hwmon: (adt7475) duty cycle configuration Chris Packham
2024-05-28 22:56 ` [PATCH v4 1/3] dt-bindings: hwmon: Add adt7475 fan/pwm properties Chris Packham
2024-05-29  7:58   ` Conor Dooley
2024-06-25 16:22     ` Conor Dooley [this message]
2024-07-05  9:09   ` Uwe Kleine-König
2024-07-11 22:59     ` Chris Packham
2024-05-28 22:56 ` [PATCH v4 2/3] dt-bindings: hwmon: adt7475: Deprecate adi,pwm-active-state Chris Packham
2024-06-03 15:33   ` Rob Herring (Arm)
2024-05-28 22:56 ` [PATCH v4 3/3] hwmon: (adt7475) Add support for configuring initial PWM state Chris Packham

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=20240625-oppressor-scaling-5713b4719a89@spud \
    --to=conor@kernel.org \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=conor+dt@kernel.org \
    --cc=conor.dooley@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@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=robh@kernel.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;
as well as URLs for NNTP newsgroup(s).