[PATCH 1/6] ASoC: dt-bindings: midas-audio: Declare required properties for GPIO jack det

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



GPIO jack detection requires an IIO channel and the detection threshold
to work. Explicitly declare the requirement in DT schema.

Fixes: 0a590ecc672a ("ASoC: dt-bindings: samsung,midas-audio: Add GPIO-based headset jack detection")
Signed-off-by: Artur Weber <aweber.kernel@xxxxxxxxx>
---
 .../bindings/sound/samsung,midas-audio.yaml        | 29 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
index 69ddfd4afdcd..e7af3c09de38 100644
--- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
+++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
@@ -9,9 +9,6 @@ title: Samsung Midas audio complex with WM1811 codec
 maintainers:
   - Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>
 
-allOf:
-  - $ref: sound-card-common.yaml#
-
 properties:
   compatible:
     const: samsung,midas-audio
@@ -102,6 +99,32 @@ required:
   - mic-bias-supply
   - submic-bias-supply
 
+allOf:
+  - $ref: sound-card-common.yaml#
+
+  - if:
+      oneOf:
+        - required: [ headset-detect-gpios ]
+        - required: [ headset-key-gpios ]
+    then:
+      required:
+        - io-channels
+        - io-channel-names
+
+  - if:
+      required:
+        - headset-detect-gpios
+    then:
+      required:
+        - samsung,headset-4pole-threshold-microvolt
+
+  - if:
+      required:
+        - headset-key-gpios
+    then:
+      required:
+        - samsung,headset-button-threshold-microvolt
+
 unevaluatedProperties: false
 
 examples:

-- 
2.45.2





[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux