2022-12-30 10:29:40

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V8 0/5] ASoC: codecs: Add Awinic AW883XX audio amplifier driver

From: Weidong Wang <[email protected]>

The Awinic AW883XX is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert

Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
controlled using I2C

v7 -> v8: Delete retry for double loops Enable PA
Delete useless initialization and use reverse x-mas tree style
Add Spaces in comments
Modify aw883xx_switch_set function
Delete our own workqueue, use a default one
Change variable name
Modifying function name
Use dev_ replace pr_ function
Use define replace number
Modify the compatible of the awinic,aw883xx.yaml file

Weidong Wang (5):
ASoC: codecs: Add i2c and codec registration for aw883xx and their
associated operation functions
ASoC: codecs: Aw883xx function for ACF file parse and check
ASoC: codecs: Aw883xx common function for ALSA Audio Driver
ASoC: codecs: Aw883xx chip register file, data type file and Kconfig
Makefile
ASoC: dt-bindings: Add schema for "awinic,aw883xx"

.../bindings/sound/awinic,aw883xx.yaml | 49 +
sound/soc/codecs/Kconfig | 10 +
sound/soc/codecs/Makefile | 6 +
sound/soc/codecs/aw883xx/aw883xx.c | 667 ++++++
sound/soc/codecs/aw883xx/aw883xx.h | 59 +
sound/soc/codecs/aw883xx/aw883xx_bin_parse.c | 1067 ++++++++++
sound/soc/codecs/aw883xx/aw883xx_bin_parse.h | 92 +
sound/soc/codecs/aw883xx/aw883xx_data_type.h | 143 ++
sound/soc/codecs/aw883xx/aw883xx_device.c | 1790 +++++++++++++++++
sound/soc/codecs/aw883xx/aw883xx_device.h | 198 ++
.../soc/codecs/aw883xx/aw883xx_pid_2049_reg.h | 384 ++++
11 files changed, 4465 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
create mode 100644 sound/soc/codecs/aw883xx/aw883xx.c
create mode 100644 sound/soc/codecs/aw883xx/aw883xx.h
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_bin_parse.c
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_bin_parse.h
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_data_type.h
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_device.c
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_device.h
create mode 100644 sound/soc/codecs/aw883xx/aw883xx_pid_2049_reg.h


base-commit: bff687b3dad6e0e56b27f4d3ed8a9695f35c7b1a
--
2.38.1


2022-12-30 10:48:24

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"

From: Weidong Wang <[email protected]>

Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
controlled using I2C.

Signed-off-by: Weidong Wang <[email protected]>
---
.../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml

diff --git a/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
new file mode 100644
index 000000000000..b677427ebcd1
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/awinic,aw883xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic AW883xx Smart Audio Amplifier
+
+maintainers:
+ - Stephan Weidong Wang <[email protected]>
+
+description:
+ The Awinic AW883XX is an I2S/TDM input, high efficiency
+ digital Smart K audio amplifier with an integrated 10.25V
+ smart boost convert.
+
+allOf:
+ - $ref: dai-common.yaml#
+
+properties:
+ compatible:
+ const: awinic,aw883xx
+
+ reg:
+ maxItems: 1
+
+ reset-gpios:
+ maxItems: 1
+
+ sound-name-prefix: true
+
+required:
+ - compatible
+ - reg
+ - reset-gpios
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ audio-codec@34 {
+ compatible = "awinic,aw883xx";
+ reg = <0x34>;
+ reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ };
+ };
--
2.38.1

2022-12-30 11:01:39

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"

On 30/12/2022 10:34, [email protected] wrote:
> From: Weidong Wang <[email protected]>
>
> Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
> controlled using I2C.
>
> Signed-off-by: Weidong Wang <[email protected]>
> ---
> .../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>
> diff --git a/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
> new file mode 100644
> index 000000000000..b677427ebcd1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/awinic,aw883xx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Awinic AW883xx Smart Audio Amplifier
> +
> +maintainers:
> + - Stephan Weidong Wang <[email protected]>
> +
> +description:
> + The Awinic AW883XX is an I2S/TDM input, high efficiency
> + digital Smart K audio amplifier with an integrated 10.25V
> + smart boost convert.
> +
> +allOf:
> + - $ref: dai-common.yaml#
> +
> +properties:
> + compatible:
> + const: awinic,aw883xx

Now the question what does "xx" stand for? I cannot find such product on
awinic website:
https://www.awinic.com/En/Index/queryAll/wd/aw883xx.html

> +
> + reg:
> + maxItems: 1
> +
> + reset-gpios:
> + maxItems: 1
> +

Why there is no sound-dai-cells?


> + sound-name-prefix: true

Drop it.

> +
> +required:
> + - compatible
> + - reg
> + - reset-gpios
> +
> +additionalProperties: false

Instead:
unevaluatedProperties: false

unless this is not a codec and sound-dai-cells cannot be used?

> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + audio-codec@34 {
> + compatible = "awinic,aw883xx";
> + reg = <0x34>;
> + reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;

Does not look like you tested the bindings. Please run `make
dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).

Best regards,
Krzysztof

2022-12-30 12:31:05

by Stephan Gerhold

[permalink] [raw]
Subject: Re: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"

On Fri, Dec 30, 2022 at 05:34:54PM +0800, [email protected] wrote:
> From: Weidong Wang <[email protected]>
>
> Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
> controlled using I2C.
>
> Signed-off-by: Weidong Wang <[email protected]>
> ---
> .../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>
> diff --git a/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
> new file mode 100644
> index 000000000000..b677427ebcd1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
> @@ -0,0 +1,49 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/awinic,aw883xx.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Awinic AW883xx Smart Audio Amplifier
> +
> +maintainers:
> + - Stephan Weidong Wang <[email protected]>

Is my first name still meant to be here?
You should probably drop the "Stephan" :)

Thanks,
Stephan

2022-12-30 16:50:18

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"


On Fri, 30 Dec 2022 17:34:54 +0800, [email protected] wrote:
> From: Weidong Wang <[email protected]>
>
> Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
> controlled using I2C.
>
> Signed-off-by: Weidong Wang <[email protected]>
> ---
> .../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
> 1 file changed, 49 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>

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:
Error: Documentation/devicetree/bindings/sound/awinic,aw883xx.example.dts:24.41-42 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:434: Documentation/devicetree/bindings/sound/awinic,aw883xx.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1508: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.

2023-01-03 11:49:55

by wangweidong.a

[permalink] [raw]
Subject: Re: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"

Hi Krzysztof

On 30/12/2022 10:34, [email protected] wrote:
>> From: Weidong Wang <[email protected]>
>>
>> Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
>> controlled using I2C.
>>
>> Signed-off-by: Weidong Wang <[email protected]>
>> ---
>> .../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
>> 1 file changed, 49 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>> new file mode 100644
>> index 000000000000..b677427ebcd1
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>> @@ -0,0 +1,49 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/sound/awinic,aw883xx.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Awinic AW883xx Smart Audio Amplifier
>> +
>> +maintainers:
>> + - Stephan Weidong Wang <[email protected]>
>> +
>> +description:
>> + The Awinic AW883XX is an I2S/TDM input, high efficiency
>> + digital Smart K audio amplifier with an integrated 10.25V
>> + smart boost convert.
>> +
>> +allOf:
>> + - $ref: dai-common.yaml#
>> +
>> +properties:
>> + compatible:
>> + const: awinic,aw883xx

> Now the question what does "xx" stand for? I cannot find such product on
> awinic website:
> https://www.awinic.com/En/Index/queryAll/wd/aw883xx.html

xx represents our company's aw88394 and aw88395 chips,Aw88395 chips can be found on
https://www.awinic.com/cn/detail/index/catid/229/id/48/title/AW88395CSR.html
The aw88394 chip will be available on the website in the near future.

>> +
>> + reg:
>> + maxItems: 1
>> +
>> + reset-gpios:
>> + maxItems: 1
>> +

> Why there is no sound-dai-cells?

I'll add sound-dai-cells in patch v8

>> + sound-name-prefix: true

> Drop it.

I will modify it on patch v8

>> +
>> +required:
>> + - compatible
>> + - reg
>> + - reset-gpios
>> +
>> +additionalProperties: false

> Instead:
> unevaluatedProperties: false

> unless this is not a codec and sound-dai-cells cannot be used?

I will modify it on patch v8

>> +
>> +examples:
>> + - |
>> + i2c {
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + audio-codec@34 {
>> + compatible = "awinic,aw883xx";
>> + reg = <0x34>;
>> + reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;

> Does not look like you tested the bindings. Please run `make
> dt_binding_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).

I will modify it on patch v8

Best regards,
Weidong Wang

2023-01-03 12:22:11

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH V8 5/5] ASoC: dt-bindings: Add schema for "awinic,aw883xx"

On 03/01/2023 12:27, [email protected] wrote:
> Hi Krzysztof
>
> On 30/12/2022 10:34, [email protected] wrote:
>>> From: Weidong Wang <[email protected]>
>>>
>>> Add a DT schema for describing Awinic AW883xx audio amplifiers. They are
>>> controlled using I2C.
>>>
>>> Signed-off-by: Weidong Wang <[email protected]>
>>> ---
>>> .../bindings/sound/awinic,aw883xx.yaml | 49 +++++++++++++++++++
>>> 1 file changed, 49 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>>> new file mode 100644
>>> index 000000000000..b677427ebcd1
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/sound/awinic,aw883xx.yaml
>>> @@ -0,0 +1,49 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/sound/awinic,aw883xx.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: Awinic AW883xx Smart Audio Amplifier
>>> +
>>> +maintainers:
>>> + - Stephan Weidong Wang <[email protected]>
>>> +
>>> +description:
>>> + The Awinic AW883XX is an I2S/TDM input, high efficiency
>>> + digital Smart K audio amplifier with an integrated 10.25V
>>> + smart boost convert.
>>> +
>>> +allOf:
>>> + - $ref: dai-common.yaml#
>>> +
>>> +properties:
>>> + compatible:
>>> + const: awinic,aw883xx
>
>> Now the question what does "xx" stand for? I cannot find such product on
>> awinic website:
>> https://www.awinic.com/En/Index/queryAll/wd/aw883xx.html
>
> xx represents our company's aw88394 and aw88395 chips,Aw88395 chips can be found on
> https://www.awinic.com/cn/detail/index/catid/229/id/48/title/AW88395CSR.html
> The aw88394 chip will be available on the website in the near future.

OK, then it has to be changed. Wildcards are not allowed in compatibles,
so please use a specific compatible (oneOf for a case specific
compatible alone and for a case of two compatibles with fallback;
assuming the fallback is applicable to others).


Best regards,
Krzysztof