Skip to content

Commit

Permalink
ASoC: add support for some new Lenovo laptops with
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Mark Brown committed Oct 18, 2024
2 parents 1b9971a + 83c062a commit 42fb516
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/sound/soc_sdw_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* - SOC_SDW_CODEC_SPKR | SOF_SIDECAR_AMPS - Not currently supported
*/
#define SOC_SDW_SIDECAR_AMPS BIT(16)
#define SOC_SDW_CODEC_MIC BIT(17)

#define SOC_SDW_UNUSED_DAI_ID -1
#define SOC_SDW_JACK_OUT_DAI_ID 0
Expand Down Expand Up @@ -59,6 +60,7 @@ struct asoc_sdw_dai_info {
int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
bool rtd_init_done; /* Indicate that the rtd_init callback is done */
unsigned long quirk;
bool quirk_exclude;
};

struct asoc_sdw_codec_info {
Expand Down
41 changes: 41 additions & 0 deletions sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,47 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
},
.driver_data = (void *)(SOC_SDW_CODEC_SPKR),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3838")
},
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "3832")
},
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "380E")
},
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233C")
},
/* Note this quirk excludes the CODEC mic */
.driver_data = (void *)(SOC_SDW_CODEC_MIC),
},
{
.callback = sof_sdw_quirk_cb,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "233B")
},
.driver_data = (void *)(SOC_SDW_SIDECAR_AMPS),
},

/* ArrowLake devices */
{
Expand Down
5 changes: 4 additions & 1 deletion sound/soc/sdw_utils/soc_sdw_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ struct asoc_sdw_codec_info codec_info_list[] = {
.rtd_init = asoc_sdw_cs42l43_dmic_rtd_init,
.widgets = generic_dmic_widgets,
.num_widgets = ARRAY_SIZE(generic_dmic_widgets),
.quirk = SOC_SDW_CODEC_MIC,
.quirk_exclude = true,
},
{
.direction = {false, true},
Expand Down Expand Up @@ -1153,7 +1155,8 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
dai_info = &codec_info->dais[adr_end->num];
soc_dai = asoc_sdw_find_dailink(soc_dais, adr_end);

if (dai_info->quirk && !(dai_info->quirk & ctx->mc_quirk))
if (dai_info->quirk &&
!(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
continue;

dev_dbg(dev,
Expand Down

0 comments on commit 42fb516

Please sign in to comment.