diff mbox series

[V2,3/4] ASoC: codecs: Add code for bin parsing compatible with aw88399

Message ID 20231020083426.302925-4-wangweidong.a@awinic.com (mailing list archive)
State Superseded
Headers show
Series ASoC: codecs: Add aw88399 amplifier driver | expand

Commit Message

wangweidong.a@awinic.com Oct. 20, 2023, 8:34 a.m. UTC
From: Weidong Wang <wangweidong.a@awinic.com>

Add aw88399 compatible code to the aw88395_lib.c file
so that it can parse aw88399's bin file.

Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
---
 sound/soc/codecs/aw88395/aw88395_lib.c | 3 +++
 sound/soc/codecs/aw88395/aw88395_reg.h | 1 +
 2 files changed, 4 insertions(+)

Comments

Mark Brown Oct. 23, 2023, 12:29 p.m. UTC | #1
On Fri, Oct 20, 2023 at 04:34:25PM +0800, wangweidong.a@awinic.com wrote:
> From: Weidong Wang <wangweidong.a@awinic.com>
> 
> Add aw88399 compatible code to the aw88395_lib.c file
> so that it can parse aw88399's bin file.

This doesn't apply against current code, please check and resend:

Applying: ASoC: codecs: Add code for bin parsing compatible with aw88399
Using index info to reconstruct a base tree...
M	sound/soc/codecs/aw88395/aw88395_lib.c
M	sound/soc/codecs/aw88395/aw88395_reg.h
Falling back to patching base and 3-way merge...
Auto-merging sound/soc/codecs/aw88395/aw88395_reg.h
Auto-merging sound/soc/codecs/aw88395/aw88395_lib.c
wangweidong.a@awinic.com Oct. 24, 2023, 7:14 a.m. UTC | #2
From: Weidong Wang <wangweidong.a@awinic.com>

Add the awinic,aw88399 property to the awinic,aw88395.yaml file.

Add i2c and amplifier registration for
aw88399 and their associated operation functions.

v1 -> v2: Modify the reset mode
          Delete AW88399_DSP_I2C_WRITES macros
           and related debugging statements
          Change the value of max_register in aw88399
          Change the value of max_register in aw88261
          Delete the judgment of unnecessary pointers
          Modify the judgment of the ret return value

Weidong Wang (4):
  ASoC: dt-bindings: Add schema for "awinic,aw88399"
  ASoC: codecs: Modify max_register usage error
  ASoC: codecs: Add code for bin parsing compatible with aw88399
  ASoC: codecs: Add aw88399 amplifier driver

 .../bindings/sound/awinic,aw88395.yaml        |    1 +
 sound/soc/codecs/Kconfig                      |   14 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/aw88261.c                    |    2 +-
 sound/soc/codecs/aw88395/aw88395_lib.c        |    3 +
 sound/soc/codecs/aw88395/aw88395_reg.h        |    1 +
 sound/soc/codecs/aw88399.c                    | 1911 +++++++++++++++++
 sound/soc/codecs/aw88399.h                    |  599 ++++++
 8 files changed, 2532 insertions(+), 1 deletion(-)
 create mode 100644 sound/soc/codecs/aw88399.c
 create mode 100644 sound/soc/codecs/aw88399.h


base-commit: ce55c22ec8b223a90ff3e084d842f73cfba35588
wangweidong.a@awinic.com Oct. 24, 2023, 7:19 a.m. UTC | #3
I'm very sorry, just sent the wrong patch, it was dut to my missteps.
Thank you very much for the review, but I have some questions 
I'd like to ask.

On Mon, Oct 23, 2023 at 13:29:03 +0100, broonie@kernel.org wrote:
> On Fri, Oct 20, 2023 at 04:34:25PM +0800, wangweidong.a@awinic.com wrote:
>> From: Weidong Wang <wangweidong.a@awinic.com>
>> 
>> Add aw88399 compatible code to the aw88395_lib.c file
>> so that it can parse aw88399's bin file.

> This doesn't apply against current code, please check and resend:

> Applying: ASoC: codecs: Add code for bin parsing compatible with aw88399
> Using index info to reconstruct a base tree...
> M	sound/soc/codecs/aw88395/aw88395_lib.c
> M	sound/soc/codecs/aw88395/aw88395_reg.h
> Falling back to patching base and 3-way merge...
> Auto-merging sound/soc/codecs/aw88395/aw88395_reg.h
> Auto-merging sound/soc/codecs/aw88395/aw88395_lib.c

I generated the patch based on the mainline branch, 
Why would there be a conflict? I know that I made a change to
this file when I committed aw87390 and that 
the change was in the Linux-next branch, but the two 
changes are in different parts of the file.

Best regards,
Weidong Wang
Mark Brown Oct. 24, 2023, 12:28 p.m. UTC | #4
On Tue, Oct 24, 2023 at 03:14:15PM +0800, wangweidong.a@awinic.com wrote:
> From: Weidong Wang <wangweidong.a@awinic.com>
> 
> Add the awinic,aw88399 property to the awinic,aw88395.yaml file.
> 
> Add i2c and amplifier registration for
> aw88399 and their associated operation functions.

This *still* doesn't apply against my current for-next (or for-6.7)
branch, and you've resent it as another v2.  Please send something based
against for-6.7 of my sound tree.
Mark Brown Oct. 24, 2023, 12:42 p.m. UTC | #5
On Tue, Oct 24, 2023 at 03:19:28PM +0800, wangweidong.a@awinic.com wrote:

> I generated the patch based on the mainline branch, 
> Why would there be a conflict? I know that I made a change to
> this file when I committed aw87390 and that 
> the change was in the Linux-next branch, but the two 
> changes are in different parts of the file.

I don't know off hand, I didn't check in detail.  It's possible someone
else sent a fix that's been applied and is causing the issue - if you
check out my branch and try to apply the patches hopefully you can
figure out what the problem was.
Mark Brown Oct. 24, 2023, 1:57 p.m. UTC | #6
On Tue, Oct 24, 2023 at 01:42:13PM +0100, Mark Brown wrote:
> On Tue, Oct 24, 2023 at 03:19:28PM +0800, wangweidong.a@awinic.com wrote:
> 
> > I generated the patch based on the mainline branch, 
> > Why would there be a conflict? I know that I made a change to
> > this file when I committed aw87390 and that 
> > the change was in the Linux-next branch, but the two 
> > changes are in different parts of the file.
> 
> I don't know off hand, I didn't check in detail.  It's possible someone
> else sent a fix that's been applied and is causing the issue - if you
> check out my branch and try to apply the patches hopefully you can
> figure out what the problem was.

diff --cc sound/soc/codecs/aw88395/aw88395_lib.c
index a0a429ca9768,bc72a7487048..000000000000
--- a/sound/soc/codecs/aw88395/aw88395_lib.c
+++ b/sound/soc/codecs/aw88395/aw88395_lib.c
@@@ -705,7 -703,8 +705,12 @@@ static int aw_dev_load_cfg_by_hdr(struc
  
  	switch (aw_dev->chip_id) {
  	case AW88395_CHIP_ID:
++<<<<<<< HEAD
 +		ret = aw88395_dev_cfg_get_valid_prof(aw_dev, all_prof_info);
++=======
+ 	case AW88399_CHIP_ID:
+ 		ret = aw88395_dev_cfg_get_valid_prof(aw_dev, *all_prof_info);
++>>>>>>> ASoC: codecs: Add code for bin parsing compatible with aw88399
  		if (ret < 0)
  			goto exit;
  		break;
wangweidong.a@awinic.com Oct. 25, 2023, 8:58 a.m. UTC | #7
Thank you very much for your help.

On Tue, Oct 24, 2023 at 14:57:03 +0100, Mark Brown wrote:
> On Tue, Oct 24, 2023 at 01:42:13PM +0100, Mark Brown wrote:
>> On Tue, Oct 24, 2023 at 03:19:28PM +0800, wangweidong.a@awinic.com wrote:
>> 
>> > I generated the patch based on the mainline branch, 
>> > Why would there be a conflict? I know that I made a change to
>> > this file when I committed aw87390 and that 
>> > the change was in the Linux-next branch, but the two 
>> > changes are in different parts of the file.
>> 
>> I don't know off hand, I didn't check in detail.  It's possible someone
>> else sent a fix that's been applied and is causing the issue - if you
>> check out my branch and try to apply the patches hopefully you can
>> figure out what the problem was.

> diff --cc sound/soc/codecs/aw88395/aw88395_lib.c
> index a0a429ca9768,bc72a7487048..000000000000
> --- a/sound/soc/codecs/aw88395/aw88395_lib.c
> +++ b/sound/soc/codecs/aw88395/aw88395_lib.c
> @@@ -705,7 -703,8 +705,12 @@@ static int aw_dev_load_cfg_by_hdr(struc
>  
>  	switch (aw_dev->chip_id) {
>  	case AW88395_CHIP_ID:
> ++<<<<<<< HEAD
> +		ret = aw88395_dev_cfg_get_valid_prof(aw_dev, all_prof_info);
> ++=======
> + 	case AW88399_CHIP_ID:
> + 		ret = aw88395_dev_cfg_get_valid_prof(aw_dev, *all_prof_info);
> ++>>>>>>> ASoC: codecs: Add code for bin parsing compatible with aw88399
>  		if (ret < 0)
>  			goto exit;
>  		break;

Again, thank you very much for your help. I'll resend the patch
based against for-6.7 of sound tree.

Best regards
Weidong Wang
diff mbox series

Patch

diff --git a/sound/soc/codecs/aw88395/aw88395_lib.c b/sound/soc/codecs/aw88395/aw88395_lib.c
index 87dd0ccade4c..bc72a7487048 100644
--- a/sound/soc/codecs/aw88395/aw88395_lib.c
+++ b/sound/soc/codecs/aw88395/aw88395_lib.c
@@ -703,6 +703,7 @@  static int aw_dev_load_cfg_by_hdr(struct aw_device *aw_dev,
 
 	switch (aw_dev->chip_id) {
 	case AW88395_CHIP_ID:
+	case AW88399_CHIP_ID:
 		ret = aw88395_dev_cfg_get_valid_prof(aw_dev, *all_prof_info);
 		if (ret < 0)
 			goto exit;
@@ -791,6 +792,7 @@  static int aw_get_dev_scene_count_v1(struct aw_device *aw_dev, struct aw_contain
 
 	switch (aw_dev->chip_id) {
 	case AW88395_CHIP_ID:
+	case AW88399_CHIP_ID:
 		for (i = 0; i < cfg_hdr->ddt_num; ++i) {
 			if ((cfg_dde[i].data_type == ACF_SEC_TYPE_MULTIPLE_BIN) &&
 			    (aw_dev->chip_id == cfg_dde[i].chip_id) &&
@@ -832,6 +834,7 @@  static int aw_get_default_scene_count_v1(struct aw_device *aw_dev,
 
 	switch (aw_dev->chip_id) {
 	case AW88395_CHIP_ID:
+	case AW88399_CHIP_ID:
 		for (i = 0; i < cfg_hdr->ddt_num; ++i) {
 			if ((cfg_dde[i].data_type == ACF_SEC_TYPE_MULTIPLE_BIN) &&
 			    (aw_dev->chip_id == cfg_dde[i].chip_id) &&
diff --git a/sound/soc/codecs/aw88395/aw88395_reg.h b/sound/soc/codecs/aw88395/aw88395_reg.h
index e7a7c02efaf3..63d2bac85715 100644
--- a/sound/soc/codecs/aw88395/aw88395_reg.h
+++ b/sound/soc/codecs/aw88395/aw88395_reg.h
@@ -95,6 +95,7 @@ 
 #define AW88395_TM_REG			(0x7C)
 
 enum aw88395_id {
+	AW88399_CHIP_ID = 0x2183,
 	AW88395_CHIP_ID = 0x2049,
 	AW88261_CHIP_ID = 0x2113,
 };