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:   Tue, 14 Sep 2021 08:41:36 -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

Hi Guenter

> https://lore.kernel.org/linux-hwmon/cover.1631021349.git.krzysztof.adamski@nokia.com/
>
> That specifically includes the ability to enable or disable channels
> using the standard 'status' property. While that series is primarily
> for the n-factor property supported by the tmp421, the same approach
> can be used for [temperature] sensor properties on other chips as well.

Good pointer! I should be able to replicate that for the LTD (@0) and
RTDs (1, 2, 3) in a similar way.

> I put [temperature] in [] because we'd need to find a means to express
> if the sub-nodes are for temperature, voltage, or something else, but
> I think the basic principle is sound.
Following the example from tmp421, this could then be like this:

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

    nct7802@28 {
        compatible = "nuvoton,nct7802";
        reg = <0x28>;
        #address-cells = <1>;
        #size-cells = <0>;

        /* LTD */
        input@0 {
            reg = <0x0>;
            status = "okay";
            /* No "mode" attribute here*/
            label = "local temp";
        };

        /* RTD1 */
        input@1 {
            reg = <0x1>;
            mode = <0x2>; /* 3904 transistor */
            label = "voltage mode";
        };

        input@2 {
            reg = <0x2>;
            mode = <0x4>; /* thermistor */
            label = "thermistor mode";
        };

        /* RTD3 */
        input@3 {
            reg = <0x3>;
            mode = <0x3>; /* thermal diode */
            label = "current mode";
            status = "disabled";
        };
    };
};

I noticed that "nct7802_temp_is_visible" only allows the temperature
sensor to be visible for current and thermistor but not voltage. Is
that right?

Before I go and change the driver further, I'd like to make sure we
agree on the interface.

Also: Is nct7802_temp_is_visible called again after temp_type_store
was called (I didn't try it)?

Thanks
Oskar.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ