[PATCH 4/4] dt-bindings: hwmon: Add Amphenol ChipCap 2

From: Javier Carrasco
Date: Wed Nov 08 2023 - 07:30:20 EST


Add device tree bindings and an example for the ChipCap 2 humidity
and temperature sensor.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
---
.../bindings/hwmon/amphenol,chipcap2.yaml | 72 ++++++++++++++++++++++
1 file changed, 72 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/amphenol,chipcap2.yaml b/Documentation/devicetree/bindings/hwmon/amphenol,chipcap2.yaml
new file mode 100644
index 000000000000..f0ab20eb418a
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/amphenol,chipcap2.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/amphenol,chipcap2.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ChipCap 2 humidity and temperature iio sensor
+
+maintainers:
+ - Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>
+
+description: |
+ Relative humidity and temperature sensor on I2C bus.
+
+ Datasheets:
+ https://www.amphenol-sensors.com/en/telaire/humidity/527-humidity-sensors/3095-chipcap-2
+
+properties:
+ compatible:
+ enum:
+ - amphenol,cc2dxx
+ - amphenol,cc2dxxs
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 3
+ description: |
+ The device provides three optional interrupts. READY indicates that
+ a measurement was finished. LOW indicates a low humidity alarm and
+ HIGH a high humidity alarm.
+ All interrupts must be IRQ_TYPE_RISING_EDGE.
+
+ interrupt-names:
+ items:
+ - const: READY
+ - const: LOW
+ - const: HIGH
+
+ vdd-supply:
+ description:
+ Dedicated, controllable supply-regulator to reset the device and
+ enter in command mode. If defined, it must provide a GPIO for its
+ control.
+ If not defined, no alarms will be available.
+
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ humidity@28 {
+ compatible = "amphenol,cc2dxxs";
+ reg = <0x28>;
+ interrupt-parent = <&gpio>;
+ interrupts = <4 IRQ_TYPE_EDGE_RISING>,
+ <5 IRQ_TYPE_EDGE_RISING>,
+ <6 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "READY", "LOW", "HIGH";
+ vdd-supply = <&reg_vdd>;
+ };
+ };

--
2.39.2