public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco@dolcini.it>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Francesco Dolcini <francesco@dolcini.it>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Farouk Bouabid <farouk.bouabid@cherry.de>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output
Date: Tue, 1 Apr 2025 09:43:45 +0200	[thread overview]
Message-ID: <20250401074345.GA8188@francesco-nb> (raw)
In-Reply-To: <20250401-boisterous-teal-bison-533b01@krzk-bin>

On Tue, Apr 01, 2025 at 08:13:14AM +0200, Krzysztof Kozlowski wrote:
> On Mon, Mar 31, 2025 at 05:52:28PM +0200, Francesco Dolcini wrote:
> > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > 
> > Add properties to describe the fan and the PWM controller output.
> > 
> > Link: https://www.ti.com/lit/gpn/amc6821
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > ---
> > v3:
> >  - explicitly describe the fan, use standard PWM and FAN bindings
> >  - pwm.yaml cannot be referenced, because of the $nodename pattern that is
> >    enforced there
> > v2: https://lore.kernel.org/all/20250224180801.128685-2-francesco@dolcini.it/
> >  - no changes
> > v1: https://lore.kernel.org/all/20250218165633.106867-2-francesco@dolcini.it/
> > ---
> >  .../devicetree/bindings/hwmon/ti,amc6821.yaml      | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml b/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
> > index 5d33f1a23d03..94aca9c378e6 100644
> > --- a/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
> > +++ b/Documentation/devicetree/bindings/hwmon/ti,amc6821.yaml
> > @@ -28,6 +28,13 @@ properties:
> >    i2c-mux:
> >      type: object
> >  
> > +  fan:
> > +    $ref: fan-common.yaml#
> > +    unevaluatedProperties: false
> 
> Why do you need the child, instead of referencing fan-common in the top
> level?

Two small reasons.

First is that the amc6821 is a fan controller, and the fan is just
connected to it. So having the fan as a child seemed the right way to
describe it, and this is done like that in other hwmon binding.

.. but now that you asked I tried to move the fan-common to the top
level and it's not working.

I added

  allOf:
    - $ref: fan-common.yaml#

at top level, removed the fan child, and moved the pwms up one level in
the example

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        fan_controller: fan@18 {
            compatible = "ti,amc6821";
            reg = <0x18>;
            #pwm-cells = <2>;
            pwms = <&fan_controller 40000 0>;
        };
    };

and the binding checker is not fine with it

$ make dt_binding_check DT_SCHEMA_FILES=ti,amc6821.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
  CHKDT   ./Documentation/devicetree/bindings
  LINT    ./Documentation/devicetree/bindings
  DTEX    Documentation/devicetree/bindings/hwmon/ti,amc6821.example.dts
  DTC [C] Documentation/devicetree/bindings/hwmon/ti,amc6821.example.dtb
/home/francesco/Toradex/sources/linux/Documentation/devicetree/bindings/hwmon/ti,amc6821.example.dtb: fan@18: 'pwms' does not match any of the regexes: 'pinctrl-[0-9]+'
	from schema $id: http://devicetree.org/schemas/hwmon/ti,amc6821.yaml#


Any suggestion?

Francesco


  reply	other threads:[~2025-04-01  7:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 15:52 [PATCH v3 0/2] hwmon: (amc6821) Add PWM polarity configuration with OF Francesco Dolcini
2025-03-31 15:52 ` [PATCH v3 1/2] dt-bindings: hwmon: amc6821: add fan and PWM output Francesco Dolcini
2025-03-31 16:01   ` Guenter Roeck
2025-03-31 16:16     ` Francesco Dolcini
2025-03-31 17:24       ` Guenter Roeck
2025-04-01  6:13   ` Krzysztof Kozlowski
2025-04-01  7:43     ` Francesco Dolcini [this message]
2025-04-01 12:33       ` Guenter Roeck
2025-04-01 23:08     ` Rob Herring
2025-03-31 15:52 ` [PATCH v3 2/2] hwmon: (amc6821) Add PWM polarity configuration with OF Francesco Dolcini

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=20250401074345.GA8188@francesco-nb \
    --to=francesco@dolcini.it \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=farouk.bouabid@cherry.de \
    --cc=francesco.dolcini@toradex.com \
    --cc=jdelvare@suse.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=quentin.schulz@cherry.de \
    --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