diff mbox series

[v1,06/10] ASoC: dt-bindings: add wsa881x-i2c binding for analog mode

Message ID 20241101053154.497550-7-alexey.klimov@linaro.org
State New
Headers show
Series qrb4210-rb2: add wsa/wcd audio playback support | expand

Commit Message

Alexey Klimov Nov. 1, 2024, 5:31 a.m. UTC
Add binding document for WSA881X family of smart speaker amplifiers
that set to work in analog mode only and configurable via i2c only.
Such devices are found in Qualcomm QRB4210 RB2 boards with
SM4250/SM6115 SoCs.

Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
 .../bindings/sound/qcom,wsa881x-i2c.yaml      | 103 ++++++++++++++++++
 1 file changed, 103 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml

Comments

Alexey Klimov Dec. 11, 2024, 8:35 p.m. UTC | #1
On Fri Nov 1, 2024 at 7:57 AM GMT, Krzysztof Kozlowski wrote:
> On Fri, Nov 01, 2024 at 05:31:50AM +0000, Alexey Klimov wrote:
> > Add binding document for WSA881X family of smart speaker amplifiers
> > that set to work in analog mode only and configurable via i2c only.
> > Such devices are found in Qualcomm QRB4210 RB2 boards with
> > SM4250/SM6115 SoCs.
> > 
> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
> > ---
> >  .../bindings/sound/qcom,wsa881x-i2c.yaml      | 103 ++++++++++++++++++
> >  1 file changed, 103 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
> > new file mode 100644
> > index 000000000000..51b040b134d2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
>
> Filename must match compatible.
>
> > @@ -0,0 +1,103 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/qcom,wsa881x-i2c.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Qualcomm WSA8810/WSA8815 Class-D Smart Speaker Amplifier in Analog mode
> > +
> > +maintainers:
> > +  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > +  - Alexey Klimov <alexey.klimov@linaro.org>
> > +
> > +description: |
> > +  WSA8810 is a class-D smart speaker amplifier and WSA8815
> > +  is a high-output power class-D smart speaker amplifier.
> > +  Their primary operating mode uses a SoundWire digital audio
> > +  interface however the amplifier also supports analog mode and it
> > +  can be controlled via I2C. This binding is for I2C interface.
> > +
> > +allOf:
> > +  - $ref: dai-common.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    const: qcom,qrb4210-wsa881x-i2c-codec
>
> qrb4210 is a name of a board, not codec. i2c is redundant, codec as
> well. 'x' is not allowed.

qcom,qrb4210-wsa881x-i2c-codec came from qcom-soc.yaml with the advice
that it should be qcom,SoC-IP.

Anyway I am working on updating the qcom,wsa881x.yaml as you pointed out
in another email.

> This is qcom,wsa8810 and qcom,wsa8815 compatible with it.
>

[..]

> > +
> > +      wsa881x@e {
>
> Node names should be generic. See also an explanation and list of
> examples (not exhaustive) in DT specification:
> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation

The best I can come up with is "amplifier", or it should be at least "codec'.

Thanks for the review!
Best regards,
Alexey
Krzysztof Kozlowski Dec. 12, 2024, 7:23 a.m. UTC | #2
On 11/12/2024 21:35, Alexey Klimov wrote:
> On Fri Nov 1, 2024 at 7:57 AM GMT, Krzysztof Kozlowski wrote:
>> On Fri, Nov 01, 2024 at 05:31:50AM +0000, Alexey Klimov wrote:
>>> Add binding document for WSA881X family of smart speaker amplifiers
>>> that set to work in analog mode only and configurable via i2c only.
>>> Such devices are found in Qualcomm QRB4210 RB2 boards with
>>> SM4250/SM6115 SoCs.
>>>
>>> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
>>> ---
>>>  .../bindings/sound/qcom,wsa881x-i2c.yaml      | 103 ++++++++++++++++++
>>>  1 file changed, 103 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
>>> new file mode 100644
>>> index 000000000000..51b040b134d2
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
>>
>> Filename must match compatible.
>>
>>> @@ -0,0 +1,103 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/sound/qcom,wsa881x-i2c.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Qualcomm WSA8810/WSA8815 Class-D Smart Speaker Amplifier in Analog mode
>>> +
>>> +maintainers:
>>> +  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>> +  - Alexey Klimov <alexey.klimov@linaro.org>
>>> +
>>> +description: |
>>> +  WSA8810 is a class-D smart speaker amplifier and WSA8815
>>> +  is a high-output power class-D smart speaker amplifier.
>>> +  Their primary operating mode uses a SoundWire digital audio
>>> +  interface however the amplifier also supports analog mode and it
>>> +  can be controlled via I2C. This binding is for I2C interface.
>>> +
>>> +allOf:
>>> +  - $ref: dai-common.yaml#
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: qcom,qrb4210-wsa881x-i2c-codec
>>
>> qrb4210 is a name of a board, not codec. i2c is redundant, codec as
>> well. 'x' is not allowed.
> 
> qcom,qrb4210-wsa881x-i2c-codec came from qcom-soc.yaml with the advice
> that it should be qcom,SoC-IP.

I am sorry, but qcom,soc.yaml is about SoC. Is this a SoC? It is the
first time I see WSA integrated into the SoC.

> 
> Anyway I am working on updating the qcom,wsa881x.yaml as you pointed out
> in another email.
> 
>> This is qcom,wsa8810 and qcom,wsa8815 compatible with it.
>>
> 
> [..]
> 
>>> +
>>> +      wsa881x@e {
>>
>> Node names should be generic. See also an explanation and list of
>> examples (not exhaustive) in DT specification:
>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation
> 
> The best I can come up with is "amplifier", or it should be at least "codec'.

amplifier, speakers, you can check how this is called in 10 existing DTS
files or their bindings for WSA speakers.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
new file mode 100644
index 000000000000..51b040b134d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/qcom,wsa881x-i2c.yaml
@@ -0,0 +1,103 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/qcom,wsa881x-i2c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm WSA8810/WSA8815 Class-D Smart Speaker Amplifier in Analog mode
+
+maintainers:
+  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
+  - Alexey Klimov <alexey.klimov@linaro.org>
+
+description: |
+  WSA8810 is a class-D smart speaker amplifier and WSA8815
+  is a high-output power class-D smart speaker amplifier.
+  Their primary operating mode uses a SoundWire digital audio
+  interface however the amplifier also supports analog mode and it
+  can be controlled via I2C. This binding is for I2C interface.
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: qcom,qrb4210-wsa881x-i2c-codec
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: Master clock for WSA amplifier
+    maxItems: 1
+
+  clock-names:
+    description: Master clock name
+    maxItems: 1
+
+  powerdown-gpios:
+    description: GPIO spec for Powerdown/Shutdown line to use
+    maxItems: 1
+
+  mclk-gpios:
+    description: GPIO spec for mclk
+    maxItems: 1
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - clocks
+  - reg
+  - powerdown-gpios
+  - mclk-gpios
+  - "#sound-dai-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/sound/qcom,q6afe.h>
+
+    i2c0 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      wsa881x@e {
+        compatible = "qcom,qrb4210-wsa881x-i2c-codec";
+        reg = <0x0e>;
+        clocks = <&q6afecc LPASS_CLK_ID_MCLK_3 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+        powerdown-gpios = <&lpass_tlmm 16 GPIO_ACTIVE_LOW>;
+        mclk-gpios = <&lpass_tlmm 18 GPIO_ACTIVE_HIGH>;
+        #sound-dai-cells = <0>;
+      };
+    };
+
+    i2c1 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+        wsa881x-right@e {
+          compatible = "qcom,qrb4210-wsa881x-i2c-codec";
+          reg = <0x0e>;
+          clocks = <&q6afecc LPASS_CLK_ID_MCLK_3 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+          powerdown-gpios = <&lpass_tlmm 16 GPIO_ACTIVE_LOW>;
+          mclk-gpios = <&lpass_tlmm 18 GPIO_ACTIVE_HIGH>;
+          sound-name-prefix = "SpkrRight";
+          #sound-dai-cells = <0>;
+        };
+
+        wsa881x-left@f {
+            compatible = "qcom,qrb4210-wsa881x-i2c-codec";
+            reg = <0x0f>;
+            clocks = <&q6afecc LPASS_CLK_ID_MCLK_2 LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
+            powerdown-gpios = <&lpass_tlmm 6 GPIO_ACTIVE_LOW>;
+            mclk-gpios = <&lpass_tlmm 8 GPIO_ACTIVE_HIGH>;
+            sound-name-prefix = "SpkrLeft";
+            #sound-dai-cells = <0>;
+        };
+    };
+
+...