public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christian Marangi <ansuelsmth@gmail.com>,
	Jean Delvare <jdelvare@suse.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] dt-bindings: hwmon: g76x: Add support for g761
Date: Sat, 25 May 2024 07:32:04 -0700	[thread overview]
Message-ID: <22e1daf4-ffce-4fac-be4c-0e7bebd91c88@roeck-us.net> (raw)
In-Reply-To: <20240525102914.22634-2-ansuelsmth@gmail.com>

On 5/25/24 03:29, Christian Marangi wrote:
> Add support for g761 PWM Fan controller. This is an exact copy of g763
> with the difference that it does also support an internal clock
> oscillators.
> 
> Add required logic to support this additional feature with the property
> gmt,internal-clock and reject invalid schema that define both
> internal-clock property and external clocks.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>   .../devicetree/bindings/hwmon/gmt,g76x.yaml   | 43 +++++++++++++++++--
>   1 file changed, 40 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/gmt,g76x.yaml b/Documentation/devicetree/bindings/hwmon/gmt,g76x.yaml
> index bfefe49f54bf..d6e80392d045 100644
> --- a/Documentation/devicetree/bindings/hwmon/gmt,g76x.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/gmt,g76x.yaml
> @@ -4,13 +4,13 @@
>   $id: http://devicetree.org/schemas/hwmon/gmt,g76x.yaml#
>   $schema: http://devicetree.org/meta-schemas/core.yaml#
>   
> -title: GMT G762/G763 PWM Fan controller
> +title: GMT G761/G762/G763 PWM Fan controller
>   
>   maintainers:
>     - Christian Marangi <ansuelsmth@gmail.com>
>   
>   description: |
> -  GMT G762/G763 PWM Fan controller.
> +  GMT G761/G762/G763 PWM Fan controller.
>   
>     If an optional property is not set in DT, then current value is kept
>     unmodified (e.g. bootloader installed value).
> @@ -22,6 +22,7 @@ description: |
>   properties:
>     compatible:
>       enum:
> +      - gmt,g761
>         - gmt,g762
>         - gmt,g763
>   
> @@ -48,10 +49,37 @@ properties:
>       $ref: /schemas/types.yaml#/definitions/uint32
>       enum: [0, 1, 2]
>   
> +  gmt,internal-clock:
> +    description: Use the Internal clock instead of externally attached one
> +      via the CLK pin.
> +    type: boolean
> +
>   required:
>     - compatible
>     - reg
> -  - clocks
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - gmt,g762
> +              - gmt,g763
> +    then:
> +      properties:
> +        gmt,internal-clock: false
> +
> +      required:
> +        - clocks

Is the new property even necessary ? The absence of an external clock on G761
could be used to imply that the internal clock is used.

Guenter

> +
> +  - if:
> +      required:
> +        - gmt,internal-clock
> +
> +    then:
> +      properties:
> +        clocks: false
>   
>   additionalProperties: false
>   
> @@ -80,4 +108,13 @@ examples:
>               fan_startv = <1>;
>               pwm_polarity = <0>;
>           };
> +
> +        g761@1e {
> +            compatible = "gmt,g761";
> +            reg = <0x1e>;
> +            gmt,internal-clock;
> +            fan_gear_mode = <0>;
> +            fan_startv = <1>;
> +            pwm_polarity = <0>;
> +        };
>       };


  reply	other threads:[~2024-05-25 14:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-25 10:29 [PATCH 1/3] dt-bindings: hwmon: g762: Convert to yaml schema Christian Marangi
2024-05-25 10:29 ` [PATCH 2/3] dt-bindings: hwmon: g76x: Add support for g761 Christian Marangi
2024-05-25 14:32   ` Guenter Roeck [this message]
2024-05-25 10:50     ` Christian Marangi
2024-05-25 14:53       ` Guenter Roeck
2024-05-25 11:12         ` Christian Marangi
2024-05-25 19:58           ` Guenter Roeck
2024-05-25 10:29 ` [PATCH 3/3] hwmon: g672: add " Christian Marangi
2024-05-25 14:29   ` Guenter Roeck
2024-05-25 10:47     ` Christian Marangi

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=22e1daf4-ffce-4fac-be4c-0e7bebd91c88@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --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=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