Linux Documentation
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: tze.yee.ng@altera.com
Cc: Guenter Roeck <linux@roeck-us.net>, 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, Dinh Nguyen <dinguyen@kernel.org>,
	 Mahesh Rao <mahesh.rao@altera.com>,
	Jonathan Corbet <corbet@lwn.net>,
	 Shuah Khan <skhan@linuxfoundation.org>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH 1/5] dt-bindings: hwmon: add Altera Stratix 10 hardware monitor binding
Date: Mon, 22 Jun 2026 16:04:22 +0200	[thread overview]
Message-ID: <20260622-wakeful-grumpy-condor-4e542c@quoll> (raw)
In-Reply-To: <ac5a118394e96f707823463fedd32b6a484c1ceb.1781861409.git.tze.yee.ng@altera.com>

On Fri, Jun 19, 2026 at 02:38:52AM -0700, tze.yee.ng@altera.com wrote:
> From: Tze Yee Ng <tze.yee.ng@altera.com>
> 
> Document the device tree binding for the Altera Stratix 10 SoC FPGA
> hardware monitor, including temperature and voltage sensor nodes.
> 
> Signed-off-by: Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
> Signed-off-by: Tze Yee Ng <tze.yee.ng@altera.com>
> ---
>  .../bindings/hwmon/altr,stratix10-hwmon.yaml  | 164 ++++++++++++++++++
>  MAINTAINERS                                   |   7 +
>  2 files changed, 171 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/altr,stratix10-hwmon.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/altr,stratix10-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/altr,stratix10-hwmon.yaml
> new file mode 100644
> index 000000000000..5bd98660ee7b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/altr,stratix10-hwmon.yaml
> @@ -0,0 +1,164 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/altr,stratix10-hwmon.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Altera Hardware Monitor for Stratix 10 SoC FPGA
> +
> +maintainers:
> +  - Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
> +  - Tze Yee Ng <tze.yee.ng@altera.com>
> +
> +description: |
> +  The Altera Stratix 10 SoC FPGA hardware monitor unit provides on-chip
> +  voltage and temperature sensors. These sensors can be used to monitor
> +  external voltages and on-chip operating conditions such as internal
> +  power rails and on-chip junction temperatures.
> +
> +  The specific sensor configuration varies by device. Check the device
> +  documentation to verify which sensors are available.
> +
> +  Stratix 10 voltage sensors:
> +
> +    page 0, channel 2 = 0.8V VCC
> +    page 0, channel 3 = 1.8V VCCIO_SDM
> +    page 0, channel 6 = 0.9V VCCERAM
> +
> +  Stratix 10 temperature sensors:
> +
> +    page 0, channel 0 = main die
> +    page 0, channel 1 = tile bottom left
> +    page 0, channel 2 = tile middle left
> +    page 0, channel 3 = tile top left
> +    page 0, channel 4 = tile bottom right
> +    page 0, channel 5 = tile middle right
> +    page 0, channel 6 = tile top right
> +    page 0, channel 7 = hbm2 bottom
> +    page 0, channel 8 = hbm2 top
> +
> +properties:
> +  compatible:
> +    const: altr,stratix10-hwmon
> +

Where are top-level properties? clocks? interrupts? power-domain,
resets? address space? Anything? Did you read writing bindings doc?

> +  temperature:
> +    description:
> +      The temperature node specifies mappings of temperature sensor diodes on
> +      the Stratix 10 SoC FPGA main die and tile die.
> +    type: object

Blank line

> +    properties:
> +      '#address-cells':
> +        const: 1
> +      '#size-cells':
> +        const: 0

Blank line

> +    patternProperties:
> +      "^input(@[0-9a-f]+)?$":

Unit address should not be optional.

Also, use consistent style of quotes.

> +        description:
> +          The input node specifies each individual temperature sensor.
> +        type: object
> +        properties:
> +          reg:
> +            description:
> +              Sensor channel index in the lower 16-bits (0-15). For temperature
> +              sensors, the page number is encoded in the upper 16-bits.
> +              The driver encodes the SMC request argument as a channel
> +              bitmask (1 << channel) in bits 0..15, with the page number
> +              placed in bits 16..31. Channel values >= 16 are rejected to
> +              avoid overlap with the page field. For example, reg = <2>
> +              selects channel 2 and the driver passes 0x4 to the service layer.
> +          label:
> +            description:
> +              A descriptive name for this channel (e.g. "Main Die" or
> +              "Tile Bottom Left").
> +        required:
> +          - reg
> +        additionalProperties: false

All this is difficult to read. Please open other bindings to understand
the style used in Linux kernel.

> +    required:
> +      - '#address-cells'
> +      - '#size-cells'
> +    additionalProperties: false
> +
> +  voltage:
> +    description:
> +      The voltage node specifies mappings of voltage sensors on the Stratix 10
> +      SoC FPGA analog to digital converter of the Secure Device Manager (SDM).
> +    type: object
> +    properties:
> +      '#address-cells':
> +        const: 1
> +      '#size-cells':
> +        const: 0
> +    patternProperties:
> +      "^input(@[0-9a-f]+)?$":

Isn't this usually called channel?

> +        description:
> +          The input node specifies each individual voltage sensor.
> +        type: object
> +        properties:
> +          reg:
> +            description:
> +              Sensor channel index in the lower 16-bits (0-15). The driver
> +              encodes the SMC request argument as a channel bitmask
> +              (1 << channel). For example, reg = <2> selects channel 2 and
> +              the driver passes 0x4 to the service layer.
> +          label:
> +            description:
> +              A descriptive name for this channel (e.g. "0.8V VCC" or
> +              "1.8V VCCIO_SDM").
> +        required:
> +          - reg
> +        additionalProperties: false
> +    required:
> +      - '#address-cells'
> +      - '#size-cells'
> +    additionalProperties: false
> +
> +required:
> +  - compatible
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    hwmon {
> +      compatible = "altr,stratix10-hwmon";
> +
> +      voltage {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        input@2 {
> +          label = "0.8V VCC";
> +          reg = <2>;
> +        };
> +
> +        input@3 {
> +          label = "1.8V VCCIO_SDM";
> +          reg = <3>;
> +        };
> +
> +        input@6 {
> +          label = "0.9V VCCERAM";
> +          reg = <6>;
> +        };
> +      };
> +
> +      temperature {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        input@0 {
> +          label = "Main Die";
> +          reg = <0>;
> +        };
> +
> +        input@1 {
> +          label = "Tile Bottom Left";
> +          reg = <1>;
> +        };
> +
> +        input@2 {
> +          label = "Tile Middle Left";
> +          reg = <2>;
> +        };
> +      };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 6aa3fe2ee1bb..678f6c429627 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -937,6 +937,13 @@ ALPS PS/2 TOUCHPAD DRIVER
>  R:	Pali Rohár <pali@kernel.org>
>  F:	drivers/input/mouse/alps.*
>  
> +ALTERA STRATIX 10 SoC FPGA HWMON DRIVER
> +M:	Nazim Amirul <muhammad.nazim.amirul.nazle.asmade@altera.com>
> +M:	Tze Yee Ng <tze.yee.ng@altera.com>
> +L:	linux-hwmon@vger.kernel.org
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/hwmon/altr,stratix10-hwmon.yaml
> +
>  ALTERA MAILBOX DRIVER

Does not look sorted. Please read this file before changing it.

Best regards,
Krzysztof


  reply	other threads:[~2026-06-22 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  9:38 [PATCH 0/5] hwmon: add Altera Stratix 10 SoC FPGA hardware monitor support tze.yee.ng
2026-06-19  9:38 ` [PATCH 1/5] dt-bindings: hwmon: add Altera Stratix 10 hardware monitor binding tze.yee.ng
2026-06-22 14:04   ` Krzysztof Kozlowski [this message]
2026-06-22 14:04   ` Krzysztof Kozlowski
2026-06-19  9:38 ` [PATCH 2/5] dt-bindings: firmware: svc: add hwmon property tze.yee.ng
2026-06-22 14:05   ` Krzysztof Kozlowski
2026-06-19  9:38 ` [PATCH 3/5] firmware: stratix10-svc: add async HWMON read commands tze.yee.ng
2026-06-19  9:38 ` [PATCH 4/5] hwmon: add Stratix 10 SoC FPGA hardware monitor driver tze.yee.ng
2026-06-22 14:08   ` Krzysztof Kozlowski
2026-06-19  9:38 ` [PATCH 5/5] arm64: dts: socfpga: stratix10: add hwmon node tze.yee.ng

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=20260622-wakeful-grumpy-condor-4e542c@quoll \
    --to=krzk@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mahesh.rao@altera.com \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tze.yee.ng@altera.com \
    /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