[PATCH v1 1/2] dt-bindings: iio: adc: adding dt-bindings for PAC193X
From: marius.cristea
Date: Mon Feb 20 2023 - 07:33:30 EST
From: Marius Cristea <marius.cristea@xxxxxxxxxxxxx>
This is the device tree schema for iio driver for
Microchip PAC193X series of Power Monitors with Accumulator.
Signed-off-by: Marius Cristea <marius.cristea@xxxxxxxxxxxxx>
---
.../bindings/iio/adc/microchip,pac193x.yaml | 122 ++++++++++++++++++
1 file changed, 122 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/microchip,pac193x.yaml
diff --git a/Documentation/devicetree/bindings/iio/adc/microchip,pac193x.yaml b/Documentation/devicetree/bindings/iio/adc/microchip,pac193x.yaml
new file mode 100644
index 000000000000..e4ea560991e9
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/microchip,pac193x.yaml
@@ -0,0 +1,122 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/microchip,pac193x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip PAC193X Power Monitors with Accumulator
+
+maintainers:
+ - Marius Cristea <marius.cristea@xxxxxxxxxxxxx>
+
+properties:
+ compatible:
+ enum:
+ - microchip,pac1934
+ - microchip,pac1933
+ - microchip,pac1932
+ - microchip,pac1931
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ microchip,samp-rate:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Sampling rate for all device's channels.
+ enum: [8, 64, 256, 1024]
+ default: 1024
+
+required:
+ - compatible
+ - reg
+ - microchip,samp-rate
+ - "#address-cells"
+ - "#size-cells"
+
+patternProperties:
+ "^channel([1-4])@[1-4]+$":
+ $ref: "adc.yaml"
+ type: object
+ description: Represents the external channels which are connected to the ADC.
+
+ properties:
+ reg:
+ description: The channel number.
+ It can have up to 4 channels, numbered from 1 to 4.
+ items:
+ - minimum: 1
+ maximum: 4
+
+ microchip,uohms-shunt-res:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: |
+ Value in micro Ohms of the shunt resistor connected between
+ the SENSE+ and SENSE- inputs, across which the current is measured. Value
+ is needed to compute the scaling of the measured current.
+
+ microchip,rail-name:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: Name of the monitored power rail.
+
+ microchip,bi-directional:
+ description: Whether the channel is bi-directional.
+ type: boolean
+
+ required:
+ - reg
+ - microchip,uohms-shunt-res
+ - microchip,rail-name
+
+ additionalProperties: false
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ pac193x: pac193x@10 {
+ compatible = "microchip,pac1934";
+ reg = <0x10>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+ microchip,samp-rate = <64>;
+
+ channel1@1 {
+ reg = <0x1>;
+ microchip,uohms-shunt-res = <24900000>;
+ microchip,rail-name = "CPU";
+ };
+
+ channel2@2 {
+ reg = <0x2>;
+ microchip,uohms-shunt-res = <49900000>;
+ microchip,rail-name = "GPU";
+ };
+
+ channel3@3 {
+ reg = <0x3>;
+ microchip,uohms-shunt-res = <75000000>;
+ microchip,rail-name = "MEM";
+ microchip,bi-directional;
+ };
+
+ channel4@4 {
+ reg = <0x4>;
+ microchip,uohms-shunt-res = <100000000>;
+ microchip,rail-name = "NET";
+ microchip,bi-directional;
+ };
+ };
+ };
+
+...
--
2.34.1