[PATCH v2 01/11] ASoC: dt-bindings: Add common sound card properties
Almost every board machine / sound cards has "audio-routing" and "model" properties, so move them to common schema to have only one definition of these properties.
For amlogic,gx-sound-card, drop the minItems: 2 from the "audio-routing", because any limit here - lower or upper- is rather meaningless. This will also fix `dtbs_check` warnings like:
meson-gxm-s912-libretech-pc.dtb: sound: audio-routing: ['AU2 INL', 'ACODEC LOLN', 'AU2 INR', 'ACODEC LORN', '7J4-14 LEFT', 'AU2 OUTL', '7J4-11 RIGHT', 'AU2 OUTR'] is too long
Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org ---
Changes in v2: 1. Drop minItems/maxItems from amlogic,gx-sound-card --- .../sound/amlogic,axg-sound-card.yaml | 15 +++-------- .../bindings/sound/amlogic,gx-sound-card.yaml | 17 +++--------- .../devicetree/bindings/sound/fsl,rpmsg.yaml | 17 +++--------- .../bindings/sound/google,sc7180-trogdor.yaml | 17 +++--------- .../sound/google,sc7280-herobrine.yaml | 17 +++--------- .../bindings/sound/imx-audio-card.yaml | 18 +++---------- .../bindings/sound/sound-card-common.yaml | 27 +++++++++++++++++++ 7 files changed, 50 insertions(+), 78 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/sound-card-common.yaml
diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml b/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml index bf1234550343..5db718e4d0e7 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml @@ -9,6 +9,9 @@ title: Amlogic AXG sound card maintainers: - Jerome Brunet jbrunet@baylibre.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: const: amlogic,axg-sound-card @@ -17,23 +20,12 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle-array description: list of auxiliary devices
- audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - description: - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. - audio-widgets: $ref: /schemas/types.yaml#/definitions/non-unique-string-array description: A list off component DAPM widget. Each entry is a pair of strings, the first being the widget type, the second being the widget name
- model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - patternProperties: "^dai-link-[0-9]+$": type: object @@ -108,7 +100,6 @@ patternProperties: - sound-dai
required: - - model - dai-link-0
unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml b/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml index b358fd601ed3..d4277d342e69 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml +++ b/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml @@ -9,6 +9,9 @@ title: Amlogic GX sound card maintainers: - Jerome Brunet jbrunet@baylibre.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: items: @@ -18,14 +21,6 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle-array description: list of auxiliary devices
- audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - minItems: 2 - description: |- - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. - audio-widgets: $ref: /schemas/types.yaml#/definitions/non-unique-string-array minItems: 2 @@ -33,10 +28,6 @@ properties: A list off component DAPM widget. Each entry is a pair of strings, the first being the widget type, the second being the widget name
- model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - patternProperties: "^dai-link-[0-9]+$": type: object @@ -86,7 +77,7 @@ required: - model - dai-link-0
-additionalProperties: false +unevaluatedProperties: false
examples: - | diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml index 6df0e03a1d4b..188f38baddec 100644 --- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml +++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml @@ -17,6 +17,9 @@ description: | such as SAI, MICFIL, .etc through building rpmsg channels between Cortex-A and Cortex-M.
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: @@ -27,10 +30,6 @@ properties: - fsl,imx8ulp-rpmsg-audio - fsl,imx93-rpmsg-audio
- model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - clocks: items: - description: Peripheral clock for register access @@ -66,13 +65,6 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle to a node of audio codec
- audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - description: | - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. - fsl,enable-lpa: $ref: /schemas/types.yaml#/definitions/flag description: enable low power audio path. @@ -101,9 +93,8 @@ properties:
required: - compatible - - model
-additionalProperties: false +unevaluatedProperties: false
examples: - | diff --git a/Documentation/devicetree/bindings/sound/google,sc7180-trogdor.yaml b/Documentation/devicetree/bindings/sound/google,sc7180-trogdor.yaml index ba5b7728cf33..bac940553965 100644 --- a/Documentation/devicetree/bindings/sound/google,sc7180-trogdor.yaml +++ b/Documentation/devicetree/bindings/sound/google,sc7180-trogdor.yaml @@ -13,23 +13,15 @@ maintainers: description: This binding describes the SC7180 sound card which uses LPASS for audio.
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: - google,sc7180-trogdor - google,sc7180-coachz
- audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - description: - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. - - model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - "#address-cells": const: 1
@@ -86,11 +78,10 @@ patternProperties:
required: - compatible - - model - "#address-cells" - "#size-cells"
-additionalProperties: false +unevaluatedProperties: false
examples:
diff --git a/Documentation/devicetree/bindings/sound/google,sc7280-herobrine.yaml b/Documentation/devicetree/bindings/sound/google,sc7280-herobrine.yaml index 0b1a01a4c14e..ec4b6e547ca6 100644 --- a/Documentation/devicetree/bindings/sound/google,sc7280-herobrine.yaml +++ b/Documentation/devicetree/bindings/sound/google,sc7280-herobrine.yaml @@ -13,22 +13,14 @@ maintainers: description: This binding describes the SC7280 sound card which uses LPASS for audio.
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: - google,sc7280-herobrine
- audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - description: - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. - - model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - "#address-cells": const: 1
@@ -97,11 +89,10 @@ patternProperties:
required: - compatible - - model - "#address-cells" - "#size-cells"
-additionalProperties: false +unevaluatedProperties: false
examples:
diff --git a/Documentation/devicetree/bindings/sound/imx-audio-card.yaml b/Documentation/devicetree/bindings/sound/imx-audio-card.yaml index b6f5d486600e..f7ad5ea2491e 100644 --- a/Documentation/devicetree/bindings/sound/imx-audio-card.yaml +++ b/Documentation/devicetree/bindings/sound/imx-audio-card.yaml @@ -9,23 +9,14 @@ title: NXP i.MX audio sound card. maintainers: - Shengjiu Wang shengjiu.wang@nxp.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: - fsl,imx-audio-card
- model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - - audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array - description: - A list of the connections between audio components. Each entry is a - pair of strings, the first being the connection's sink, the second - being the connection's source. Valid names could be power supplies, - MicBias of codec and the jacks on the board. - patternProperties: ".*-dai-link$": description: @@ -84,9 +75,8 @@ patternProperties:
required: - compatible - - model
-additionalProperties: false +unevaluatedProperties: false
examples: - | diff --git a/Documentation/devicetree/bindings/sound/sound-card-common.yaml b/Documentation/devicetree/bindings/sound/sound-card-common.yaml new file mode 100644 index 000000000000..3a941177f684 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/sound-card-common.yaml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/sound-card-common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Board Sound Card Common Properties + +maintainers: + - Mark Brown broonie@kernel.org + +properties: + audio-routing: + $ref: /schemas/types.yaml#/definitions/non-unique-string-array + description: | + A list of the connections between audio components. Each entry is a + pair of strings, the first being the connection's sink, the second + being the connection's source. + + model: + $ref: /schemas/types.yaml#/definitions/string + description: User specified audio sound card name + +required: + - model + +additionalProperties: true
The mediatek,mt8188-mt6359 Linux sound machine driver requires the "model" property, so binding was incomplete. Reference the common sound card properties to fix that which also allows to remove duplicated property definitions. Leave the relevant parts of "audio-routing" description.
Reviewed-by: Rob Herring robh@kernel.org Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- .../bindings/sound/mediatek,mt8188-mt6359.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml index 05e532b5d50a..43b3b67bdf3b 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml @@ -9,23 +9,19 @@ title: MediaTek MT8188 ASoC sound card maintainers: - Trevor Wu trevor.wu@mediatek.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: - mediatek,mt8188-mt6359-evb - mediatek,mt8188-nau8825
- model: - $ref: /schemas/types.yaml#/definitions/string - description: User specified audio sound card name - audio-routing: - $ref: /schemas/types.yaml#/definitions/non-unique-string-array description: - A list of the connections between audio components. Each entry is a - sink/source pair of strings. Valid names could be the input or output - widgets of audio components, power supplies, MicBias of codec and the - software switch. + Valid names could be the input or output widgets of audio components, + power supplies, MicBias of codec and the software switch.
mediatek,platform: $ref: /schemas/types.yaml#/definitions/phandle @@ -86,7 +82,7 @@ patternProperties: required: - link-name
-additionalProperties: false +unevaluatedProperties: false
required: - compatible @@ -96,6 +92,7 @@ examples: - | sound { compatible = "mediatek,mt8188-mt6359-evb"; + model = "MT6359-EVB"; mediatek,platform = <&afe>; pinctrl-names = "default"; pinctrl-0 = <&aud_pins_default>;
On Thu, 10 Aug 2023 08:32:50 +0200, Krzysztof Kozlowski wrote:
The mediatek,mt8188-mt6359 Linux sound machine driver requires the "model" property, so binding was incomplete. Reference the common sound card properties to fix that which also allows to remove duplicated property definitions. Leave the relevant parts of "audio-routing" description.
Reviewed-by: Rob Herring robh@kernel.org Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../bindings/sound/mediatek,mt8188-mt6359.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/2023081006330...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On 10/08/2023 09:20, Rob Herring wrote:
On Thu, 10 Aug 2023 08:32:50 +0200, Krzysztof Kozlowski wrote:
The mediatek,mt8188-mt6359 Linux sound machine driver requires the "model" property, so binding was incomplete. Reference the common sound card properties to fix that which also allows to remove duplicated property definitions. Leave the relevant parts of "audio-routing" description.
Reviewed-by: Rob Herring robh@kernel.org Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../bindings/sound/mediatek,mt8188-mt6359.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
I think the bot responds like this if the patch could not be applied. Probably we can ignore it.
Best regards, Krzysztof
On Thu, Aug 10, 2023 at 1:47 AM Krzysztof Kozlowski krzysztof.kozlowski@linaro.org wrote:
On 10/08/2023 09:20, Rob Herring wrote:
On Thu, 10 Aug 2023 08:32:50 +0200, Krzysztof Kozlowski wrote:
The mediatek,mt8188-mt6359 Linux sound machine driver requires the "model" property, so binding was incomplete. Reference the common sound card properties to fix that which also allows to remove duplicated property definitions. Leave the relevant parts of "audio-routing" description.
Reviewed-by: Rob Herring robh@kernel.org Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../bindings/sound/mediatek,mt8188-mt6359.yaml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
I think the bot responds like this if the patch could not be applied. Probably we can ignore it.
It's because I converted dtschema to use pyproject.toml (the newest and 3rd way to do python packaging). I started getting deprecation warnings on debian testing due to using setup.py. Converting breaks on ubuntu 22.04. Seems to be this bug[1]. The CI job should now be fixed by installing the latest pip version.
Rob
[1] https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/2018288
On Thu, 2023-08-10 at 08:32 +0200, Krzysztof Kozlowski wrote:
The mediatek,mt8188-mt6359 Linux sound machine driver requires the
"model" property, so binding was incomplete. Reference the common sound
card properties to fix that which also allows to remove duplicated
property definitions. Leave the relevant parts of "audio-routing"
description.
Reviewed-by: Rob Herring <robh@kernel.orgmailto:robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.commailto:angelogioacchino.delregno@collabora.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.orgmailto:krzysztof.kozlowski@linaro.org>
---
.../bindings/sound/mediatek,mt8188-mt6359.yaml | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
Acked-by: Trevor Wu <trevor.wu@mediatek.commailto:trevor.wu@mediatek.com>
On Fri, Aug 11, 2023 at 01:57:51AM +0000, Trevor Wu (吳文良) wrote:
On Thu, 2023-08-10 at 08:32 +0200, Krzysztof Kozlowski wrote:
The mediatek,mt8188-mt6359 Linux sound machine driver requires the
"model" property, so binding was incomplete. Reference the common sound
card properties to fix that which also allows to remove duplicated
property definitions. Leave the relevant parts of "audio-routing"
description.
Reviewed-by: Rob Herring <robh@kernel.orgmailto:robh@kernel.org>
Something's really wrecked the formatting of this mail...
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- .../bindings/sound/samsung,aries-wm8994.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,aries-wm8994.yaml b/Documentation/devicetree/bindings/sound/samsung,aries-wm8994.yaml index 447e013f6e17..5ea0819a261a 100644 --- a/Documentation/devicetree/bindings/sound/samsung,aries-wm8994.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,aries-wm8994.yaml @@ -9,6 +9,9 @@ title: Samsung Aries audio complex with WM8994 codec maintainers: - Jonathan Bakker xc-racer2@live.ca
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: enum: @@ -17,10 +20,6 @@ properties: # Without FM radio and modem slave - samsung,fascinate4g-wm8994
- model: - $ref: /schemas/types.yaml#/definitions/string - description: The user-visible name of this sound complex. - cpu: type: object additionalProperties: false @@ -46,6 +45,7 @@ properties:
samsung,audio-routing: $ref: /schemas/types.yaml#/definitions/non-unique-string-array + deprecated: true description: | List of the connections between audio components; each entry is a pair of strings, the first being the @@ -56,6 +56,7 @@ properties: or FM In For samsung,fascinate4g-wm8994: HP, SPK, RCV, LINE, Main Mic, or HeadsetMic + Deprecated, use audio-routing.
extcon: description: Extcon phandle for dock detection @@ -87,10 +88,9 @@ properties:
required: - compatible - - model - cpu - codec - - samsung,audio-routing + - audio-routing - extcon - main-micbias-supply - headset-micbias-supply @@ -98,7 +98,7 @@ required: - headset-detect-gpios - headset-key-gpios
-additionalProperties: false +unevaluatedProperties: false
examples: - | @@ -121,7 +121,7 @@ examples: headset-detect-gpios = <&gph0 6 GPIO_ACTIVE_HIGH>; headset-key-gpios = <&gph3 6 GPIO_ACTIVE_HIGH>;
- samsung,audio-routing = + audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R",
On Thu, 10 Aug 2023 08:32:51 +0200, Krzysztof Kozlowski wrote:
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../bindings/sound/samsung,aries-wm8994.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/2023081006330...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- .../bindings/sound/samsung,midas-audio.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml index 31095913e330..6ec80f529d84 100644 --- a/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,midas-audio.yaml @@ -9,14 +9,13 @@ 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
- model: - $ref: /schemas/types.yaml#/definitions/string - description: The user-visible name of this sound complex. - cpu: type: object additionalProperties: false @@ -38,6 +37,7 @@ properties: - sound-dai
samsung,audio-routing: + deprecated: true $ref: /schemas/types.yaml#/definitions/non-unique-string-array description: | List of the connections between audio components; each entry is @@ -45,6 +45,7 @@ properties: being the connection's source; valid names for sources and sinks are the WM1811's pins (as documented in its binding), and the jacks on the board: HP, SPK, Main Mic, Sub Mic, Headset Mic. + Deprecated, use audio-routing.
mic-bias-supply: description: Supply for the micbias on the Main microphone @@ -62,14 +63,13 @@ properties:
required: - compatible - - model - cpu - codec - - samsung,audio-routing + - audio-routing - mic-bias-supply - submic-bias-supply
-additionalProperties: false +unevaluatedProperties: false
examples: - | @@ -84,7 +84,7 @@ examples: mic-bias-supply = <&mic_bias_reg>; submic-bias-supply = <&submic_bias_reg>;
- samsung,audio-routing = + audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R",
On Thu, 10 Aug 2023 08:32:52 +0200, Krzysztof Kozlowski wrote:
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../bindings/sound/samsung,midas-audio.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/2023081006330...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- .../devicetree/bindings/sound/samsung,odroid.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,odroid.yaml b/Documentation/devicetree/bindings/sound/samsung,odroid.yaml index c6751c40e63f..b77284e3e26a 100644 --- a/Documentation/devicetree/bindings/sound/samsung,odroid.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,odroid.yaml @@ -10,6 +10,9 @@ maintainers: - Krzysztof Kozlowski krzk@kernel.org - Sylwester Nawrocki s.nawrocki@samsung.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: oneOf: @@ -24,10 +27,6 @@ properties: - const: samsung,odroid-xu4-audio deprecated: true
- model: - $ref: /schemas/types.yaml#/definitions/string - description: The user-visible name of this sound complex. - assigned-clock-parents: true assigned-clock-rates: true assigned-clocks: true @@ -52,6 +51,7 @@ properties:
samsung,audio-routing: $ref: /schemas/types.yaml#/definitions/non-unique-string-array + deprecated: true description: | List of the connections between audio components; each entry is a pair of strings, the first being the @@ -61,6 +61,7 @@ properties: For Odroid X2: "Headphone Jack", "Mic Jack", "DMIC" For Odroid U3, XU3: "Headphone Jack", "Speakers" For Odroid XU4: no entries + Deprecated, use audio-routing.
samsung,audio-widgets: $ref: /schemas/types.yaml#/definitions/non-unique-string-array @@ -70,18 +71,17 @@ properties:
required: - compatible - - model - cpu - codec
-additionalProperties: false +unevaluatedProperties: false
examples: - | sound { compatible = "hardkernel,odroid-xu3-audio"; model = "Odroid-XU3"; - samsung,audio-routing = + audio-routing = "Headphone Jack", "HPL", "Headphone Jack", "HPR", "IN1", "Mic Jack",
On Thu, 10 Aug 2023 08:32:53 +0200, Krzysztof Kozlowski wrote:
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../devicetree/bindings/sound/samsung,odroid.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/2023081006330...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- .../devicetree/bindings/sound/samsung,tm2.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/samsung,tm2.yaml b/Documentation/devicetree/bindings/sound/samsung,tm2.yaml index 491e08019c04..760592599143 100644 --- a/Documentation/devicetree/bindings/sound/samsung,tm2.yaml +++ b/Documentation/devicetree/bindings/sound/samsung,tm2.yaml @@ -10,6 +10,9 @@ maintainers: - Krzysztof Kozlowski krzk@kernel.org - Sylwester Nawrocki s.nawrocki@samsung.com
+allOf: + - $ref: sound-card-common.yaml# + properties: compatible: const: samsung,tm2-audio @@ -32,6 +35,8 @@ properties: being the connection's source; valid names for sources and sinks are the WM5110's and MAX98504's pins and the jacks on the board: HP, SPK, Main Mic, Sub Mic, Third Mic, Headset Mic. + Deprecated, use audio-routing. + deprecated: true $ref: /schemas/types.yaml#/definitions/non-unique-string-array
i2s-controller: @@ -44,20 +49,15 @@ properties: mic-bias-gpios: description: GPIO pin that enables the Main Mic bias regulator.
- model: - description: The user-visible name of this sound complex. - $ref: /schemas/types.yaml#/definitions/string - required: - compatible - audio-amplifier - audio-codec - - samsung,audio-routing + - audio-routing - i2s-controller - mic-bias-gpios - - model
-additionalProperties: false +unevaluatedProperties: false
examples: - | @@ -70,7 +70,7 @@ examples: audio-amplifier = <&max98504>; mic-bias-gpios = <&gpr3 2 GPIO_ACTIVE_HIGH>; model = "wm5110"; - samsung,audio-routing = "HP", "HPOUT1L", + audio-routing = "HP", "HPOUT1L", "HP", "HPOUT1R", "SPK", "SPKOUT", "SPKOUT", "HPOUT2L",
On Thu, 10 Aug 2023 08:32:54 +0200, Krzysztof Kozlowski wrote:
Reference the common sound card properties and deprecate the custom "samsung,audio-routing" in favor of generic one. This allows to remove "model" property and make the binding closer to other sounds cards.
Reviewed-by: Rob Herring robh@kernel.org Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org
.../devicetree/bindings/sound/samsung,tm2.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/2023081006330...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
"samsung,audio-widgets" and "samsung,audio-routing" are not boolean properties, thus more appropriate is to use of_property_present() to check if they are present.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- sound/soc/samsung/odroid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index a5442592bde4..1743bd55ba1a 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c @@ -223,14 +223,14 @@ static int odroid_audio_probe(struct platform_device *pdev) if (ret < 0) return ret;
- if (of_property_read_bool(dev->of_node, "samsung,audio-widgets")) { + if (of_property_present(dev->of_node, "samsung,audio-widgets")) { ret = snd_soc_of_parse_audio_simple_widgets(card, "samsung,audio-widgets"); if (ret < 0) return ret; }
- if (of_property_read_bool(dev->of_node, "samsung,audio-routing")) { + if (of_property_present(dev->of_node, "samsung,audio-routing")) { ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); if (ret < 0)
Parse generic sound card "audio-routing" property and fallback to "samsung,audio-routing" if it is missing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- sound/soc/samsung/aries_wm8994.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index 7492bb41456c..dd3cd2c9644a 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -620,10 +620,14 @@ static int aries_audio_probe(struct platform_device *pdev) /* Update card-name if provided through DT, else use default name */ snd_soc_of_parse_card_name(card, "model");
- ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); if (ret < 0) { - dev_err(dev, "Audio routing invalid/unspecified\n"); - return ret; + /* Backwards compatible way */ + ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + if (ret < 0) { + dev_err(dev, "Audio routing invalid/unspecified\n"); + return ret; + } }
aries_dai[1].dai_fmt = priv->variant->modem_dai_fmt;
Parse generic sound card "audio-routing" property and fallback to "samsung,audio-routing" if it is missing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- sound/soc/samsung/midas_wm1811.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index 6931b9a45b3e..9e83ed071f39 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -462,10 +462,14 @@ static int midas_probe(struct platform_device *pdev) return ret; }
- ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); if (ret < 0) { - dev_err(dev, "Audio routing invalid/unspecified\n"); - return ret; + /* Backwards compatible way */ + ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + if (ret < 0) { + dev_err(dev, "Audio routing invalid/unspecified\n"); + return ret; + } }
cpu = of_get_child_by_name(dev->of_node, "cpu");
Parse generic sound card "audio-routing" property and fallback to "samsung,audio-routing" if it is missing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- sound/soc/samsung/odroid.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index 1743bd55ba1a..c93cb5a86426 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c @@ -230,12 +230,13 @@ static int odroid_audio_probe(struct platform_device *pdev) return ret; }
- if (of_property_present(dev->of_node, "samsung,audio-routing")) { - ret = snd_soc_of_parse_audio_routing(card, - "samsung,audio-routing"); - if (ret < 0) - return ret; - } + ret = 0; + if (of_property_present(dev->of_node, "audio-routing")) + ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); + else if (of_property_present(dev->of_node, "samsung,audio-routing")) + ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + if (ret < 0) + return ret;
card->dai_link = odroid_card_dais; card->num_links = ARRAY_SIZE(odroid_card_dais);
Parse generic sound card "audio-routing" property and fallback to "samsung,audio-routing" if it is missing.
Signed-off-by: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org --- sound/soc/samsung/tm2_wm5110.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index d611ec9e5325..5ebf17f3de1e 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -523,10 +523,14 @@ static int tm2_probe(struct platform_device *pdev) return ret; }
- ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + ret = snd_soc_of_parse_audio_routing(card, "audio-routing"); if (ret < 0) { - dev_err(dev, "Audio routing is not specified or invalid\n"); - return ret; + /* Backwards compatible way */ + ret = snd_soc_of_parse_audio_routing(card, "samsung,audio-routing"); + if (ret < 0) { + dev_err(dev, "Audio routing is not specified or invalid\n"); + return ret; + } }
card->aux_dev[0].dlc.of_node = of_parse_phandle(dev->of_node,
On Thu, 10 Aug 2023 08:32:49 +0200, Krzysztof Kozlowski wrote:
Almost every board machine / sound cards has "audio-routing" and "model" properties, so move them to common schema to have only one definition of these properties.
For amlogic,gx-sound-card, drop the minItems: 2 from the "audio-routing", because any limit here - lower or upper- is rather meaningless. This will also fix `dtbs_check` warnings like:
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[01/11] ASoC: dt-bindings: Add common sound card properties commit: a06ce12efb63bad77bd4a6cedc180f181a651920 [02/11] ASoC: dt-bindings: mediatek,mt8188-mt6359: use common sound card commit: 34e7bf1acc33da5b45ded94f459a6e30d4c6acdc [03/11] ASoC: dt-bindings: samsung,aries-wm8994: use common sound card commit: d63cff2ba4d6cb9eed12508469bf8c1b207be4f1 [04/11] ASoC: dt-bindings: samsung,midas-audio: use common sound card commit: e1d776441d7e19cd98d74bb204713940eb6951be [05/11] ASoC: dt-bindings: samsung,odroid: use common sound card commit: 5ddff831f064ee300351ffdd92bfde1e17c88861 [06/11] ASoC: dt-bindings: samsung,tm2: use common sound card commit: 631e9d4b1f3241008bc6f1c62ec0d19d745d02be [07/11] ASoC: samsung: odroid: use of_property_present to check for property commit: ebba2fd5adc2d79afa10c00255a60c79665c091a [08/11] ASoC: samsung: aries_wm8994: parse audio-routing commit: 55ebfafbc32db54259d91383faf65a5bc6bef382 [09/11] ASoC: samsung: midas_wm1811: parse audio-routing commit: c91e67145bc6d03f94416f7fbe566c6f6751cd47 [10/11] ASoC: samsung: odroid: parse audio-routing commit: 2dc8c0366599cb4dfd939e6eafd94010f3aff233 [11/11] ASoC: samsung: tm2_wm5110: parse audio-routing commit: 17b9f4387ebabb19b871bbe2d06562e48e4e7130
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (4)
-
Krzysztof Kozlowski
-
Mark Brown
-
Rob Herring
-
Trevor Wu (吳文良)