[PATCH 1/3] ASoC: dt-bindings: qcom,wsa881x: Allow sound-name-prefix
Reference common DAI properties to fix:
sdm845-db845c.dtb: speaker@0,1: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml index d702b489320f..ac03672ebf6d 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml @@ -15,6 +15,9 @@ description: | Their primary operating mode uses a SoundWire digital audio interface. This binding is for SoundWire interface.
+allOf: + - $ref: dai-common.yaml# + properties: compatible: const: sdw10217201000 @@ -39,7 +42,7 @@ required: - "#thermal-sensor-cells" - "#sound-dai-cells"
-additionalProperties: false +unevaluatedProperties: false
examples: - |
The "slim-ifc-dev" property should not be just "true", because it allows any type.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml index 184e8ccbdd13..39b27126cfc1 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml @@ -28,7 +28,9 @@ properties: description: GPIO spec for reset line to use maxItems: 1
- slim-ifc-dev: true + slim-ifc-dev: + description: IFC device interface + $ref: /schemas/types.yaml#/definitions/phandle
clocks: maxItems: 1
On Fri, Jan 13, 2023 at 05:22:13PM +0100, Krzysztof Kozlowski wrote:
The "slim-ifc-dev" property should not be just "true", because it allows any type.
Yes, but it is common, so it should be in a common schema. Though there's only one other binding using it (wcd9335.txt).
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml index 184e8ccbdd13..39b27126cfc1 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml @@ -28,7 +28,9 @@ properties: description: GPIO spec for reset line to use maxItems: 1
- slim-ifc-dev: true
slim-ifc-dev:
description: IFC device interface
$ref: /schemas/types.yaml#/definitions/phandle
clocks: maxItems: 1
-- 2.34.1
On 17/01/2023 20:27, Rob Herring wrote:
On Fri, Jan 13, 2023 at 05:22:13PM +0100, Krzysztof Kozlowski wrote:
The "slim-ifc-dev" property should not be just "true", because it allows any type.
Yes, but it is common, so it should be in a common schema. Though there's only one other binding using it (wcd9335.txt).
This is still wcd9335 and wcd934x specific, not really common. Maybe next Qualcomm codec would also bring it so then we can define common schema for the codecs. But so far I think it is not really a common property.
Best regards, Krzysztof
On Wed, Jan 18, 2023 at 5:25 AM Krzysztof Kozlowski krzysztof.kozlowski@linaro.org wrote:
On 17/01/2023 20:27, Rob Herring wrote:
On Fri, Jan 13, 2023 at 05:22:13PM +0100, Krzysztof Kozlowski wrote:
The "slim-ifc-dev" property should not be just "true", because it allows any type.
Yes, but it is common, so it should be in a common schema. Though there's only one other binding using it (wcd9335.txt).
This is still wcd9335 and wcd934x specific, not really common. Maybe next Qualcomm codec would also bring it so then we can define common schema for the codecs. But so far I think it is not really a common property.
By common, I only mean used by more than 1 binding. That's already the case, there's just not a schema for the 2nd one. In any case, can address that later.
Acked-by: Rob Herring robh@kernel.org
On 18/01/2023 14:19, Rob Herring wrote:
On Wed, Jan 18, 2023 at 5:25 AM Krzysztof Kozlowski krzysztof.kozlowski@linaro.org wrote:
On 17/01/2023 20:27, Rob Herring wrote:
On Fri, Jan 13, 2023 at 05:22:13PM +0100, Krzysztof Kozlowski wrote:
The "slim-ifc-dev" property should not be just "true", because it allows any type.
Yes, but it is common, so it should be in a common schema. Though there's only one other binding using it (wcd9335.txt).
This is still wcd9335 and wcd934x specific, not really common. Maybe next Qualcomm codec would also bring it so then we can define common schema for the codecs. But so far I think it is not really a common property.
By common, I only mean used by more than 1 binding. That's already the case, there's just not a schema for the 2nd one. In any case, can address that later.
Acked-by: Rob Herring robh@kernel.org
Sure!
Best regards, Krzysztof
The WCD9340 audio codec appears on Slimbus twice: as IFD device without properties and the actual audio-codec referencing the former via wcd9340_ifd. Allow in the binding both versions to fix several warnings like:
sdm850-samsung-w737.dtb: ifd@0,0: 'reset-gpios' is a required property sdm850-samsung-w737.dtb: ifd@0,0: 'slim-ifc-dev' is a required property sdm850-samsung-w737.dtb: ifd@0,0: 'interrupt-controller' is a required property
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
---
oneOf: interrupts-extended|interrupts is needed to avoid dtschema limitation. --- .../bindings/sound/qcom,wcd934x.yaml | 58 ++++++++++++++----- 1 file changed, 43 insertions(+), 15 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml index 39b27126cfc1..ea09590bfa30 100644 --- a/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml +++ b/Documentation/devicetree/bindings/sound/qcom,wcd934x.yaml @@ -149,21 +149,49 @@ patternProperties: required: - compatible - reg - - reset-gpios - - slim-ifc-dev - - interrupts - - interrupt-controller - - clock-frequency - - clock-output-names - - qcom,micbias1-microvolt - - qcom,micbias2-microvolt - - qcom,micbias3-microvolt - - qcom,micbias4-microvolt - - "#interrupt-cells" - - "#clock-cells" - - "#sound-dai-cells" - - "#address-cells" - - "#size-cells" + +allOf: + - if: + required: + - slim-ifc-dev + then: + required: + - reset-gpios + - slim-ifc-dev + - interrupt-controller + - clock-frequency + - clock-output-names + - qcom,micbias1-microvolt + - qcom,micbias2-microvolt + - qcom,micbias3-microvolt + - qcom,micbias4-microvolt + - "#interrupt-cells" + - "#clock-cells" + - "#sound-dai-cells" + - "#address-cells" + - "#size-cells" + oneOf: + - required: + - interrupts-extended + - required: + - interrupts + else: + properties: + reset-gpios: false + slim-ifc-dev: false + interrupts: false + interrupt-controller: false + clock-frequency: false + clock-output-names: false + qcom,micbias1-microvolt: false + qcom,micbias2-microvolt: false + qcom,micbias3-microvolt: false + qcom,micbias4-microvolt: false + "#interrupt-cells": false + "#clock-cells": false + "#sound-dai-cells": false + "#address-cells": false + "#size-cells": false
additionalProperties: false
On Fri, 13 Jan 2023 17:22:14 +0100, Krzysztof Kozlowski wrote:
The WCD9340 audio codec appears on Slimbus twice: as IFD device without properties and the actual audio-codec referencing the former via wcd9340_ifd. Allow in the binding both versions to fix several warnings like:
sdm850-samsung-w737.dtb: ifd@0,0: 'reset-gpios' is a required property sdm850-samsung-w737.dtb: ifd@0,0: 'slim-ifc-dev' is a required property sdm850-samsung-w737.dtb: ifd@0,0: 'interrupt-controller' is a required property
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
oneOf: interrupts-extended|interrupts is needed to avoid dtschema limitation.
.../bindings/sound/qcom,wcd934x.yaml | 58 ++++++++++++++----- 1 file changed, 43 insertions(+), 15 deletions(-)
Reviewed-by: Rob Herring robh@kernel.org
On Fri, 13 Jan 2023 17:22:12 +0100, Krzysztof Kozlowski wrote:
Reference common DAI properties to fix:
sdm845-db845c.dtb: speaker@0,1: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+'
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
Documentation/devicetree/bindings/sound/qcom,wsa881x.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Acked-by: Rob Herring robh@kernel.org
participants (2)
-
Krzysztof Kozlowski
-
Rob Herring