diff mbox series

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

Message ID 20240816-midas-audio-tab3-v2-1-48ee7f2293b3@gmail.com
State Not Applicable
Headers show
Series ASoC: samsung: midas_wm1811: Separate compatible for tab3 + fixes | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 41 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Artur Weber Aug. 16, 2024, 7:50 a.m. UTC
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@gmail.com>
---
Changes in v2:
- Use anyOf instead of oneOf in headset-detect-gpios/headset-key-gpios
  if: statement
---
 .../bindings/sound/samsung,midas-audio.yaml        | 29 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

Comments

Artur Weber Aug. 16, 2024, 7:57 a.m. UTC | #1
On 16.08.2024 09:50, Artur Weber wrote:
> 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")

Sorry, looks like the Reviewed-by tag from Rob Herring[1] didn't apply:

 > Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

Best regards
Artur

[1] 
https://lore.kernel.org/all/172235554875.1349313.9208770866983277057.robh@kernel.org/

> Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
> ---
> Changes in v2:
> - Use anyOf instead of oneOf in headset-detect-gpios/headset-key-gpios
>    if: statement
> ---
>   .../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..5483421a6fd3 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@samsung.com>
>   
> -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:
> +      anyOf:
> +        - 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:
>
Rob Herring Aug. 16, 2024, 10:35 p.m. UTC | #2
On Fri, 16 Aug 2024 09:50:58 +0200, Artur Weber wrote:
> 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@gmail.com>
> ---
> Changes in v2:
> - Use anyOf instead of oneOf in headset-detect-gpios/headset-key-gpios
>   if: statement
> ---
>  .../bindings/sound/samsung,midas-audio.yaml        | 29 +++++++++++++++++++---
>  1 file changed, 26 insertions(+), 3 deletions(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml
index 69ddfd4afdcd..5483421a6fd3 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@samsung.com>
 
-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:
+      anyOf:
+        - 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: