ASoC: Intel: soc-acpi: mirror CML and TGL configurations

Some TGL devices use the same audio hardware as on CML platforms, with
RT711 on link0, RT1308 on link1 and optionally link2, and RT715 on
link 3.

To clarify configurations, the rt1308 configurations are split between
single amp on link1 and dual amps on link1. The case with two amps on
different links is already identified with the group1 attribute.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pierre-Louis Bossart 2020-08-21 14:55:51 -05:00 committed by Mark Brown
parent b161a12192
commit 6cb8bd60ba
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 100 additions and 6 deletions

View File

@ -118,7 +118,7 @@ static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
} }
}; };
static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = { static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
{ {
.adr = 0x000120025D130800, .adr = 0x000120025D130800,
.num_endpoints = 1, .num_endpoints = 1,
@ -182,8 +182,8 @@ static const struct snd_soc_acpi_link_adr cml_3_in_1_mono_amp[] = {
}, },
{ {
.mask = BIT(1), .mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr), .num_adr = ARRAY_SIZE(rt1308_1_single_adr),
.adr_d = rt1308_1_adr, .adr_d = rt1308_1_single_adr,
}, },
{ {
.mask = BIT(3), .mask = BIT(3),

View File

@ -43,7 +43,7 @@ static const struct snd_soc_acpi_adr_device rt711_0_adr[] = {
} }
}; };
static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = { static const struct snd_soc_acpi_adr_device rt1308_1_dual_adr[] = {
{ {
.adr = 0x000120025D130800, .adr = 0x000120025D130800,
.num_endpoints = 1, .num_endpoints = 1,
@ -56,6 +56,38 @@ static const struct snd_soc_acpi_adr_device rt1308_1_adr[] = {
} }
}; };
static const struct snd_soc_acpi_adr_device rt1308_1_single_adr[] = {
{
.adr = 0x000120025D130800,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};
static const struct snd_soc_acpi_adr_device rt1308_1_group1_adr[] = {
{
.adr = 0x000120025D130800,
.num_endpoints = 1,
.endpoints = &spk_l_endpoint,
}
};
static const struct snd_soc_acpi_adr_device rt1308_2_group1_adr[] = {
{
.adr = 0x000220025D130800,
.num_endpoints = 1,
.endpoints = &spk_r_endpoint,
}
};
static const struct snd_soc_acpi_adr_device rt715_3_adr[] = {
{
.adr = 0x000320025D071500,
.num_endpoints = 1,
.endpoints = &single_endpoint,
}
};
static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = { static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = {
{ {
.adr = 0x000123019F837300, .adr = 0x000123019F837300,
@ -94,8 +126,8 @@ static const struct snd_soc_acpi_link_adr tgl_rvp[] = {
}, },
{ {
.mask = BIT(1), .mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_adr), .num_adr = ARRAY_SIZE(rt1308_1_dual_adr),
.adr_d = rt1308_1_adr, .adr_d = rt1308_1_dual_adr,
}, },
{} {}
}; };
@ -114,6 +146,49 @@ static const struct snd_soc_acpi_link_adr tgl_chromebook_base[] = {
{} {}
}; };
static const struct snd_soc_acpi_link_adr tgl_3_in_1_default[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_group1_adr),
.adr_d = rt1308_1_group1_adr,
},
{
.mask = BIT(2),
.num_adr = ARRAY_SIZE(rt1308_2_group1_adr),
.adr_d = rt1308_2_group1_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr_d = rt715_3_adr,
},
{}
};
static const struct snd_soc_acpi_link_adr tgl_3_in_1_mono_amp[] = {
{
.mask = BIT(0),
.num_adr = ARRAY_SIZE(rt711_0_adr),
.adr_d = rt711_0_adr,
},
{
.mask = BIT(1),
.num_adr = ARRAY_SIZE(rt1308_1_single_adr),
.adr_d = rt1308_1_single_adr,
},
{
.mask = BIT(3),
.num_adr = ARRAY_SIZE(rt715_3_adr),
.adr_d = rt715_3_adr,
},
{}
};
static struct snd_soc_acpi_codecs tgl_max98373_amp = { static struct snd_soc_acpi_codecs tgl_max98373_amp = {
.num_codecs = 1, .num_codecs = 1,
.codecs = {"MX98373"} .codecs = {"MX98373"}
@ -150,6 +225,25 @@ EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_tgl_machines);
/* 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_tgl_sdw_machines[] = { struct snd_soc_acpi_mach snd_soc_acpi_intel_tgl_sdw_machines[] = {
{
.link_mask = 0xF, /* 4 active links required */
.links = tgl_3_in_1_default,
.drv_name = "sof_sdw",
.sof_fw_filename = "sof-tgl.ri",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-rt715.tplg",
},
{
/*
* link_mask should be 0xB, but all links are enabled by BIOS.
* This entry will be selected if there is no rt1308 exposed
* on link2 since it will fail to match the above entry.
*/
.link_mask = 0xF,
.links = tgl_3_in_1_mono_amp,
.drv_name = "sof_sdw",
.sof_fw_filename = "sof-tgl.ri",
.sof_tplg_filename = "sof-tgl-rt711-rt1308-mono-rt715.tplg",
},
{ {
.link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */ .link_mask = 0x3, /* rt711 on link 0 and 2 rt1308s on link 1 */
.links = tgl_rvp, .links = tgl_rvp,