2023-09-18 12:06:53

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V3 0/5] 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.

v2 -> v3: Modify the type of "awinic,sync-flag" property to bool
Modify function return value
Modify commit information
Change the name of "sync-flag" to "awinic,sync-flag"

Weidong Wang (5):
ASoC: dt-bindings: awinic,aw88395: Add properties for multiple PA
support
ASoC: dt-bindings: Add schema for "awinic,aw87390"
ASoC: codecs: Add code for bin parsing compatible with aw87390
ASoC: codecs: Change the aw88261 variable name and i2c driver name
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, 686 insertions(+), 73 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: ce9ecca0238b140b88f43859b211c9fdfd8e5b70
--
2.41.0


2023-09-18 12:07:22

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V3 1/5] ASoC: dt-bindings: awinic,aw88395: Add properties for multiple PA support

From: Weidong Wang <[email protected]>

Add two properties, the "awinic,audio-channel" property and the
"awinic,sync-flag". The "awinic,audio-channel" is used to make
different PA load different configurations, the "awinic,sync-flag"
is used to synchronize the phases of multiple PA. These two properties
will be read by the corresponding driver, allowing multi-PA to
achieve better playback effect.

Signed-off-by: Weidong Wang <[email protected]>
---
.../bindings/sound/awinic,aw88395.yaml | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml b/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
index 4051c2538caf..b977d3de87cb 100644
--- a/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
+++ b/Documentation/devicetree/bindings/sound/awinic,aw88395.yaml
@@ -32,11 +32,25 @@ properties:
reset-gpios:
maxItems: 1

+ awinic,audio-channel:
+ description:
+ It is used to distinguish multiple PA devices, so that different
+ configurations can be loaded to different PA devices
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 7
+
+ awinic,sync-flag:
+ description:
+ Flag bit used to keep the phase synchronized in the case of multiple PA
+ $ref: /schemas/types.yaml#/definitions/flag
+
required:
- compatible
- reg
- '#sound-dai-cells'
- reset-gpios
+ - awinic,audio-channel

unevaluatedProperties: false

@@ -51,5 +65,7 @@ examples:
reg = <0x34>;
#sound-dai-cells = <0>;
reset-gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+ awinic,audio-channel = <0>;
+ awinic,sync-flag;
};
};
--
2.41.0

2023-09-18 12:07:45

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V3 2/5] ASoC: dt-bindings: Add schema for "awinic,aw87390"

From: Weidong Wang <[email protected]>

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

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

diff --git a/Documentation/devicetree/bindings/sound/awinic,aw87390.yaml b/Documentation/devicetree/bindings/sound/awinic,aw87390.yaml
new file mode 100644
index 000000000000..ba9d8767c5d5
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/awinic,aw87390.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/awinic,aw87390.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic Aw87390 Audio Amplifier
+
+maintainers:
+ - Weidong Wang <[email protected]>
+
+description:
+ The awinic aw87390 is specifically designed to improve
+ the musical output dynamic range, enhance the overall
+ sound quallity, which is a new high efficiency, low
+ noise, constant large volume, 6th Smart K audio amplifier.
+
+allOf:
+ - $ref: dai-common.yaml#
+
+properties:
+ compatible:
+ const: awinic,aw87390
+
+ reg:
+ maxItems: 1
+
+ "#sound-dai-cells":
+ const: 0
+
+ awinic,audio-channel:
+ description:
+ It is used to distinguish multiple PA devices, so that different
+ configurations can be loaded to different PA devices
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 0
+ maximum: 7
+
+required:
+ - compatible
+ - reg
+ - "#sound-dai-cells"
+ - awinic,audio-channel
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ audio-codec@58 {
+ compatible = "awinic,aw87390";
+ reg = <0x58>;
+ #sound-dai-cells = <0>;
+ awinic,audio-channel = <0>;
+ };
+ };
--
2.41.0

2023-09-18 12:08:54

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V3 4/5] ASoC: codecs: Change the aw88261 variable name and i2c driver name

From: Weidong Wang <[email protected]>

Change "sound-channel" to "awinic,audio-channel".
Change "aw88261_smartpa" to "aw88261".
Change "sync-flag" to "awinic,sync-flag".
These changes are made to align with yaml files.

Signed-off-by: Weidong Wang <[email protected]>
---
sound/soc/codecs/aw88261.c | 27 +++++++++++++--------------
sound/soc/codecs/aw88261.h | 4 ++--
2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index a697b5006b45..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;
@@ -1187,13 +1188,11 @@ static void aw88261_parse_channel_dt(struct aw88261 *aw88261)
struct aw_device *aw_dev = aw88261->aw_pa;
struct device_node *np = aw_dev->dev->of_node;
u32 channel_value = AW88261_DEV_DEFAULT_CH;
- u32 sync_enable = false;

- of_property_read_u32(np, "sound-channel", &channel_value);
- of_property_read_u32(np, "sync-flag", &sync_enable);
+ of_property_read_u32(np, "awinic,audio-channel", &channel_value);
+ aw88261->phase_sync = of_property_read_bool(np, "awinic,sync-flag");

aw_dev->channel = channel_value;
- aw88261->phase_sync = sync_enable;
}

static int aw88261_init(struct aw88261 **aw88261, struct i2c_client *i2c, struct regmap *regmap)
diff --git a/sound/soc/codecs/aw88261.h b/sound/soc/codecs/aw88261.h
index 4f3dbf438510..734d0f93ced9 100644
--- a/sound/soc/codecs/aw88261.h
+++ b/sound/soc/codecs/aw88261.h
@@ -370,7 +370,7 @@
#define AW88261_START_RETRIES (5)
#define AW88261_START_WORK_DELAY_MS (0)

-#define AW88261_I2C_NAME "aw88261_smartpa"
+#define AW88261_I2C_NAME "aw88261"

#define AW88261_RATES (SNDRV_PCM_RATE_8000_48000 | \
SNDRV_PCM_RATE_96000)
@@ -453,7 +453,7 @@ struct aw88261 {
unsigned int mute_st;
unsigned int amppd_st;

- unsigned char phase_sync;
+ bool phase_sync;
};

#endif
--
2.41.0

2023-09-18 12:09:01

by wangweidong.a

[permalink] [raw]
Subject: [PATCH V3 3/5] ASoC: codecs: Add code for bin parsing compatible with aw87390

From: Weidong Wang <[email protected]>

Add aw87390 compatible code to the aw88395_lib.c file
so that it can parse aw87390's bin file
Modify function return value
Remove the fade-enable property because other properties
already implement thi functionality.
Modify the transmission method of parameters.

Signed-off-by: Weidong Wang <[email protected]>
---
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 +
6 files changed, 35 insertions(+), 55 deletions(-)

diff --git a/sound/soc/codecs/aw88395/aw88395.c b/sound/soc/codecs/aw88395/aw88395.c
index 9dcd75dd799a..77227c8f01f6 100644
--- a/sound/soc/codecs/aw88395/aw88395.c
+++ b/sound/soc/codecs/aw88395/aw88395.c
@@ -175,9 +175,8 @@ static int aw88395_profile_info(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol);
struct aw88395 *aw88395 = 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;
@@ -196,8 +195,8 @@ static int aw88395_profile_info(struct snd_kcontrol *kcontrol,
name = uinfo->value.enumerated.name;
count = uinfo->value.enumerated.item;

- prof_name = aw88395_dev_get_prof_name(aw88395->aw_pa, count);
- if (!prof_name) {
+ ret = aw88395_dev_get_prof_name(aw88395->aw_pa, count, &prof_name);
+ if (ret) {
strscpy(uinfo->value.enumerated.name, "null",
strlen("null") + 1);
return 0;
diff --git a/sound/soc/codecs/aw88395/aw88395.h b/sound/soc/codecs/aw88395/aw88395.h
index 8036ba27f68d..c2a4f0cb8cd5 100644
--- a/sound/soc/codecs/aw88395/aw88395.h
+++ b/sound/soc/codecs/aw88395/aw88395.h
@@ -16,7 +16,7 @@

#define AW88395_DSP_16_DATA_MASK (0x0000ffff)

-#define AW88395_I2C_NAME "aw88395_smartpa"
+#define AW88395_I2C_NAME "aw88395"

#define AW88395_RATES (SNDRV_PCM_RATE_8000_48000 | \
SNDRV_PCM_RATE_96000)
diff --git a/sound/soc/codecs/aw88395/aw88395_device.c b/sound/soc/codecs/aw88395/aw88395_device.c
index 33eda3741464..fd1f67d5f22f 100644
--- a/sound/soc/codecs/aw88395/aw88395_device.c
+++ b/sound/soc/codecs/aw88395/aw88395_device.c
@@ -297,9 +297,6 @@ static void aw_dev_fade_in(struct aw_device *aw_dev)
int fade_step = aw_dev->fade_step;
int i;

- if (!aw_dev->fade_en)
- return;
-
if (fade_step == 0 || aw_dev->fade_in_time == 0) {
aw_dev_set_volume(aw_dev, fade_in_vol);
return;
@@ -320,9 +317,6 @@ static void aw_dev_fade_out(struct aw_device *aw_dev)
int fade_step = aw_dev->fade_step;
int i;

- if (!aw_dev->fade_en)
- return;
-
if (fade_step == 0 || aw_dev->fade_out_time == 0) {
aw_dev_set_volume(aw_dev, AW88395_MUTE_VOL);
return;
@@ -1062,10 +1056,6 @@ static int aw_dev_update_reg_container(struct aw_device *aw_dev,
aw_dev_set_volume(aw_dev, vol_desc->ctl_volume);
}

- /* keep min volume */
- if (aw_dev->fade_en)
- aw_dev_set_volume(aw_dev, AW88395_MUTE_VOL);
-
aw_dev_get_dsp_config(aw_dev, &aw_dev->dsp_cfg);

return ret;
@@ -1306,7 +1296,9 @@ int aw88395_dev_fw_update(struct aw_device *aw_dev, bool up_dsp_fw_en, bool forc
return -EPERM;
}

- prof_name = aw88395_dev_get_prof_name(aw_dev, aw_dev->prof_index);
+ ret = aw88395_dev_get_prof_name(aw_dev, aw_dev->prof_index, &prof_name);
+ if (ret)
+ return ret;

dev_dbg(aw_dev->dev, "start update %s", prof_name);

@@ -1594,37 +1586,19 @@ static void aw88395_parse_channel_dt(struct aw_device *aw_dev)
u32 channel_value;
int ret;

- ret = of_property_read_u32(np, "sound-channel", &channel_value);
+ ret = of_property_read_u32(np, "awinic,audio-channel", &channel_value);
if (ret) {
dev_dbg(aw_dev->dev,
- "read sound-channel failed,use default 0");
+ "read audio-channel failed,use default 0");
aw_dev->channel = AW88395_DEV_DEFAULT_CH;
return;
}

- dev_dbg(aw_dev->dev, "read sound-channel value is: %d",
+ dev_dbg(aw_dev->dev, "read audio-channel value is: %d",
channel_value);
aw_dev->channel = channel_value;
}

-static void aw88395_parse_fade_enable_dt(struct aw_device *aw_dev)
-{
- struct device_node *np = aw_dev->dev->of_node;
- u32 fade_en;
- int ret;
-
- ret = of_property_read_u32(np, "fade-enable", &fade_en);
- if (ret) {
- dev_dbg(aw_dev->dev,
- "read fade-enable failed, close fade_in_out");
- fade_en = AW88395_FADE_IN_OUT_DEFAULT;
- }
-
- dev_dbg(aw_dev->dev, "read fade-enable value is: %d", fade_en);
-
- aw_dev->fade_en = fade_en;
-}
-
static int aw_dev_init(struct aw_device *aw_dev)
{
aw_dev->chip_id = AW88395_CHIP_ID;
@@ -1639,7 +1613,6 @@ static int aw_dev_init(struct aw_device *aw_dev)
aw_dev->fade_step = AW88395_VOLUME_STEP_DB;
aw_dev->volume_desc.ctl_volume = AW88395_VOL_DEFAULT_VALUE;
aw88395_parse_channel_dt(aw_dev);
- aw88395_parse_fade_enable_dt(aw_dev);

return 0;
}
@@ -1673,7 +1646,7 @@ int aw88395_dev_set_profile_index(struct aw_device *aw_dev, int index)
}
EXPORT_SYMBOL_GPL(aw88395_dev_set_profile_index);

-char *aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index)
+int aw88395_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;
@@ -1681,12 +1654,14 @@ char *aw88395_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;
}
EXPORT_SYMBOL_GPL(aw88395_dev_get_prof_name);

diff --git a/sound/soc/codecs/aw88395/aw88395_device.h b/sound/soc/codecs/aw88395/aw88395_device.h
index caf730753167..791c8c106557 100644
--- a/sound/soc/codecs/aw88395/aw88395_device.h
+++ b/sound/soc/codecs/aw88395/aw88395_device.h
@@ -141,6 +141,7 @@ struct aw_device {
unsigned char prof_cur;
unsigned char prof_index;
unsigned char dsp_crc_st;
+ unsigned char dsp_cfg;
u16 chip_id;

unsigned int channel;
@@ -151,9 +152,6 @@ struct aw_device {
struct regmap *regmap;
char *acf;

- u32 fade_en;
- unsigned char dsp_cfg;
-
u32 dsp_fw_len;
u32 dsp_cfg_len;
u8 platform;
@@ -183,7 +181,7 @@ int aw88395_dev_fw_update(struct aw_device *aw_dev, bool up_dsp_fw_en, bool forc
void aw88395_dev_set_volume(struct aw_device *aw_dev, unsigned short set_vol);
int aw88395_dev_get_prof_data(struct aw_device *aw_dev, int index,
struct aw_prof_desc **prof_desc);
-char *aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index);
+int aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index, char **prof_name);
int aw88395_dev_set_profile_index(struct aw_device *aw_dev, int index);
int aw88395_dev_get_profile_index(struct aw_device *aw_dev);
int aw88395_dev_get_profile_count(struct aw_device *aw_dev);
diff --git a/sound/soc/codecs/aw88395/aw88395_lib.c b/sound/soc/codecs/aw88395/aw88395_lib.c
index 8ee1baa03269..a0a429ca9768 100644
--- a/sound/soc/codecs/aw88395/aw88395_lib.c
+++ b/sound/soc/codecs/aw88395/aw88395_lib.c
@@ -452,12 +452,16 @@ static int aw_dev_parse_reg_bin_with_hdr(struct aw_device *aw_dev,
if ((aw_bin->all_bin_parse_num != 1) ||
(aw_bin->header_info[0].bin_data_type != DATA_TYPE_REGISTER)) {
dev_err(aw_dev->dev, "bin num or type error");
+ ret = -EINVAL;
goto parse_bin_failed;
}

- if (aw_bin->header_info[0].valid_data_len % 4) {
- dev_err(aw_dev->dev, "bin data len get error!");
- goto parse_bin_failed;
+ if (aw_dev->chip_id == AW88261_CHIP_ID) {
+ if (aw_bin->header_info[0].valid_data_len % 4) {
+ dev_err(aw_dev->dev, "bin data len get error!");
+ ret = -EINVAL;
+ goto parse_bin_failed;
+ }
}

prof_desc->sec_desc[AW88395_DATA_TYPE_REG].data =
@@ -579,9 +583,9 @@ static int aw_dev_parse_dev_default_type(struct aw_device *aw_dev,
}

static int aw88261_dev_cfg_get_valid_prof(struct aw_device *aw_dev,
- struct aw_all_prof_info all_prof_info)
+ struct aw_all_prof_info *all_prof_info)
{
- struct aw_prof_desc *prof_desc = all_prof_info.prof_desc;
+ struct aw_prof_desc *prof_desc = all_prof_info->prof_desc;
struct aw_prof_info *prof_info = &aw_dev->prof_info;
int num = 0;
int i;
@@ -621,9 +625,9 @@ static int aw88261_dev_cfg_get_valid_prof(struct aw_device *aw_dev,
}

static int aw88395_dev_cfg_get_valid_prof(struct aw_device *aw_dev,
- struct aw_all_prof_info all_prof_info)
+ struct aw_all_prof_info *all_prof_info)
{
- struct aw_prof_desc *prof_desc = all_prof_info.prof_desc;
+ struct aw_prof_desc *prof_desc = all_prof_info->prof_desc;
struct aw_prof_info *prof_info = &aw_dev->prof_info;
struct aw_sec_data_desc *sec_desc;
int num = 0;
@@ -701,12 +705,13 @@ static int aw_dev_load_cfg_by_hdr(struct aw_device *aw_dev,

switch (aw_dev->chip_id) {
case AW88395_CHIP_ID:
- ret = aw88395_dev_cfg_get_valid_prof(aw_dev, *all_prof_info);
+ ret = aw88395_dev_cfg_get_valid_prof(aw_dev, all_prof_info);
if (ret < 0)
goto exit;
break;
case AW88261_CHIP_ID:
- ret = aw88261_dev_cfg_get_valid_prof(aw_dev, *all_prof_info);
+ case AW87390_CHIP_ID:
+ ret = aw88261_dev_cfg_get_valid_prof(aw_dev, all_prof_info);
if (ret < 0)
goto exit;
break;
@@ -799,6 +804,7 @@ static int aw_get_dev_scene_count_v1(struct aw_device *aw_dev, struct aw_contain
ret = 0;
break;
case AW88261_CHIP_ID:
+ case AW87390_CHIP_ID:
for (i = 0; i < cfg_hdr->ddt_num; ++i) {
if (((cfg_dde[i].data_type == ACF_SEC_TYPE_REG) ||
(cfg_dde[i].data_type == ACF_SEC_TYPE_HDR_REG)) &&
@@ -839,6 +845,7 @@ static int aw_get_default_scene_count_v1(struct aw_device *aw_dev,
ret = 0;
break;
case AW88261_CHIP_ID:
+ case AW87390_CHIP_ID:
for (i = 0; i < cfg_hdr->ddt_num; ++i) {
if (((cfg_dde[i].data_type == ACF_SEC_TYPE_REG) ||
(cfg_dde[i].data_type == ACF_SEC_TYPE_HDR_REG)) &&
diff --git a/sound/soc/codecs/aw88395/aw88395_reg.h b/sound/soc/codecs/aw88395/aw88395_reg.h
index e7a7c02efaf3..d0a273387313 100644
--- a/sound/soc/codecs/aw88395/aw88395_reg.h
+++ b/sound/soc/codecs/aw88395/aw88395_reg.h
@@ -97,6 +97,7 @@
enum aw88395_id {
AW88395_CHIP_ID = 0x2049,
AW88261_CHIP_ID = 0x2113,
+ AW87390_CHIP_ID = 0x76,
};

#define AW88395_REG_MAX (0x7D)
--
2.41.0

2023-09-18 15:49:12

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH V3 3/5] ASoC: codecs: Add code for bin parsing compatible with aw87390

On Mon, Sep 18, 2023 at 07:52:53PM +0800, [email protected] wrote:

> Add aw87390 compatible code to the aw88395_lib.c file
> so that it can parse aw87390's bin file
> Modify function return value
> Remove the fade-enable property because other properties
> already implement thi functionality.
> Modify the transmission method of parameters.

This would be easier to review if it were split up so that the
refactorings are separate commits, removing fade enable is a separate
commit and then finally just the changes to add the new CODEC are done.
That way each individual commit is both smaller and simpler.


Attachments:
(No filename) (630.00 B)
signature.asc (499.00 B)
Download all attachments