Skip to contentSkip to conversation

ASoC: codecs: add new SoundWire-based SN624x

PATCH Pierre-Louis Bossart 1 participant 1 message Jul 23 1 message not in the archive Sound

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines · ming cong

The current kernel does not support the SN624x codec chip. Add the SN624x codec configuration item to kernel.

---
 MAINTAINERS                                   | 10 ++
 .../intel/common/soc-acpi-intel-arl-match.c   | 69 +++++++++++++
 .../intel/common/soc-acpi-intel-lnl-match.c   | 69 +++++++++++++
 .../intel/common/soc-acpi-intel-mtl-match.c   | 52 ++++++++++
 .../intel/common/soc-acpi-intel-ptl-match.c   | 96 +++++++++++++++++++

this isn't an ASoC: codecs patch but an Intel patch.

Quoted 9 lines
 5 files changed, 296 insertions(+)
MAINTAINERS +0 -0
index 54b7325f01e9..a157da5e4937 100644
@@ -29530,3 +29530,13 @@ F:	sound/soc/sdw_utils/soc_sdw_senary_sdca.c
 F:	sound/soc/sdw_utils/soc_sdw_senary_sdca_jack_common.c
 F:	sound/soc/sdw_utils/soc_sdw_utils.c

MAINTAINERS F: sound/soc/sdw_utils/soc_sdw_senary_sdca.c · line 29541

Quoted 10 lines
MAINTAINERS +9 -0
 F:	include/sound/soc_sdw_utils.h
+
+SENARYTECH AUDIO SN624X CODEC DRIVER
+M:	ming cong <[email protected]>
+S:	Maintained
+T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
+F:	sound\sound\soc\intel\common\soc-acpi-intel-arl-match.c
+F:	sound\sound\soc\intel\common\soc-acpi-intel-lnl-match.c
+F:	sound\sound\soc\intel\common\soc-acpi-intel-mtl-match.c
+F:	sound\sound\soc\intel\common\soc-acpi-intel-ptl-match.c

that also doesn't seem quite right, this is an Intel directory with things that aren't related to Senary support.

Quoted 377 lines
MAINTAINERS +1 -0
+
sound/soc/intel/common/soc-acpi-intel-arl-match.c +69 -0
index 59bfd5248819..07c95d0f2f31 100644
@@ -319,6 +319,63 @@ static const struct snd_soc_acpi_adr_device rt1320_3_group1_adr[] = {
 	}
 };
 
+static const struct snd_soc_acpi_endpoint sn624x_endpoints[] = {
+	{
+		.num = 0,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 1,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 2,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn6242_single_adr[] = {
+	{
+		.adr = 0x0000000496624201ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn6244_single_adr[] = {
+	{
+		.adr = 0x0000000496624401ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_link_adr link_sn6242[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(sn6242_single_adr),
+		.adr_d = sn6242_single_adr,
+	},
+	{}
+};
+
+static const struct snd_soc_acpi_link_adr link_sn6244[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(sn6244_single_adr),
+		.adr_d = sn6244_single_adr,
+	},
+	{}
+};
+
 static const struct snd_soc_acpi_link_adr arl_cs42l43_l0[] = {
 	{
 		.mask = BIT(0),
@@ -621,6 +678,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[] = {
 		.sof_tplg_filename = "sof-arl-es9356.tplg",
 		.get_function_tplg_files = sof_sdw_get_tplg_files,
 	},
+	{
+		.link_mask = BIT(0),
+		.links = link_sn6242,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-arl-sn624x.tplg",
+	},
+	{
+		.link_mask = BIT(0),
+		.links = link_sn6244,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-arl-sn624x.tplg",
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_arl_sdw_machines);
sound/soc/intel/common/soc-acpi-intel-lnl-match.c +69 -0
index 937a74a5d523..845d10575459 100644
@@ -215,6 +215,27 @@ static const struct snd_soc_acpi_endpoint cs42l43_amp_spkagg_endpoints[] = {
 	},
 };
 
+static const struct snd_soc_acpi_endpoint sn624x_endpoints[] = {
+	{
+		.num = 0,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 1,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 2,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+};
+
 static const struct snd_soc_acpi_adr_device cs35l56_2_l_adr[] = {
 	{
 		.adr = 0x00023001FA355601ull,
@@ -482,6 +503,24 @@ static const struct snd_soc_acpi_adr_device rt714_1_adr[] = {
 	}
 };
 
+static const struct snd_soc_acpi_adr_device sn6242_single_adr[] = {
+	{
+		.adr = 0x0000000496624201ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn6244_single_adr[] = {
+	{
+		.adr = 0x0000000496624401ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
 static const struct snd_soc_acpi_link_adr lnl_cs42l43_l0[] = {
 	{
 		.mask = BIT(0),
@@ -684,6 +723,24 @@ static const struct snd_soc_acpi_link_adr lnl_sdw_rt712_vb_l2_rt1320_l1[] = {
 	{}
 };
 
+static const struct snd_soc_acpi_link_adr link_sn6242[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(sn6242_single_adr),
+		.adr_d = sn6242_single_adr,
+	},
+	{}
+};
+
+static const struct snd_soc_acpi_link_adr link_sn6244[] = {
+	{
+		.mask = BIT(0),
+		.num_adr = ARRAY_SIZE(sn6244_single_adr),
+		.adr_d = sn6244_single_adr,
+	},
+	{}
+};
+
 /* this table is used when there is no I2S codec present */
 /* this table is used when there is no I2S codec present */
 struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = {
@@ -796,6 +853,18 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[] = {
 		.sof_tplg_filename = "sof-lnl-rt713-l2-rt1320-l13.tplg",
 		.get_function_tplg_files = sof_sdw_get_tplg_files,
 	},
+	{
+		.link_mask = BIT(0),
+		.links = link_sn6242,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-lnl-sn624x.tplg",
+	},
+	{
+		.link_mask = BIT(0),
+		.links = link_sn6244,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-lnl-sn624x.tplg",
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_lnl_sdw_machines);
sound/soc/intel/common/soc-acpi-intel-mtl-match.c +52 -0
index 2e4222456f27..542e56c65715 100644
@@ -233,6 +233,51 @@ static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
 	.group_id = 1,
 };
 
+static const struct snd_soc_acpi_endpoint sn624x_endpoints[] = {
+	{
+		.num = 0,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 1,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 2,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn624x_single_adr[] = {
+	{
+		.adr = 0x0000000496624401ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+	{
+		.adr = 0x0000000496624201ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_link_adr link_sn624x[] = {
+	{
+		.mask = GENMASK(3, 0),
+		.num_adr = ARRAY_SIZE(sn624x_single_adr),
+		.adr_d = sn624x_single_adr,
+	},
+	{}
+};
+
 static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
 	{
 		.adr = 0x000030025D071101ull,
@@ -1487,6 +1532,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[] = {
 		.drv_name = "sof_sdw",
 		.sof_tplg_filename = "sof-mtl-sdw-cs42l42-l0-max98363-l2.tplg",
 	},
+	{
+		.link_mask = GENMASK(3, 0),
+		.links = link_sn624x,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-mtl-sn624x.tplg",
+		.get_function_tplg_files = sof_sdw_get_tplg_files,
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_mtl_sdw_machines);
sound/soc/intel/common/soc-acpi-intel-ptl-match.c +89 -0
index f7694b2a2b02..2bac02de3d55 100644
@@ -160,6 +160,27 @@ static const struct snd_soc_acpi_endpoint cs42l43_amp_spkagg_endpoints[] = {
 	},
 };
 
+static const struct snd_soc_acpi_endpoint sn624x_endpoints[] = {
+	{
+		.num = 0,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 1,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+	{
+		.num = 2,
+		.aggregated = 0,
+		.group_position = 0,
+		.group_id = 0,
+	},
+};
+
 static const struct snd_soc_acpi_adr_device cs42l43_3_agg_adr[] = {
 	{
 		.adr = 0x00033001FA424301ull,
@@ -301,6 +322,33 @@ static const struct snd_soc_acpi_adr_device rt1320_3_group2_adr[] = {
 	}
 };
 
+static const struct snd_soc_acpi_adr_device sn6242_single_adr[] = {
+	{
+		.adr = 0x0000000496624201ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn6244_single_adr[] = {
+	{
+		.adr = 0x0003000496624401ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
+static const struct snd_soc_acpi_adr_device sn6247_single_adr[] = {
+	{
+		.adr = 0x0003000496624701ull,
+		.num_endpoints = ARRAY_SIZE(sn624x_endpoints),
+		.endpoints = sn624x_endpoints,
+		.name_prefix = "sn6242",
+	},
+};
+
 static const struct snd_soc_acpi_link_adr ptl_cs42l43_agg_l3_cs35l56_l2[] = {
 	{
 		.mask = BIT(3),
@@ -437,6 +485,33 @@ static const struct snd_soc_acpi_link_adr ptl_sdw_rt712_vb_l3_rt1320_l3[] = {
 	{}
 };
 
+static const struct snd_soc_acpi_link_adr link_sn6242[] = {
+	{
+		.mask = BIT(3),
+		.num_adr = ARRAY_SIZE(sn6242_single_adr),
+		.adr_d = sn6242_single_adr,
+	},
+	{}
+};
+
+static const struct snd_soc_acpi_link_adr link_sn6244[] = {
+	{
+		.mask = BIT(3),
+		.num_adr = ARRAY_SIZE(sn6244_single_adr),
+		.adr_d = sn6244_single_adr,
+	},
+	{}
+};
+
+static const struct snd_soc_acpi_link_adr link_sn6247[] = {
+	{
+		.mask = BIT(3),
+		.num_adr = ARRAY_SIZE(sn6247_single_adr),
+		.adr_d = sn6247_single_adr,
+	},
+	{}
+};
+
 /* this table is used when there is no I2S codec present */
 struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
 /* Order Priority: mockup > most links > most bit link-mask > alphabetical */
@@ -531,6 +606,27 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = {
 		.sof_tplg_filename = "sof-ptl-rt712-l3-rt1320-l3.tplg",
 		.get_function_tplg_files = sof_sdw_get_tplg_files,
 	},
+	{
+		.link_mask = BIT(3),
+		.links = link_sn6242,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-ptl-sn624x.tplg",
+		.get_function_tplg_files = sof_sdw_get_tplg_files,
+	},
+	{
+		.link_mask = BIT(3),
+		.links = link_sn6244,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-ptl-sn624x.tplg",
+		.get_function_tplg_files = sof_sdw_get_tplg_files,
+	},

sound/soc/intel/common/soc-acpi-intel-ptl-match.c struct snd_soc_acpi_mach snd_soc_acpi_intel_ptl_sdw_machines[] = { · line 632

Quoted 10 lines
sound/soc/intel/common/soc-acpi-intel-ptl-match.c +7 -0
+	{
+		.link_mask = BIT(3),
+		.links = link_sn6247,
+		.drv_name = "sof_sdw",
+		.sof_tplg_filename = "sof-ptl-sn624x.tplg",
+		.get_function_tplg_files = sof_sdw_get_tplg_files,
+	},
 	{},
 };
 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_ptl_sdw_machines);

It's a bit weird to see sometimes 3 descriptors, sometimes 2 and sometimes 1. The only difference seems to be the partID, so wondering if there's a better way to add more than one part ID to a descriptor.