Devicetree
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Robert Marko <robert.marko@sartura.hr>
Cc: linux@roeck-us.net, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, Steen.Hegelund@microchip.com,
	daniel.machon@microchip.com, UNGLinuxDriver@microchip.com,
	nicolas.ferre@microchip.com, claudiu.beznea@tuxon.dev,
	lars.povlsen@microchip.com, linux-hwmon@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, luka.perkov@sartura.hr
Subject: Re: [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x fan controller
Date: Tue, 13 Oct 2026 17:30:29 +0100	[thread overview]
Message-ID: <20261013-stylized-plethora-2a9e27545adb@spud> (raw)
In-Reply-To: <20261013125735.1542349-1-robert.marko@sartura.hr>

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

On Tue, Oct 13, 2026 at 02:56:25PM +0200, Robert Marko wrote:
> LAN969x integrates a PWM fan controller with a tachometer input in
> addition to the Sparx5-compatible temperature sensor. Add a LAN969x
> hardware-monitor compatible and describe the second register region.
> 
> Describe the fan as a child node using a two-cell PWM specifier for the
> period and standard polarity flags. The child also carries the optional
> tachometer pulses-per-revolution and thermal cooling properties.
> 
> Keep the existing microchip,lan9691-temp compatible for device tree ABI
> compatibility.
> 
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  .../bindings/hwmon/microchip,sparx5-temp.yaml | 90 ++++++++++++++++++-
>  1 file changed, 87 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml b/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
> index 611fcadb1e771..e91c2a3ccd3c9 100644
> --- a/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/microchip,sparx5-temp.yaml
> @@ -4,13 +4,15 @@
>  $id: http://devicetree.org/schemas/hwmon/microchip,sparx5-temp.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: Microchip Sparx5 Temperature Monitor
> +title: Microchip Sparx5 Hardware Monitor
>  
>  maintainers:
>    - Lars Povlsen <lars.povlsen@microchip.com>
>  
>  description: |
> -  Microchip Sparx5 embedded temperature monitor
> +  Microchip Sparx5 temperature monitor with a fan controller on LAN969x.
> +  The fan child's pwms property references this node to specify the
> +  PWM period and polarity.
>  
>  properties:
>    compatible:
> @@ -18,11 +20,19 @@ properties:
>        - const: microchip,sparx5-temp
>        - items:
>            - enum:
> +              - microchip,lan9691-hwmon
>                - microchip,lan9691-temp
>            - const: microchip,sparx5-temp
>  
>    reg:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 2
> +
> +  reg-names:
> +    minItems: 1
> +    items:
> +      - const: temp
> +      - const: fan
>  
>    clocks:
>      items:
> @@ -31,11 +41,67 @@ properties:
>    '#thermal-sensor-cells':
>      const: 0
>  
> +  '#pwm-cells':
> +    const: 2
> +    description: |
> +      Number of cells in a PWM specifier.
> +      - cell 0: PWM period in nanoseconds
> +      - cell 1: PWM polarity: 0 or PWM_POLARITY_INVERTED
> +
> +  fan:
> +    $ref: fan-common.yaml#
> +    unevaluatedProperties: false
> +
> +    properties:
> +      cooling-levels:
> +        description:
> +          PWM duty-cycle values corresponding to thermal cooling states.
> +        items:
> +          maximum: 255
> +
> +      pulses-per-revolution:
> +        minimum: 1
> +        maximum: 4
> +        default: 2
> +
> +    required:
> +      - pwms
> +
> +    dependencies:
> +      '#cooling-cells':
> +        - cooling-levels
> +      cooling-levels:
> +        - '#cooling-cells'
> +
>  required:
>    - compatible
>    - reg
>    - clocks
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: microchip,lan9691-hwmon
> +    then:
> +      properties:
> +        reg:
> +          minItems: 2
> +        reg-names:
> +          minItems: 2
> +      required:
> +        - '#pwm-cells'
> +        - reg-names
> +    else:
> +      properties:
> +        '#pwm-cells': false
> +        fan: false
> +        reg:
> +          maxItems: 1
> +        reg-names:
> +          maxItems: 1
> +
>  additionalProperties: false
>  
>  examples:
> @@ -46,3 +112,21 @@ examples:
>          #thermal-sensor-cells = <0>;
>          clocks = <&sys_clk>;
>      };
> +
> +  - |
> +    #include <dt-bindings/pwm/pwm.h>
> +
> +    hwmon: hwmon@e2020100 {
> +        compatible = "microchip,lan9691-hwmon", "microchip,sparx5-temp";
> +        reg = <0xe2020100 0xc>, <0xe2010348 0xc>;

Are these actually the same device? These are somewhat disparate
register regions - and the second is at a very odd offset.

Thanks,
Conor.

> +        reg-names = "temp", "fan";
> +        #pwm-cells = <2>;
> +        #thermal-sensor-cells = <0>;
> +        clocks = <&sys_clk>;
> +
> +        fan {
> +            pwms = <&hwmon 40000 PWM_POLARITY_INVERTED>;
> +            cooling-levels = <0 128 192 255>;
> +            #cooling-cells = <2>;
> +        };
> +    };
> -- 
> 2.56.0
> 

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

  parent reply	other threads:[~2026-10-13 16:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 12:56 [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x fan controller Robert Marko
2026-10-13 12:56 ` [PATCH 2/6] hwmon: sparx5: separate temperature reading from sensor dispatch Robert Marko
2026-10-13 12:56 ` [PATCH 3/6] hwmon: sparx5: add LAN969x fan monitoring support Robert Marko
2026-10-13 12:56 ` [PATCH 4/6] hwmon: sparx5: add LAN969x PWM support Robert Marko
2026-10-13 13:10   ` sashiko-bot
2026-10-13 12:56 ` [PATCH 5/6] hwmon: sparx5: register LAN969x fan as a cooling device Robert Marko
2026-10-13 12:56 ` [PATCH 6/6] arm64: dts: microchip: lan969x: add fan controller Robert Marko
2026-10-13 16:30 ` Conor Dooley [this message]
2026-10-13 16:38   ` [PATCH 1/6] dt-bindings: hwmon: sparx5: add LAN969x " Conor Dooley
2026-10-13 17:08   ` Robert Marko
2026-10-13 17:31     ` Conor Dooley

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=20261013-stylized-plethora-2a9e27545adb@spud \
    --to=conor@kernel.org \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=daniel.machon@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=luka.perkov@sartura.hr \
    --cc=nicolas.ferre@microchip.com \
    --cc=robert.marko@sartura.hr \
    --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