Skip to content

Commit 42fb516

Browse files
committed
ASoC: add support for some new Lenovo laptops with
Merge series from Bard Liao <yung-chuan.liao@linux.intel.com>: Some SKUs are using host DMICs rather than the cs42l43 DMICs, update the endpoint structure for these SKUs to remove the DMIC endpoint. Charles Keepax (4): ASoC: sdw_utils: Add support for exclusion DAI quirks ASoC: sdw_utils: Add a quirk to allow the cs42l43 mic DAI to be ignored ASoC: Intel: sof_sdw: Add quirk for cs42l43 system using host DMICs ASoC: Intel: sof_sdw: Add quirks for some new Lenovo laptops include/sound/soc_sdw_utils.h | 2 ++ sound/soc/intel/boards/sof_sdw.c | 41 +++++++++++++++++++++++++++++ sound/soc/sdw_utils/soc_sdw_utils.c | 5 +++- 3 files changed, 47 insertions(+), 1 deletion(-) -- 2.43.0
2 parents 1b9971a + 83c062a commit 42fb516

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

include/sound/soc_sdw_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* - SOC_SDW_CODEC_SPKR | SOF_SIDECAR_AMPS - Not currently supported
2929
*/
3030
#define SOC_SDW_SIDECAR_AMPS BIT(16)
31+
#define SOC_SDW_CODEC_MIC BIT(17)
3132

3233
#define SOC_SDW_UNUSED_DAI_ID -1
3334
#define SOC_SDW_JACK_OUT_DAI_ID 0
@@ -59,6 +60,7 @@ struct asoc_sdw_dai_info {
5960
int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
6061
bool rtd_init_done; /* Indicate that the rtd_init callback is done */
6162
unsigned long quirk;
63+
bool quirk_exclude;
6264
};
6365

6466
struct asoc_sdw_codec_info {

sound/soc/intel/boards/sof_sdw.c

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,47 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
580580
},
581581
.driver_data = (void *)(SOC_SDW_CODEC_SPKR),
582582
},
583+
{
584+
.callback = sof_sdw_quirk_cb,
585+
.matches = {
586+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
587+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3838")
588+
},
589+
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
590+
},
591+
{
592+
.callback = sof_sdw_quirk_cb,
593+
.matches = {
594+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
595+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3832")
596+
},
597+
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
598+
},
599+
{
600+
.callback = sof_sdw_quirk_cb,
601+
.matches = {
602+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
603+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "380E")
604+
},
605+
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
606+
},
607+
{
608+
.callback = sof_sdw_quirk_cb,
609+
.matches = {
610+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
611+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233C")
612+
},
613+
/* Note this quirk excludes the CODEC mic */
614+
.driver_data = (void *)(SOC_SDW_CODEC_MIC),
615+
},
616+
{
617+
.callback = sof_sdw_quirk_cb,
618+
.matches = {
619+
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
620+
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233B")
621+
},
622+
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
623+
},
583624

584625
/* ArrowLake devices */
585626
{

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ struct asoc_sdw_codec_info codec_info_list[] = {
528528
.rtd_init = asoc_sdw_cs42l43_dmic_rtd_init,
529529
.widgets = generic_dmic_widgets,
530530
.num_widgets = ARRAY_SIZE(generic_dmic_widgets),
531+
.quirk = SOC_SDW_CODEC_MIC,
532+
.quirk_exclude = true,
531533
},
532534
{
533535
.direction = {false, true},
@@ -1153,7 +1155,8 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
11531155
dai_info = &codec_info->dais[adr_end->num];
11541156
soc_dai = asoc_sdw_find_dailink(soc_dais, adr_end);
11551157

1156-
if (dai_info->quirk && !(dai_info->quirk & ctx->mc_quirk))
1158+
if (dai_info->quirk &&
1159+
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
11571160
continue;
11581161

11591162
dev_dbg(dev,

0 commit comments

Comments
 (0)