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, 11 Jun 2019 11:56:59 +0200
From:   Mylène Josserand <mylene.josserand@...tlin.com>
To:     peda@...ntia.se, jic23@...nel.org, knaack.h@....de,
        lars@...afoo.de, pmeerw@...erw.net, robh+dt@...nel.org,
        mark.rutland@....com
Cc:     linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, thomas.petazzoni@...tlin.com,
        mylene.josserand@...tlin.com
Subject: [PATCH v1 3/3] dt-bindings: iio: afe: Add hwmon example

With the support of CHAN_INFO_PROCESSED in voltage-divider,
it is possible to read the processed values directly from iio's
sysfs entries or by using iio-hwmon. Add an example for this last
use case.

Signed-off-by: Mylène Josserand <mylene.josserand@...tlin.com>
---
 .../bindings/iio/afe/voltage-divider.txt           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
index b452a8406107..f7e1c7cb2744 100644
--- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
+++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.txt
@@ -51,3 +51,27 @@ sysv {
 		spi-max-frequency = <1000000>;
 	};
 };
+
+It is also possible to retrieve the processed values using hwmon node:
+
+div0: div0 {
+	compatible = "voltage-divider";
+	io-channels = <&adc0 0>; /* Channel 0 of the ADC */
+	output-ohms = <47>; /* R2 */
+	full-ohms = <73>; /* R1 (26) + R2 (47) */
+	#io-channel-cells = <1>;
+};
+
+div1: div1 {
+	compatible = "voltage-divider";
+	io-channels = <&adc0 1>; /* Channel 1 of the ADC */
+	output-ohms = <47>; /* R2 */
+	full-ohms = <115>; /* R1 (68) + R2 (47) */
+	#io-channel-cells = <1>;
+};
+
+iio-hwmon {
+	compatible = "iio-hwmon";
+	io-channels = <&div0 0>, <&div1 0>;
+	io-channel-names = "3v3", "usb";
+};
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ