OSDN Git Service

dt-bindings: iio: temperature: ltc2983: require custom sensor tables
authorCosmin Tanislav <cosmin.tanislav@analog.com>
Thu, 3 Nov 2022 13:00:34 +0000 (15:00 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 23 Nov 2022 19:54:00 +0000 (19:54 +0000)
The driver will error out when a custom sensor type is used but a
custom sensor table is not provided. Require it in the binding too.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20221103130041.2153295-7-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml

index 4f26b33..bbac5f5 100644 (file)
@@ -130,6 +130,15 @@ patternProperties:
             - description: Voltage point in nV, signed.
             - description: Temperature point in uK.
 
+    allOf:
+      - if:
+          properties:
+            adi,sensor-type:
+              const: 9
+        then:
+          required:
+            - adi,custom-thermocouple
+
   "^diode@":
     type: object
     description:
@@ -263,6 +272,15 @@ patternProperties:
     dependencies:
       adi,current-rotate: [ "adi,rsense-share" ]
 
+    allOf:
+      - if:
+          properties:
+            adi,sensor-type:
+              const: 18
+        then:
+          required:
+            - adi,custom-rtd
+
   "^thermistor@":
     type: object
     description:
@@ -349,6 +367,22 @@ patternProperties:
     dependencies:
       adi,current-rotate: [ "adi,rsense-share" ]
 
+    allOf:
+      - if:
+          properties:
+            adi,sensor-type:
+              const: 26
+        then:
+          required:
+            - adi,custom-steinhart
+      - if:
+          properties:
+            adi,sensor-type:
+              const: 27
+        then:
+          required:
+            - adi,custom-thermistor
+
   "^adc@":
     type: object
     description: Represents a channel which is being used as a direct adc.