Skip to contentSkip to conversation

ASoC: cs35l56: Add support for CS35L62

PATCH In review Richard Fitzgerald 3 participants 5 messages Jul 15 – Jul 18

Subsystems (3)
lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

cover ASoC: cs35l56: Add support for CS35L62

The Cirrus Logic CS35L62 amp is similar to the CS35L63 and can be supported by adding the chip IDs into the cs35l56 driver. It must also be added to the codec table in sdw_utils.

Stefan Binding (2):
ASoC: cs35l56: Add support for CS35L62 for SoundWire
ASoC: sdw_utils: Add codec info for CS35L62

 sound/soc/codecs/cs35l56-sdw.c      |  2 ++
 sound/soc/codecs/cs35l56-shared.c   |  4 ++++
 sound/soc/codecs/cs35l56.c          |  1 +
 sound/soc/sdw_utils/soc_sdw_utils.c | 29 +++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+)
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH 1/2 ASoC: cs35l56: Add support for CS35L62 for SoundWire

From: Stefan Binding <[email protected]>

CS35L62 uses the same control and regmap interface as CS35L63 so support for it can be added into the CS35L56 driver.

---
 sound/soc/codecs/cs35l56-sdw.c    | 2 ++
 sound/soc/codecs/cs35l56-shared.c | 4 ++++
 sound/soc/codecs/cs35l56.c        | 1 +
 3 files changed, 7 insertions(+)
sound/soc/codecs/cs35l56-sdw.c +2 -0
index 0a55b93b96f96..1e442f43b306b 100644
@@ -457,6 +457,7 @@ static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi
 		regmap_config = &cs35l56_regmap_sdw;
 		break;
 	case 0x3563:
+	case 0x3562:
 		regmap_config = &cs35l63_regmap_sdw;
 		break;
 	default:
@@ -510,6 +511,7 @@ static const struct sdw_device_id cs35l56_sdw_id[] = {
 	SDW_SLAVE_ENTRY(0x01FA, 0x3556, 0x3556),
 	SDW_SLAVE_ENTRY(0x01FA, 0x3557, 0x3557),
 	SDW_SLAVE_ENTRY(0x01FA, 0x3563, 0x3563),
+	SDW_SLAVE_ENTRY(0x01FA, 0x3562, 0x3562),
 	{},
 };
 MODULE_DEVICE_TABLE(sdw, cs35l56_sdw_id);
sound/soc/codecs/cs35l56-shared.c +4 -0
index d5817e4208479..f20bcdfd35af0 100644
@@ -96,6 +96,7 @@ int cs35l56_set_patch(struct cs35l56_base *cs35l56_base)
 					    ARRAY_SIZE(cs35l56_patch_fw));
 		break;
 	case 0x63:
+	case 0x62:
 		ret = regmap_register_patch(cs35l56_base->regmap, cs35l63_patch_fw,
 					    ARRAY_SIZE(cs35l63_patch_fw));
 		break;
@@ -389,6 +390,7 @@ static void cs35l56_set_fw_reg_table(struct cs35l56_base *cs35l56_base)
 		}
 		break;
 	case 0x63:
+	case 0x62:
 		cs35l56_base->fw_reg = &cs35l63_fw_reg;
 		break;
 	}
@@ -595,6 +597,7 @@ void cs35l56_system_reset(struct cs35l56_base *cs35l56_base, bool is_soundwire)
 		}
 		break;
 	case 0x63:
+	case 0x62:
 		regmap_multi_reg_write_bypassed(cs35l56_base->regmap,
 						cs35l63_system_reset_seq,
 						ARRAY_SIZE(cs35l63_system_reset_seq));
@@ -1462,6 +1465,7 @@ int cs35l56_hw_init(struct cs35l56_base *cs35l56_base)
 		cs35l56_base->calibration_controls = &cs35l56_calibration_controls;
 		break;
 	case 0x35A630:
+	case 0x35A620:
 		cs35l56_base->calibration_controls = &cs35l63_calibration_controls;
 		devid = devid >> 4;
 		break;
sound/soc/codecs/cs35l56.c +1 -0
index 570a68829ccd0..f365f76ce56c1 100644
@@ -1402,6 +1402,7 @@ static int _cs35l56_component_probe(struct snd_soc_component *component)
 						     ARRAY_SIZE(cs35l56_controls));
 		break;
 	case 0x63:
+	case 0x62:
 		ret = snd_soc_add_component_controls(component, cs35l63_controls,
 						     ARRAY_SIZE(cs35l63_controls));
 		break;
Signature · 1 line
2.47.3
#2 lore raw

Re: [PATCH 1/2] ASoC: cs35l56: Add support for CS35L62 for SoundWire

sound/soc/codecs/cs35l56-sdw.c static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi · line 460

Quoted 10 lines
sound/soc/codecs/cs35l56-sdw.c +1 -0
index 0a55b93b96f96..1e442f43b306b 100644
@@ -457,6 +457,7 @@ static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_devi
 		regmap_config = &cs35l56_regmap_sdw;
 		break;
 	case 0x3563:
+	case 0x3562:

nit-pick: is there any reason why 62 is after 63 instead of a regular increasing order?

sound/soc/codecs/cs35l56-sdw.c static const struct sdw_device_id cs35l56_sdw_id[] = { · line 514

Quoted 8 lines
sound/soc/codecs/cs35l56-sdw.c +1 -0
 		regmap_config = &cs35l63_regmap_sdw;
 		break;
 	default:
@@ -510,6 +511,7 @@ static const struct sdw_device_id cs35l56_sdw_id[] = {
 	SDW_SLAVE_ENTRY(0x01FA, 0x3556, 0x3556),
 	SDW_SLAVE_ENTRY(0x01FA, 0x3557, 0x3557),
 	SDW_SLAVE_ENTRY(0x01FA, 0x3563, 0x3563),
+	SDW_SLAVE_ENTRY(0x01FA, 0x3562, 0x3562),

same here, the devices were in increasing order until this patch.

sound/soc/codecs/cs35l56-shared.c int cs35l56_set_patch(struct cs35l56_base *cs35l56_base) · line 99

Quoted 12 lines
sound/soc/codecs/cs35l56-sdw.c +0 -0
 	{},
 };
 MODULE_DEVICE_TABLE(sdw, cs35l56_sdw_id);
sound/soc/codecs/cs35l56-shared.c +1 -0
index d5817e4208479..f20bcdfd35af0 100644
@@ -96,6 +96,7 @@ int cs35l56_set_patch(struct cs35l56_base *cs35l56_base)
 					    ARRAY_SIZE(cs35l56_patch_fw));
 		break;
 	case 0x63:
+	case 0x62:

and here...

sound/soc/codecs/cs35l56-shared.c int cs35l56_hw_init(struct cs35l56_base *cs35l56_base) · line 1468

Quoted 2 lines
sound/soc/codecs/cs35l56-shared.c +1 -0
 	case 0x35A630:
+	case 0x35A620:

here as well

Maybe it's because the 62 support comes later, but no one will remember this timeline and the code looks odd to me.

author maintainer
#3 lore raw

PATCH 2/2 ASoC: sdw_utils: Add codec info for CS35L62

In reply to Richard Fitzgerald

From: Stefan Binding <[email protected]>

CS35L62 is very similar to CS35L63, and uses the same driver, so we can use the same configuration.

---
 sound/soc/sdw_utils/soc_sdw_utils.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
sound/soc/sdw_utils/soc_sdw_utils.c +29 -0
index dd2cc57059d6a..d4074309fa81c 100644
@@ -834,6 +834,35 @@ struct asoc_sdw_codec_info codec_info_list[] = {
 		},
 		.dai_num = 2,
 	},
+	{
+		.vendor_id = 0x01fa,
+		.part_id = 0x3562,
+		.name_prefix = "AMP",
+		.is_amp = true,
+		.dais = {
+			{
+				.direction = {true, false},
+				.dai_name = "cs35l56-sdw1",
+				.component_name = "cs35l56",
+				.dai_type = SOC_SDW_DAI_TYPE_AMP,
+				.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
+				.init = asoc_sdw_cs_amp_init,
+				.rtd_init = asoc_sdw_cs_spk_rtd_init,
+				.controls = generic_spk_controls,
+				.num_controls = ARRAY_SIZE(generic_spk_controls),
+				.widgets = generic_spk_widgets,
+				.num_widgets = ARRAY_SIZE(generic_spk_widgets),
+			},
+			{
+				.direction = {false, true},
+				.dai_name = "cs35l56-sdw1c",
+				.dai_type = SOC_SDW_DAI_TYPE_AMP,
+				.dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
+				.rtd_init = asoc_sdw_cs_spk_feedback_rtd_init,
+			},
+		},
+		.dai_num = 2,
+	},
 	{
 		.vendor_id = 0x01fa,
 		.part_id = 0x3563,
Signature · 1 line
2.47.3
maintainer
#4 lore raw
In reply to Richard Fitzgerald
Quoted 11 lines · Richard Fitzgerald

ASoC: cs35l56: Add support for CS35L62

The Cirrus Logic CS35L62 amp is similar to the CS35L63 and can be supported by adding the chip IDs into the cs35l56 driver. It must also be added to the codec table in sdw_utils.

Stefan Binding (2):
ASoC: cs35l56: Add support for CS35L62 for SoundWire
ASoC: sdw_utils: Add codec info for CS35L62

[...]

Applied to

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

Thanks!

[1/2] ASoC: cs35l56: Add support for CS35L62 for SoundWire

      https://git.kernel.org/broonie/sound/c/3330b5f6d8de
[2/2] ASoC: sdw_utils: Add codec info for CS35L62
      https://git.kernel.org/broonie/sound/c/0306d2115581

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