ASoC: meson: convert dt-bindings to schema
Subsystems (4)
Jerome Brunet
maintainercover ASoC: meson: convert dt-bindings to schema
This patchset converts the amlogic sound devices to schema.
Jerome Brunet (9):
ASoC: meson: gx-card: fix sound-dai dt schema
ASoC: meson: convert axg tdm interface to schema
ASoC: meson: convert axg tdm formatters to schema
ASoC: meson: convert axg pdm to schema
ASoC: meson: convert axg fifo to schema
ASoC: meson: convert axg spdif input to schema
ASoC: meson: convert axg spdif output to schema
ASoC: meson: convert g12a tohdmitx control to schema
ASoC: meson: convert axg sound card control to schema
.../bindings/sound/amlogic,axg-fifo.txt | 34 ---- .../bindings/sound/amlogic,axg-fifo.yaml | 111 +++++++++++ .../bindings/sound/amlogic,axg-pdm.txt | 29 --- .../bindings/sound/amlogic,axg-pdm.yaml | 79 ++++++++ .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------ .../sound/amlogic,axg-sound-card.yaml | 181 ++++++++++++++++++ .../bindings/sound/amlogic,axg-spdifin.txt | 27 --- .../bindings/sound/amlogic,axg-spdifin.yaml | 84 ++++++++ .../bindings/sound/amlogic,axg-spdifout.txt | 25 --- .../bindings/sound/amlogic,axg-spdifout.yaml | 77 ++++++++ .../sound/amlogic,axg-tdm-formatters.txt | 36 ---- .../sound/amlogic,axg-tdm-formatters.yaml | 92 +++++++++ .../bindings/sound/amlogic,axg-tdm-iface.txt | 22 --- .../bindings/sound/amlogic,axg-tdm-iface.yaml | 57 ++++++ .../bindings/sound/amlogic,g12a-tohdmitx.txt | 58 ------ .../bindings/sound/amlogic,g12a-tohdmitx.yaml | 53 +++++ .../bindings/sound/amlogic,gx-sound-card.yaml | 4 +- 17 files changed, 736 insertions(+), 357 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.yaml
Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 1/9 ASoC: meson: gx-card: fix sound-dai dt schema
There is a fair amount of warnings when running 'make dtbs_check' with amlogic,gx-sound-card.yaml.
Ex:arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0:1: missing phandle tag in 0 arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0:2: missing phandle tag in 0 arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0: [66, 0, 0] is too long
The reason is that the sound-dai phandle provided has cells, and in such case the schema should use 'phandle-array' instead of 'phandle', even if the property expects a single phandle.
---
Hi Mark,
The statement above is based on this LKML discussion I found:
https://lkml.org/lkml/2019/9/30/382
To be honest, I don't really get why the consumer should know whether the phandle will have cells or not. AFAIK, the consumer does not care about this ...
.../devicetree/bindings/sound/amlogic,gx-sound-card.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml +2 -2
@@ -57,7 +57,7 @@ patternProperties: rate sound-dai: - $ref: /schemas/types.yaml#/definitions/phandle + $ref: /schemas/types.yaml#/definitions/phandle-array description: phandle of the CPU DAI patternProperties:
@@ -71,7 +71,7 @@ patternProperties: properties: sound-dai: - $ref: /schemas/types.yaml#/definitions/phandle + $ref: /schemas/types.yaml#/definitions/phandle-array description: phandle of the codec DAI required:
Signature · 1 line
2.24.1
Re: [PATCH 1/9] ASoC: meson: gx-card: fix sound-dai dt schema
Quoted 17 lines · Jerome Brunet
There is a fair amount of warnings when running 'make
dtbs_check' with amlogic,gx-sound-card.yaml.Ex:
arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0:1: missing phandle tag in 0arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0:2: missing phandle tag in 0arch/arm64/boot/dts/amlogic/meson-gxm-q200.dt.yaml: sound: dai-link-0:sound-dai:0: [66, 0, 0] is too longThe reason is that the sound-dai phandle provided has cells, and in such case the schema should use 'phandle-array' instead of 'phandle', even if the property expects a single phandle.
Fixes fd00366b8e41 ("ASoC: meson: gx: add sound card dt-binding documentation")Signed-off-by Jerome Brunet <[email protected]>---
Hi Mark,
Quoted 6 lines
The statement above is based on this LKML discussion I found:
https://lkml.org/lkml/2019/9/30/382To be honest, I don't really get why the consumer should know whether the phandle will have cells or not. AFAIK, the consumer does not care about this ...
Yeah, I think another type definition is needed here to distinguish between a single phandle+args and an array of phandle+args.
In any case,
Quoted 3 lines
.../devicetree/bindings/sound/amlogic,gx-sound-card.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Jerome Brunet
maintainerPATCH 2/9 ASoC: meson: convert axg tdm interface to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic tdm interface to schema.
--- .../bindings/sound/amlogic,axg-tdm-iface.txt | 22 ------- .../bindings/sound/amlogic,axg-tdm-iface.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 22 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt deleted +0 -22
@@ -1,22 +0,0 @@ -* Amlogic Audio TDM Interfaces - -Required properties: -- compatible: 'amlogic,axg-tdm-iface' -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "sclk" : bit clock. - * "lrclk": sample clock - * "mclk" : master clock - -> optional if the interface is in clock slave mode. -- #sound-dai-cells: must be 0. - -Example of TDM_A on the A113 SoC: - -tdmif_a: audio-controller@0 { - compatible = "amlogic,axg-tdm-iface"; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>, - <&clkc_audio AUD_CLKID_MST_A_SCLK>, - <&clkc_audio AUD_CLKID_MST_A_LRCLK>; - clock-names = "mclk", "sclk", "lrclk"; -};
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +57 -0
57 lines not on this page · raw message
Signature · 1 line
2.24.1
Re: [PATCH 2/9] ASoC: meson: convert axg tdm interface to schema
Quoted 78 lines · Jerome Brunet
Convert the DT binding documentation for the Amlogic tdm interface to schema.
Signed-off-by Jerome Brunet <[email protected]>--- .../bindings/sound/amlogic,axg-tdm-iface.txt | 22 ------- .../bindings/sound/amlogic,axg-tdm-iface.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 22 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yamlDocumentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt deleted +0
-22@@ -1,22 +0,0 @@ -* Amlogic Audio TDM Interfaces - -Required properties: -- compatible: 'amlogic,axg-tdm-iface' -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "sclk" : bit clock. - * "lrclk": sample clock - * "mclk" : master clock - -> optional if the interface is in clock slave mode. -- #sound-dai-cells: must be 0. - -Example of TDM_A on the A113 SoC: - -tdmif_a: audio-controller@0 { - compatible = "amlogic,axg-tdm-iface"; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>, - <&clkc_audio AUD_CLKID_MST_A_SCLK>, - <&clkc_audio AUD_CLKID_MST_A_LRCLK>; - clock-names = "mclk", "sclk", "lrclk"; -};Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +33
-0@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Amlogic Audio TDM Interfaces + +maintainers: + - Jerome Brunet <[email protected]> + +properties: + $nodename: + pattern: "^audio-controller-.*" + + "#sound-dai-cells": + const: 0 + + compatible: + items: + - const: 'amlogic,axg-tdm-iface' + + clocks: + minItems: 2 + maxItems: 3 + items: + - description: Bit clock + - description: Sample clock + - description: Master clock #optional + + clock-names: + minItems: 2 + maxItems: 3
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +10
-0+ items: + - const: sclk + - const: lrclk + - const: mclk + +required: + - "#sound-dai-cells" + - compatible + - clocks + - clock-names
Add an:
additionalProperties: false
With that,
Jerome Brunet
maintainerRe: [PATCH 2/9] ASoC: meson: convert axg tdm interface to schema
Quoted 92 lines · Rob Herring
Quoted 78 lines · Jerome Brunet
Convert the DT binding documentation for the Amlogic tdm interface to schema.
Signed-off-by Jerome Brunet <[email protected]>--- .../bindings/sound/amlogic,axg-tdm-iface.txt | 22 ------- .../bindings/sound/amlogic,axg-tdm-iface.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 22 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yamlDocumentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt deleted +0
-22@@ -1,22 +0,0 @@ -* Amlogic Audio TDM Interfaces - -Required properties: -- compatible: 'amlogic,axg-tdm-iface' -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "sclk" : bit clock. - * "lrclk": sample clock - * "mclk" : master clock - -> optional if the interface is in clock slave mode. -- #sound-dai-cells: must be 0. - -Example of TDM_A on the A113 SoC: - -tdmif_a: audio-controller@0 { - compatible = "amlogic,axg-tdm-iface"; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>, - <&clkc_audio AUD_CLKID_MST_A_SCLK>, - <&clkc_audio AUD_CLKID_MST_A_LRCLK>; - clock-names = "mclk", "sclk", "lrclk"; -};Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +33
-0@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Amlogic Audio TDM Interfaces + +maintainers: + - Jerome Brunet <[email protected]> + +properties: + $nodename: + pattern: "^audio-controller-.*" + + "#sound-dai-cells": + const: 0 + + compatible: + items: + - const: 'amlogic,axg-tdm-iface' + + clocks: + minItems: 2 + maxItems: 3 + items: + - description: Bit clock + - description: Sample clock + - description: Master clock #optional + + clock-names: + minItems: 2 + maxItems: 3Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +10
-0+ items: + - const: sclk + - const: lrclk + - const: mclk + +required: + - "#sound-dai-cells" + - compatible + - clocks + - clock-namesAdd an:
Quoted 1 line
additionalProperties: false
I did not put that on purpose.
Most of the amlogic devices use an generic ASoC property called "sound-name-prefix"
You may see examples of that inarch/arm64/boot/dts/amlogic/meson-axg.dtsi.
That property is not expressed in json schema yet, and I don't really know what is the best way to add that.
Adding 'additionalProperties: false' right now would generate a fair amount of warning with 'make dtbs_check'
Quoted 4 lines
With that,
Reviewed-by Rob Herring <[email protected]>
Rob Herring
maintainerRe: [PATCH 2/9] ASoC: meson: convert axg tdm interface to schema
Quoted 102 lines · Jerome Brunet
Quoted 92 lines · Rob Herring
Quoted 78 lines · Jerome Brunet
Convert the DT binding documentation for the Amlogic tdm interface to schema.
Signed-off-by Jerome Brunet <[email protected]>--- .../bindings/sound/amlogic,axg-tdm-iface.txt | 22 ------- .../bindings/sound/amlogic,axg-tdm-iface.yaml | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 22 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yamlDocumentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt deleted +0
-22@@ -1,22 +0,0 @@ -* Amlogic Audio TDM Interfaces - -Required properties: -- compatible: 'amlogic,axg-tdm-iface' -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "sclk" : bit clock. - * "lrclk": sample clock - * "mclk" : master clock - -> optional if the interface is in clock slave mode. -- #sound-dai-cells: must be 0. - -Example of TDM_A on the A113 SoC: - -tdmif_a: audio-controller@0 { - compatible = "amlogic,axg-tdm-iface"; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>, - <&clkc_audio AUD_CLKID_MST_A_SCLK>, - <&clkc_audio AUD_CLKID_MST_A_LRCLK>; - clock-names = "mclk", "sclk", "lrclk"; -};Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +33
-0@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-iface.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Amlogic Audio TDM Interfaces + +maintainers: + - Jerome Brunet <[email protected]> + +properties: + $nodename: + pattern: "^audio-controller-.*" + + "#sound-dai-cells": + const: 0 + + compatible: + items: + - const: 'amlogic,axg-tdm-iface' + + clocks: + minItems: 2 + maxItems: 3 + items: + - description: Bit clock + - description: Sample clock + - description: Master clock #optional + + clock-names: + minItems: 2 + maxItems: 3Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 43
Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +10
-0+ items: + - const: sclk + - const: lrclk + - const: mclk + +required: + - "#sound-dai-cells" + - compatible + - clocks + - clock-namesAdd an:
Quoted 1 line
additionalProperties: false
I did not put that on purpose.
Most of the amlogic devices use an generic ASoC property called "sound-name-prefix"
Quoted 5 lines
You may see examples of that in
arch/arm64/boot/dts/amlogic/meson-axg.dtsi.That property is not expressed in json schema yet, and I don't really know what is the best way to add that.
Just assume it is (and I believe there's a patch I reviewed adding it). Regardless, you still need to define what the strings are.
Quoted 2 lines
Adding 'additionalProperties: false' right now would generate a fair amount of warning with 'make
dtbs_check'
That's a good way to have a todo...
Rob
Jerome Brunet
maintainerPATCH 3/9 ASoC: meson: convert axg tdm formatters to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic tdm formatters to schema.
--- .../sound/amlogic,axg-tdm-formatters.txt | 36 -------- .../sound/amlogic,axg-tdm-formatters.yaml | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 36 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt deleted +0 -36
@@ -1,36 +0,0 @@ -* Amlogic Audio TDM formatters - -Required properties: -- compatible: 'amlogic,axg-tdmin' or - 'amlogic,axg-tdmout' or - 'amlogic,g12a-tdmin' or - 'amlogic,g12a-tdmout' or - 'amlogic,sm1-tdmin' or - 'amlogic,sm1-tdmout -- reg: physical base address of the controller and length of memory - mapped region. -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "pclk" : peripheral clock. - * "sclk" : bit clock. - * "sclk_sel" : bit clock input multiplexer. - * "lrclk" : sample clock - * "lrclk_sel": sample clock input multiplexer - -Optional property: -- resets: phandle to the dedicated reset line of the tdm formatter. - -Example of TDMOUT_A on the S905X2 SoC: - -tdmout_a: audio-controller@500 { - compatible = "amlogic,axg-tdmout"; - reg = <0x0 0x500 0x0 0x40>; - resets = <&clkc_audio AUD_RESET_TDMOUT_A>; - clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>, - <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>, - <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>, - <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>, - <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>; - clock-names = "pclk", "sclk", "sclk_sel", - "lrclk", "lrclk_sel"; -};
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +92 -0
92 lines not on this page · raw message
Signature · 7 lines
2.24.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Rob Herring
maintainerRe: [PATCH 3/9] ASoC: meson: convert axg tdm formatters to schema
Quoted 59 lines · Jerome Brunet
Convert the DT binding documentation for the Amlogic tdm formatters to schema.
Signed-off-by Jerome Brunet <[email protected]>--- .../sound/amlogic,axg-tdm-formatters.txt | 36 -------- .../sound/amlogic,axg-tdm-formatters.yaml | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 36 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yamlDocumentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt deleted +0
-36@@ -1,36 +0,0 @@ -* Amlogic Audio TDM formatters - -Required properties: -- compatible: 'amlogic,axg-tdmin' or - 'amlogic,axg-tdmout' or - 'amlogic,g12a-tdmin' or - 'amlogic,g12a-tdmout' or - 'amlogic,sm1-tdmin' or - 'amlogic,sm1-tdmout -- reg: physical base address of the controller and length of memory - mapped region. -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "pclk" : peripheral clock. - * "sclk" : bit clock. - * "sclk_sel" : bit clock input multiplexer. - * "lrclk" : sample clock - * "lrclk_sel": sample clock input multiplexer - -Optional property: -- resets: phandle to the dedicated reset line of the tdm formatter. - -Example of TDMOUT_A on the S905X2 SoC: - -tdmout_a: audio-controller@500 { - compatible = "amlogic,axg-tdmout"; - reg = <0x0 0x500 0x0 0x40>; - resets = <&clkc_audio AUD_RESET_TDMOUT_A>; - clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>, - <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>, - <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>, - <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>, - <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>; - clock-names = "pclk", "sclk", "sclk_sel", - "lrclk", "lrclk_sel"; -};Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +0
-0
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 1
Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +1
-0@@ -0,0 +1,92 @@ +# SPDX-License-Identifier: GPL-2.0
Dual license please as you're the only author of the .txt file.
Quoted 70 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +70
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Amlogic Audio AXG TDM formatters + +maintainers: + - Jerome Brunet <[email protected]> + +properties: + $nodename: + pattern: "^audio-controller@.*" + + compatible: + oneOf: + - items: + - enum: + - amlogic,g12a-tdmout + - amlogic,sm1-tdmout + - amlogic,axg-tdmout + - items: + - enum: + - amlogic,g12a-tdmin + - amlogic,sm1-tdmin + - const: + amlogic,axg-tdmin + - items: + - const: + amlogic,axg-tdmin + + clocks: + items: + - description: Peripheral clock + - description: Bit clock + - description: Bit clock input multiplexer + - description: Sample clock + - description: Sample clock input multiplexer + + clock-names: + items: + - const: pclk + - const: sclk + - const: sclk_sel + - const: lrclk + - const: lrclk_sel + + reg: + maxItems: 1 + + resets: + maxItems: 1 + +required: + - compatible + - reg + - clocks + - clock-names + +if: + properties: + compatible: + contains: + enum: + - amlogic,g12a-tdmin + - amlogic,sm1-tdmin + - amlogic,g12a-tdmout + - amlogic,sm1-tdmout +then: + required:
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 81
Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +10
-0+ - resets + +examples: + - | + #include <dt-bindings/clock/axg-audio-clkc.h> + #include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h> + + tdmout_a: audio-controller@500 { + compatible = "amlogic,g12a-tdmout", + "amlogic,axg-tdmout";
This fails validation.
Quoted 14 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +11
-0+ reg = <0x0 0x500 0x0 0x40>; + resets = <&clkc_audio AUD_RESET_TDMOUT_A>; + clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>, + <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>, + <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>, + <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>, + <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>; + clock-names = "pclk", "sclk", "sclk_sel", + "lrclk", "lrclk_sel"; + }; +Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 4/9 ASoC: meson: convert axg pdm to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic axg PDM device to schema.
--- .../bindings/sound/amlogic,axg-pdm.txt | 29 ------- .../bindings/sound/amlogic,axg-pdm.yaml | 79 +++++++++++++++++++ 2 files changed, 79 insertions(+), 29 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt deleted +0 -29
@@ -1,29 +0,0 @@ -* Amlogic Audio PDM input - -Required properties: -- compatible: 'amlogic,axg-pdm' or - 'amlogic,g12a-pdm' or - 'amlogic,sm1-pdm' -- reg: physical base address of the controller and length of memory - mapped region. -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "pclk" : peripheral clock. - * "dclk" : pdm digital clock - * "sysclk" : dsp system clock -- #sound-dai-cells: must be 0. - -Optional property: -- resets: phandle to the dedicated reset line of the pdm input. - -Example of PDM on the A113 SoC: - -pdm: audio-controller@ff632000 { - compatible = "amlogic,axg-pdm"; - reg = <0x0 0xff632000 0x0 0x34>; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_PDM>, - <&clkc_audio AUD_CLKID_PDM_DCLK>, - <&clkc_audio AUD_CLKID_PDM_SYSCLK>; - clock-names = "pclk", "dclk", "sysclk"; -};
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +79 -0
79 lines not on this page · raw message
Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 5/9 ASoC: meson: convert axg fifo to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic axg audio FIFOs to schema.
--- .../bindings/sound/amlogic,axg-fifo.txt | 34 ------ .../bindings/sound/amlogic,axg-fifo.yaml | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 34 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt deleted +0 -34
@@ -1,34 +0,0 @@ -* Amlogic Audio FIFO controllers - -Required properties: -- compatible: 'amlogic,axg-toddr' or - 'amlogic,axg-toddr' or - 'amlogic,g12a-frddr' or - 'amlogic,g12a-toddr' or - 'amlogic,sm1-frddr' or - 'amlogic,sm1-toddr' -- reg: physical base address of the controller and length of memory - mapped region. -- interrupts: interrupt specifier for the fifo. -- clocks: phandle to the fifo peripheral clock provided by the audio - clock controller. -- resets: list of reset phandle, one for each entry reset-names. -- reset-names: should contain the following: - * "arb" : memory ARB line (required) - * "rst" : dedicated device reset line (optional) -- #sound-dai-cells: must be 0. -- amlogic,fifo-depth: The size of the controller's fifo in bytes. This - is useful for determining certain configuration such - as the flush threshold of the fifo - -Example of FRDDR A on the A113 SoC: - -frddr_a: audio-controller@1c0 { - compatible = "amlogic,axg-frddr"; - reg = <0x0 0x1c0 0x0 0x1c>; - #sound-dai-cells = <0>; - interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>; - clocks = <&clkc_audio AUD_CLKID_FRDDR_A>; - resets = <&arb AXG_ARB_FRDDR_A>; - fifo-depth = <512>; -};
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.24.1
Rob Herring
maintainerRe: [PATCH 5/9] ASoC: meson: convert axg fifo to schema
Quoted 111 lines · Jerome Brunet
Convert the DT binding documentation for the Amlogic axg audio FIFOs to schema.
Signed-off-by Jerome Brunet <[email protected]>--- .../bindings/sound/amlogic,axg-fifo.txt | 34 ------ .../bindings/sound/amlogic,axg-fifo.yaml | 111 ++++++++++++++++++ 2 files changed, 111 insertions(+), 34 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yamlDocumentation/devicetree/bindings/sound/amlogic,axg-fifo.txt deleted +0
-34@@ -1,34 +0,0 @@ -* Amlogic Audio FIFO controllers - -Required properties: -- compatible: 'amlogic,axg-toddr' or - 'amlogic,axg-toddr' or - 'amlogic,g12a-frddr' or - 'amlogic,g12a-toddr' or - 'amlogic,sm1-frddr' or - 'amlogic,sm1-toddr' -- reg: physical base address of the controller and length of memory - mapped region. -- interrupts: interrupt specifier for the fifo. -- clocks: phandle to the fifo peripheral clock provided by the audio - clock controller. -- resets: list of reset phandle, one for each entry reset-names. -- reset-names: should contain the following: - * "arb" : memory ARB line (required) - * "rst" : dedicated device reset line (optional) -- #sound-dai-cells: must be 0. -- amlogic,fifo-depth: The size of the controller's fifo in bytes. This - is useful for determining certain configuration such - as the flush threshold of the fifo - -Example of FRDDR A on the A113 SoC: - -frddr_a: audio-controller@1c0 { - compatible = "amlogic,axg-frddr"; - reg = <0x0 0x1c0 0x0 0x1c>; - #sound-dai-cells = <0>; - interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>; - clocks = <&clkc_audio AUD_CLKID_FRDDR_A>; - resets = <&arb AXG_ARB_FRDDR_A>; - fifo-depth = <512>; -};Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +54
-0@@ -0,0 +1,111 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/amlogic,axg-fifo.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Amlogic AXG Audio FIFO controllers + +maintainers: + - Jerome Brunet <[email protected]> + +properties: + $nodename: + pattern: "^audio-controller@.*" + + "#sound-dai-cells": + const: 0 + + compatible: + oneOf: + - items: + - const: + amlogic,axg-toddr + - items: + - const: + amlogic,axg-frddr + - items: + - enum: + - amlogic,g12a-toddr + - amlogic,sm1-toddr + - const: + amlogic,axg-toddr + - items: + - enum: + - amlogic,g12a-frddr + - amlogic,sm1-frddr + - const: + amlogic,axg-frddr + + clocks: + items: + - description: Peripheral clock + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + + resets: + minItems: 1 + items: + - description: Memory ARB line + - description: Dedicated device reset line
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 64
Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +10
-0+ + reset-names: + minItems: 1 + items: + - const: arb + - const: rst + + amlogic,fifo-depth: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Size of the controller's fifo in bytes
Aren't there some constraints on possible values? I'm sure it's more than 0 and less than 2^32.
Quoted 50 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +47
-0+ +required: + - "#sound-dai-cells" + - compatible + - interrupts + - reg + - clocks + - resets + - amlogic,fifo-depth + +if: + properties: + compatible: + contains: + enum: + - amlogic,g12a-toddr + - amlogic,sm1-toddr + - amlogic,g12a-frddr + - amlogic,sm1-frddr +then: + properties: + resets: + minItems: 2 + reset-names: + minItems: 2 + required: + - reset-names + +examples: + - | + #include <dt-bindings/clock/axg-audio-clkc.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h> + #include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h> + + frddr_a: audio-controller@1c0 { + compatible = "amlogic,g12a-frddr", "amlogic,axg-frddr"; + reg = <0x0 0x1c0 0x0 0x1c>; + #sound-dai-cells = <0>; + interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>; + clocks = <&clkc_audio AUD_CLKID_FRDDR_A>; + resets = <&arb AXG_ARB_FRDDR_A>, <&clkc_audio AUD_RESET_FRDDR_A>; + reset-names = "arb", "rst"; + amlogic,fifo-depth = <512>; + }; +Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 6/9 ASoC: meson: convert axg spdif input to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic axg spdif input to schema.
--- .../bindings/sound/amlogic,axg-spdifin.txt | 27 ------ .../bindings/sound/amlogic,axg-spdifin.yaml | 84 +++++++++++++++++++ 2 files changed, 84 insertions(+), 27 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt deleted +0 -27
@@ -1,27 +0,0 @@ -* Amlogic Audio SPDIF Input - -Required properties: -- compatible: 'amlogic,axg-spdifin' or - 'amlogic,g12a-spdifin' or - 'amlogic,sm1-spdifin' -- interrupts: interrupt specifier for the spdif input. -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "pclk" : peripheral clock. - * "refclk" : spdif input reference clock -- #sound-dai-cells: must be 0. - -Optional property: -- resets: phandle to the dedicated reset line of the spdif input. - -Example on the A113 SoC: - -spdifin: audio-controller@400 { - compatible = "amlogic,axg-spdifin"; - reg = <0x0 0x400 0x0 0x30>; - #sound-dai-cells = <0>; - interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>; - clocks = <&clkc_audio AUD_CLKID_SPDIFIN>, - <&clkc_audio AUD_CLKID_SPDIFIN_CLK>; - clock-names = "pclk", "refclk"; -};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +84 -0
84 lines not on this page · raw message
Signature · 7 lines
2.24.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Jerome Brunet
maintainerPATCH 7/9 ASoC: meson: convert axg spdif output to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic axg spdif output to schema.
--- .../bindings/sound/amlogic,axg-spdifout.txt | 25 ------ .../bindings/sound/amlogic,axg-spdifout.yaml | 77 +++++++++++++++++++ 2 files changed, 77 insertions(+), 25 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt deleted +0 -25
@@ -1,25 +0,0 @@ -* Amlogic Audio SPDIF Output - -Required properties: -- compatible: 'amlogic,axg-spdifout' or - 'amlogic,g12a-spdifout' or - 'amlogic,sm1-spdifout' -- clocks: list of clock phandle, one for each entry clock-names. -- clock-names: should contain the following: - * "pclk" : peripheral clock. - * "mclk" : master clock -- #sound-dai-cells: must be 0. - -Optional property: -- resets: phandle to the dedicated reset line of the spdif output. - -Example on the A113 SoC: - -spdifout: audio-controller@480 { - compatible = "amlogic,axg-spdifout"; - reg = <0x0 0x480 0x0 0x50>; - #sound-dai-cells = <0>; - clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>, - <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>; - clock-names = "pclk", "mclk"; -};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 8/9 ASoC: meson: convert g12a tohdmitx control to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic g12a tohdmitx codec glue to schema.
--- .../bindings/sound/amlogic,g12a-tohdmitx.txt | 58 ------------------- .../bindings/sound/amlogic,g12a-tohdmitx.yaml | 53 +++++++++++++++++ 2 files changed, 53 insertions(+), 58 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.yaml
Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt deleted +0 -58
@@ -1,58 +0,0 @@ -* Amlogic HDMI Tx control glue - -Required properties: -- compatible: "amlogic,g12a-tohdmitx" or - "amlogic,sm1-tohdmitx" -- reg: physical base address of the controller and length of memory - mapped region. -- #sound-dai-cells: should be 1. -- resets: phandle to the dedicated reset line of the hdmitx glue. - -Example on the S905X2 SoC: - -tohdmitx: audio-controller@744 { - compatible = "amlogic,g12a-tohdmitx"; - reg = <0x0 0x744 0x0 0x4>; - #sound-dai-cells = <1>; - resets = <&clkc_audio AUD_RESET_TOHDMITX>; -}; - -Example of an 'amlogic,axg-sound-card': - -sound { - compatible = "amlogic,axg-sound-card"; - -[...] - - dai-link-x { - sound-dai = <&tdmif_a>; - dai-format = "i2s"; - dai-tdm-slot-tx-mask-0 = <1 1>; - - codec-0 { - sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>; - }; - - codec-1 { - sound-dai = <&external_dac>; - }; - }; - - dai-link-y { - sound-dai = <&tdmif_c>; - dai-format = "i2s"; - dai-tdm-slot-tx-mask-0 = <1 1>; - - codec { - sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>; - }; - }; - - dai-link-z { - sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>; - - codec { - sound-dai = <&hdmi_tx>; - }; - }; -};
Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.yaml new file +53 -0
53 lines not on this page · raw message
Signature · 1 line
2.24.1
Jerome Brunet
maintainerPATCH 9/9 ASoC: meson: convert axg sound card control to schema
In reply to Jerome BrunetConvert the DT binding documentation for the Amlogic axg sound card to schema.
--- .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------ .../sound/amlogic,axg-sound-card.yaml | 181 ++++++++++++++++++ 2 files changed, 181 insertions(+), 124 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt deleted +0 -124
@@ -1,124 +0,0 @@ -Amlogic AXG sound card: - -Required properties: - -- compatible: "amlogic,axg-sound-card" -- model : User specified audio sound card name, one string - -Optional properties: - -- audio-aux-devs : List of phandles pointing to auxiliary devices -- audio-widgets : Please refer to widgets.txt. -- audio-routing : A list of the connections between audio components. - -Subnodes: - -- dai-link: Container for dai-link level properties and the CODEC - sub-nodes. There should be at least one (and probably more) - subnode of this type. - -Required dai-link properties: - -- sound-dai: phandle and port of the CPU DAI. - -Required TDM Backend dai-link properties: -- dai-format : CPU/CODEC common audio format - -Optional TDM Backend dai-link properties: -- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks -- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks - When omitted, mask is assumed to have to no - slots. A valid must have at one slot, so at - least one these mask should be provided with - an enabled slot. -- dai-tdm-slot-num : Please refer to tdm-slot.txt. - If omitted, slot number is set to accommodate the largest - mask provided. -- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted. -- mclk-fs : Multiplication factor between stream rate and mclk - -Backend dai-link subnodes: - -- codec: dai-link representing backend links should have at least one subnode. - One subnode for each codec of the dai-link. - dai-link representing frontend links have no codec, therefore have no - subnodes - -Required codec subnodes properties: - -- sound-dai: phandle and port of the CODEC DAI. - -Optional codec subnodes properties: - -- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt. -- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt. - -Example: - -sound { - compatible = "amlogic,axg-sound-card"; - model = "AXG-S420"; - audio-aux-devs = <&tdmin_a>, <&tdmout_c>; - audio-widgets = "Line", "Lineout", - "Line", "Linein", - "Speaker", "Speaker1 Left", - "Speaker", "Speaker1 Right"; - "Speaker", "Speaker2 Left", - "Speaker", "Speaker2 Right"; - audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2", - "SPDIFOUT IN 0", "FRDDR_A OUT 3", - "TDM_C Playback", "TDMOUT_C OUT", - "TDMIN_A IN 2", "TDM_C Capture", - "TDMIN_A IN 5", "TDM_C Loopback", - "TODDR_A IN 0", "TDMIN_A OUT", - "Lineout", "Lineout AOUTL", - "Lineout", "Lineout AOUTR", - "Speaker1 Left", "SPK1 OUT_A", - "Speaker2 Left", "SPK2 OUT_A", - "Speaker1 Right", "SPK1 OUT_B", - "Speaker2 Right", "SPK2 OUT_B", - "Linein AINL", "Linein", - "Linein AINR", "Linein"; - - dai-link@0 { - sound-dai = <&frddr_a>; - }; - - dai-link@1 { - sound-dai = <&toddr_a>; - }; - - dai-link@2 { - sound-dai = <&tdmif_c>; - dai-format = "i2s"; - dai-tdm-slot-tx-mask-2 = <1 1>; - dai-tdm-slot-tx-mask-3 = <1 1>; - dai-tdm-slot-rx-mask-1 = <1 1>; - mclk-fs = <256>; - - codec@0 { - sound-dai = <&lineout>; - }; - - codec@1 { - sound-dai = <&speaker_amp1>; - }; - - codec@2 { - sound-dai = <&speaker_amp2>; - }; - - codec@3 { - sound-dai = <&linein>; - }; - - }; - - dai-link@3 { - sound-dai = <&spdifout>; - - codec { - sound-dai = <&spdif_dit>; - }; - }; -};
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +181 -0
181 lines not on this page · raw message
Signature · 1 line
2.24.1