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-next>] [day] [month] [year] [list]
Date:   Fri, 15 May 2020 19:26:18 -0700
From:   Jonathan Bakker <xc-racer2@...e.ca>
To:     jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
        pmeerw@...erw.net, robh+dt@...nel.org, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Cc:     linus.walleij@...aro.org, Jonathan Bakker <xc-racer2@...e.ca>
Subject: [PATCH 1/2] dt-bindings: iio: adc: Add binding for current-from-voltage

Some devices may require a current adc, but only have a voltage
ADC onboard.  In order to read the current, they have a resistor
connected to the ADC.  Add bindings for this possibility.

Signed-off-by: Jonathan Bakker <xc-racer2@...e.ca>
---
 .../iio/adc/linux,current-from-voltage.yaml   | 47 +++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/linux,current-from-voltage.yaml

diff --git a/Documentation/devicetree/bindings/iio/adc/linux,current-from-voltage.yaml b/Documentation/devicetree/bindings/iio/adc/linux,current-from-voltage.yaml
new file mode 100644
index 000000000000..385d317607c3
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/linux,current-from-voltage.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/linux,current-from-voltage.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Current ADC from voltage ADC and resistor
+
+maintainers:
+  - Jonathan Bakker <xc-racer2@...e.ca>
+
+properties:
+  compatible:
+    const: linux,current-from-voltage
+
+  io-channel-names:
+    const: adc
+
+  io-channels:
+    maxItems: 1
+    description: Voltage ADC channel
+
+  linux,resistor-ohms:
+    description: Strength of resistor connected to voltage ADC
+
+  "#io-channel-cells":
+    const: 0
+
+required:
+  - compatible
+  - io-channel-names
+  - io-channels
+  - linux,resistor-ohms
+  - "#io-channel-cells"
+
+examples:
+  - |
+    current-from-voltage {
+      compatible = "linux,current-from-voltage";
+      io-channel-names = "adc";
+      io-channels = <&adc 9>;
+      linux,resistor-ohms = <47>;
+      #io-channel-cells = <0>;
+      io-channel-ranges;
+    };
+
+...
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ