LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Oskar Senft <osk@google.com>,
	linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Jean Delvare <jdelvare@suse.com>, Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH] dt-bindings: hwmon: Add nct7802 bindings
Date: Fri, 10 Sep 2021 09:10:07 -0700	[thread overview]
Message-ID: <71c17c47-ca9e-e9d2-7b89-cc25b512c06a@roeck-us.net> (raw)
In-Reply-To: <20210910130337.2025426-1-osk@google.com>

On 9/10/21 6:03 AM, Oskar Senft wrote:
> Document bindings for the Nuvoton NCT7802Y driver.
> 
> Signed-off-by: Oskar Senft <osk@google.com>
> ---
>   .../bindings/hwmon/nuvoton,nct7802.yaml       | 66 +++++++++++++++++++
>   1 file changed, 66 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/hwmon/nuvoton,nct7802.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/nuvoton,nct7802.yaml b/Documentation/devicetree/bindings/hwmon/nuvoton,nct7802.yaml
> new file mode 100644
> index 000000000000..bc4b69aeb116
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/nuvoton,nct7802.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/hwmon/nuvoton,nct7802.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Nuvoton NCT7802Y Hardware Monitoring IC
> +
> +maintainers:
> +  - Guenter Roeck <linux@roeck-us.net>
> +
> +description: |
> +  The NCT7802Y is a hardware monitor IC which supports one on-die and up to
> +  5 remote temperature sensors with SMBus interface.
> +
> +  Datasheets:
> +    https://www.nuvoton.com/export/resource-files/Nuvoton_NCT7802Y_Datasheet_V12.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - nuvoton,nct7802
> +
> +  reg:
> +    maxItems: 1
> +
> +  nuvoton,rtd-modes:
> +    description: |
> +      Select modes for the three RTDs.
> +
At the very least, "RTD" should be defined. The datasheet doesn't say explicitly,
but I suspect it means "Remote Temperature Diode".

> +      The order is RTD1, RTD2, RTD3.
> +
> +      Valid values for RTD1 and RTD2 are:
> +        "closed",
> +        "current",
> +        "thermistor",
> +        "voltage"
> +
> +      Valid values for RTD3 are:
> +        "closed",
> +        "thermistor",
> +        "voltage"
> +    type: stringlist

I am not sure what "closed" means (the datasheet doesn't say), but I suspect it means
that the sensor is disabled (?). For the other modes, the translation to the standard
ABI is:

current -> 3 (thermal diode)
thermistor -> 4 (thermistor)
voltage -> 2 (3904 transistor)

That makes me wonder if it would be better to define generic thermal sensor
properties (possibly aligned with the ABI) instead of chip specific ones.
That would probably require sub-nodes to be able to express if a specific
sensor is enabled/disabled. Rob, any thoughts ?

Thanks,
Guenter

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        nct7802@28 {
> +            compatible = "nuvoton,nct7802";
> +            reg = <0x28>;
> +            nuvoton,sensor-modes =
> +              /* RTD1 */ "thermistor",
> +              /* RTD2 */ "voltage",
> +              /* RTD3 */ "closed";
> +        };
> +    };
> 


  reply	other threads:[~2021-09-10 16:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 13:03 Oskar Senft
2021-09-10 16:10 ` Guenter Roeck [this message]
2021-09-10 20:44   ` Oskar Senft
2021-09-10 21:28     ` Guenter Roeck
2021-09-14 12:41       ` Oskar Senft
2021-09-14 15:08         ` Guenter Roeck
2021-09-14 17:11           ` Oskar Senft
2021-09-14 17:33             ` Guenter Roeck
2021-09-16 19:19               ` Oskar Senft
2021-09-16 19:34                 ` Guenter Roeck
2021-09-16 19:53                   ` Oskar Senft
2021-09-16 20:07                     ` Guenter Roeck
2021-09-16 20:10                       ` Oskar Senft
2021-09-17  3:09                         ` Oskar Senft
2021-09-17  3:29                           ` Guenter Roeck
2021-09-12  4:03     ` Guenter Roeck
2021-09-10 21:03 ` Rob Herring

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=71c17c47-ca9e-e9d2-7b89-cc25b512c06a@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osk@google.com \
    --cc=robh+dt@kernel.org \
    --subject='Re: [PATCH] dt-bindings: hwmon: Add nct7802 bindings' \
    /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

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).