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]
Message-ID: <20231016070318.28355-1-andre.werner@systec-electronic.com>
Date:   Mon, 16 Oct 2023 09:02:04 +0200
From:   werneazc@...il.com
To:     jic23@...nel.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
        lars@...afoo.de
Cc:     devicetree@...r.kernel.org, linux-iio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Andre Werner <andre.werner@...tec-electronic.com>
Subject: [PATCH v3 1/2] dt-bindings: iio: adc: ti,ads7038: Add description for ADS7038

From: Andre Werner <andre.werner@...tec-electronic.com>

Add basic description for ADS7038 ADC devices.
The devicetree adds the following device specific options:

- average-samples: Program device's programmable average filter.
- crc-enabled: Enable the CRC check for SPI transfers. Sadly, this
  option has currently no effect in the driver.
- status-enabled: Enable the appending of the device's status on the
  measure value transmission.
- gpio-controller: Sadly function not implemented yet in the driver.

Signed-off-by: Andre Werner <andre.werner@...tec-electronic.com>
---
v3
- Delete ADS7138 compatible and comments.
- Add options for CRC, status and average samples as well as
  gpio-controller.
- Update example.
- add regulator for digital IO voltage.
---
 .../bindings/iio/adc/ti,ads7038.yaml          | 83 +++++++++++++++++++
 1 file changed, 83 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml

diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml
new file mode 100644
index 000000000000..fc1054ca93f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,ads7038.yaml
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,ads7038.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments ADS7038 and similar ADCs
+
+maintainers:
+  - Andre Werner <andre.werner@...tec-electronic.com>
+
+description: |
+  Family of 7 channel, 12 bit ADCs with SPI interface.
+
+  Datasheet: https://www.ti.com/lit/gpn/ads7038
+
+properties:
+  compatible:
+    enum:
+      - ti,ads7038
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 60000000
+
+  avdd-supply:
+    description: Analog supply voltage, also used as the reference voltage to the ADC.
+
+  dvdd-supply:
+    description: Digital I/O supply voltage.
+
+  average-samples:
+    description: |
+      If specified ADC is configured for avaraging measurements (OSR_CFG Register).
+      This effects output format for measurement and sampling time.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3, 4, 5, 6, 7]
+
+  status-enabled:
+    description: |
+      If specified ADC transmits chip status (DATA_CFG Register).
+
+  crc-enabled:
+    description: |
+      Checking the integrity of the data bits exchanged over
+      SPI interface (GENERAL_CFG Register).
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+    description: |
+      Should be 2. See gpio.txt in this directory for a
+      description of the cells format.
+
+required:
+  - compatible
+  - reg
+  - avdd-supply
+  - dvdd-supply
+  - gpio-controller
+  - "#gpio-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            compatible = "ti,ads7038";
+            reg = <0>;
+            avdd-supply = <&refin_avdd_supply>;
+            dvdd-supply = <&refin_dvdd_supply>;
+            spi-max-frequency = <10000000>;
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+    };
-- 
2.42.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ