2023-09-27 13:15:00

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V5 0/8] ASoC: codecs: Add aw87390 amplifier driver

From: Weidong Wang <[email protected]>

The awinic aw87390 is a new high efficiency, low noise,
constant large volume, 6th Smart K audio amplifier.

Add a DT schema for describing awinic aw87390 audio amplifiers.
They are controlled using I2C.

v4 -> v5: Adjust the order and context of the patch

Weidong Wang (8):
ASoC: dt-bindings: awinic,aw88395: Add properties for multiple PA
support
ASoC: dt-bindings: Add schema for "awinic,aw87390"
ASoC: codecs: Modify the code related to the property
ASoC: codecs: Modify the transmission method of parameters
ASoC: codecs: Add code for bin parsing compatible with aw87390
ASoC: codecs: Modify the code related to the property
ASoC: codecs: Modify the transmission mode of function parameters
ASoC: codecs: Add aw87390 amplifier driver

.../bindings/sound/awinic,aw87390.yaml | 58 +++
.../bindings/sound/awinic,aw88395.yaml | 16 +
sound/soc/codecs/Kconfig | 15 +-
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/aw87390.c | 462 ++++++++++++++++++
sound/soc/codecs/aw87390.h | 85 ++++
sound/soc/codecs/aw88261.c | 27 +-
sound/soc/codecs/aw88261.h | 4 +-
sound/soc/codecs/aw88395/aw88395.c | 9 +-
sound/soc/codecs/aw88395/aw88395.h | 2 +-
sound/soc/codecs/aw88395/aw88395_device.c | 47 +-
sound/soc/codecs/aw88395/aw88395_device.h | 6 +-
sound/soc/codecs/aw88395/aw88395_lib.c | 25 +-
sound/soc/codecs/aw88395/aw88395_reg.h | 1 +
14 files changed, 685 insertions(+), 74 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/awinic,aw87390.yaml
create mode 100644 sound/soc/codecs/aw87390.c
create mode 100644 sound/soc/codecs/aw87390.h


base-commit: 0e945134b680040b8613e962f586d91b6d40292d
--
2.41.0


2023-09-27 13:15:08

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V5 7/8] ASoC: codecs: Modify the transmission mode of function parameters

From: Weidong Wang <[email protected]>

Change the transmission mode of the "aw88261_dev_get_prof_name"
function parameter

Signed-off-by: Weidong Wang <[email protected]>
---
sound/soc/codecs/aw88261.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index 61179e235fbf..45eaf931a69c 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -477,7 +477,7 @@ static int aw88261_dev_reg_update(struct aw88261 *aw88261,
return ret;
}

-static char *aw88261_dev_get_prof_name(struct aw_device *aw_dev, int index)
+static int aw88261_dev_get_prof_name(struct aw_device *aw_dev, int index, char **prof_name)
{
struct aw_prof_info *prof_info = &aw_dev->prof_info;
struct aw_prof_desc *prof_desc;
@@ -485,12 +485,14 @@ static char *aw88261_dev_get_prof_name(struct aw_device *aw_dev, int index)
if ((index >= aw_dev->prof_info.count) || (index < 0)) {
dev_err(aw_dev->dev, "index[%d] overflow count[%d]",
index, aw_dev->prof_info.count);
- return NULL;
+ return -EINVAL;
}

prof_desc = &aw_dev->prof_info.prof_desc[index];

- return prof_info->prof_name_list[prof_desc->id];
+ *prof_name = prof_info->prof_name_list[prof_desc->id];
+
+ return 0;
}

static int aw88261_dev_get_prof_data(struct aw_device *aw_dev, int index,
@@ -515,8 +517,8 @@ static int aw88261_dev_fw_update(struct aw88261 *aw88261)
char *prof_name;
int ret;

- prof_name = aw88261_dev_get_prof_name(aw_dev, aw_dev->prof_index);
- if (!prof_name) {
+ ret = aw88261_dev_get_prof_name(aw_dev, aw_dev->prof_index, &prof_name);
+ if (ret) {
dev_err(aw_dev->dev, "get prof name failed");
return -EINVAL;
}
@@ -818,9 +820,8 @@ static int aw88261_profile_info(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol);
struct aw88261 *aw88261 = snd_soc_component_get_drvdata(codec);
- const char *prof_name;
- char *name;
- int count;
+ char *prof_name, *name;
+ int count, ret;

uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
@@ -839,8 +840,8 @@ static int aw88261_profile_info(struct snd_kcontrol *kcontrol,
name = uinfo->value.enumerated.name;
count = uinfo->value.enumerated.item;

- prof_name = aw88261_dev_get_prof_name(aw88261->aw_pa, count);
- if (!prof_name) {
+ ret = aw88261_dev_get_prof_name(aw88261->aw_pa, count, &prof_name);
+ if (ret) {
strscpy(uinfo->value.enumerated.name, "null",
strlen("null") + 1);
return 0;
--
2.41.0

2023-09-28 15:27:00

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH V5 0/8] ASoC: codecs: Add aw87390 amplifier driver

On Wed, 27 Sep 2023 20:16:26 +0800, [email protected] wrote:
> The awinic aw87390 is a new high efficiency, low noise,
> constant large volume, 6th Smart K audio amplifier.
>
> Add a DT schema for describing awinic aw87390 audio amplifiers.
> They are controlled using I2C.
>
> v4 -> v5: Adjust the order and context of the patch
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/8] ASoC: dt-bindings: awinic,aw88395: Add properties for multiple PA support
commit: b99d8d8adfda1f9220dd2ee9bdb96ba02dc62bd7
[2/8] ASoC: dt-bindings: Add schema for "awinic,aw87390"
commit: 457b6587c112e162d3bec871c7b93359168d5c0a
[3/8] ASoC: codecs: Modify the code related to the property
(no commit info)
[4/8] ASoC: codecs: Modify the transmission method of parameters
commit: e83219c94abb4ad977f6b2b8be7d466ef0c2248f
[5/8] ASoC: codecs: Add code for bin parsing compatible with aw87390
commit: b116c832c9e84843c64eed087271e29b3bc6c1b8
[6/8] ASoC: codecs: Modify the code related to the property
(no commit info)
[7/8] ASoC: codecs: Modify the transmission mode of function parameters
commit: f83287a72551833a6fe2fc96f334b26e6eba77e8
[8/8] ASoC: codecs: Add aw87390 amplifier driver
commit: 37b4346ed8681660ae60de4facc3d499d8e5cf2a

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