lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Sep 2021 23:09:16 -0400
From:   Oskar Senft <osk@...gle.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     linux-hwmon@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
        Rob Herring <robh+dt@...nel.org>
Subject: Re: [PATCH] dt-bindings: hwmon: Add nct7802 bindings

Ok, I experimented with that and I think I'm starting to get an idea
how the DT bindings YAML works.

> > Yes, let's do that. I'd like us to keep the "sensors" subnode to have a clear
> > association and differentiator to other sub-nodes such as "regulators".
> > Open is if we can use "temperature-sensor@0" or if it would have to be
> > a chip specific "ltd", but I think we can sort that out after suggesting
> > an initial set of bindings to Rob.

However, I found that when I use the name@x syntax, the schema
validator also requires the use of a reg or ranges property. But then
doing so requires to set the #address-cells and #size-cells
properties, which - I think - makes things weird.

So these two examples are options that validate:
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        nct7802@28 {
            compatible = "nuvoton,nct7802";
            reg = <0x28>;

            temperature-sensors {
                ltd {
                  status = "disabled";
                  label = "mainboard temperature";
                };

                rtd1 {
                  status = "okay";
                  label = "inlet temperature";
                  type = <4> /* thermistor */;
                };
            };
        };
    };

or

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

        nct7802@28 {
            compatible = "nuvoton,nct7802";
            reg = <0x28>;

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

                sensor@0 {
                  reg = <0>;
                  status = "disabled";
                  label = "mainboard temperature";
                };

                sensor@1 {
                  reg = <1>;
                  status = "okay";
                  label = "inlet temperature";
                  type = <4> /* thermistor */;
                };
            };
        };
    };

In the second case we end up having to duplicate information, i.e.
"sensor@1" and "reg = <1>". Also, I have not yet found a way to
validate that the "@x" is identical to the "reg = <x>". I believe that
this is just how it is in device trees, but I want to make sure this
is what we want?

Thoughts?

Thanks
Oskar.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ