Skip to content

Commit

Permalink
Merge tag 'asoc-fix-v6.13-merge-window' of https://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v6.13

A pile of driver specific quirks and fixes that came in since the merge
window.  One of the AMD fixes is a bit broken for some systems, I'm
expecting an incremental change to fix that but it seems better overall
to merge the rest of the fixes.

There's also one small documentation update that seemed sensible to
apply now, pointing to the dapm-graph tool.
  • Loading branch information
Takashi Iwai committed Nov 28, 2024
2 parents a7df7f9 + b682aa7 commit 2e5bf5b
Showing 9 changed files with 86 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Documentation/sound/soc/dapm.rst
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@ The graph for the STM32MP1-DK1 sound card is shown in picture:
:alt: Example DAPM graph
:align: center

You can also generate compatible graph for your sound card using
`tools/sound/dapm-graph` utility.

DAPM power domains
==================

1 change: 1 addition & 0 deletions sound/soc/amd/Kconfig
Original file line number Diff line number Diff line change
@@ -163,6 +163,7 @@ config SND_SOC_AMD_SOUNDWIRE
config SND_SOC_AMD_PS
tristate "AMD Audio Coprocessor-v6.3 Pink Sardine support"
select SND_SOC_AMD_SOUNDWIRE_LINK_BASELINE
select SND_SOC_ACPI_AMD_MATCH
depends on X86 && PCI && ACPI
help
This option enables Audio Coprocessor i.e ACP v6.3 support on
39 changes: 38 additions & 1 deletion sound/soc/amd/yc/acp6x-mach.c
Original file line number Diff line number Diff line change
@@ -220,6 +220,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "21M1"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
@@ -241,6 +248,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "21M5"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "21ME"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
@@ -409,6 +423,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Xiaomi Book Pro 14 2022"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "TIMI"),
DMI_MATCH(DMI_PRODUCT_NAME, "Redmi G 2022"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
@@ -537,18 +558,34 @@ static int acp6x_probe(struct platform_device *pdev)
struct acp6x_pdm *machine = NULL;
struct snd_soc_card *card;
struct acpi_device *adev;
acpi_handle handle;
acpi_integer dmic_status;
int ret;
bool is_dmic_enable, wov_en;

/* IF WOV entry not found, enable dmic based on AcpDmicConnected entry*/
is_dmic_enable = false;
wov_en = true;
/* check the parent device's firmware node has _DSD or not */
adev = ACPI_COMPANION(pdev->dev.parent);
if (adev) {
const union acpi_object *obj;

if (!acpi_dev_get_property(adev, "AcpDmicConnected", ACPI_TYPE_INTEGER, &obj) &&
obj->integer.value == 1)
platform_set_drvdata(pdev, &acp6x_card);
is_dmic_enable = true;
}

handle = ACPI_HANDLE(pdev->dev.parent);
ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);
if (!ACPI_FAILURE(ret))
wov_en = dmic_status;

if (is_dmic_enable && wov_en)
platform_set_drvdata(pdev, &acp6x_card);
else
return 0;

/* check for any DMI overrides */
dmi_id = dmi_first_match(yc_acp_quirk_table);
if (dmi_id)
2 changes: 1 addition & 1 deletion sound/soc/apple/mca.c
Original file line number Diff line number Diff line change
@@ -616,7 +616,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream,
tdm_slot_width = 32;

if (tdm_slot_width < params_width(params)) {
dev_err(dev, "TDM slots too narrow (tdm=%d params=%d)\n",
dev_err(dev, "TDM slots too narrow (tdm=%u params=%d)\n",
tdm_slot_width, params_width(params));
return -EINVAL;
}
3 changes: 3 additions & 0 deletions sound/soc/fsl/imx-audmix.c
Original file line number Diff line number Diff line change
@@ -274,6 +274,9 @@ static int imx_audmix_probe(struct platform_device *pdev)
/* Add AUDMIX Backend */
be_name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
"audmix-%d", i);
if (!be_name)
return -ENOMEM;

priv->dai[num_dai + i].cpus = &dlc[1];
priv->dai[num_dai + i].codecs = &snd_soc_dummy_dlc;

9 changes: 7 additions & 2 deletions sound/soc/mediatek/mt8188/mt8188-mt6359.c
Original file line number Diff line number Diff line change
@@ -1277,10 +1277,12 @@ static int mt8188_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,

for_each_card_prelinks(card, i, dai_link) {
if (strcmp(dai_link->name, "DPTX_BE") == 0) {
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
if (dai_link->num_codecs &&
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
dai_link->init = mt8188_dptx_codec_init;
} else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
if (dai_link->num_codecs &&
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
dai_link->init = mt8188_hdmi_codec_init;
} else if (strcmp(dai_link->name, "DL_SRC_BE") == 0 ||
strcmp(dai_link->name, "UL_SRC_BE") == 0) {
@@ -1292,6 +1294,9 @@ static int mt8188_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
strcmp(dai_link->name, "ETDM2_OUT_BE") == 0 ||
strcmp(dai_link->name, "ETDM1_IN_BE") == 0 ||
strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
if (!dai_link->num_codecs)
continue;

if (!strcmp(dai_link->codecs->dai_name, MAX98390_CODEC_DAI)) {
/*
* The TDM protocol settings with fixed 4 slots are defined in
4 changes: 2 additions & 2 deletions sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
Original file line number Diff line number Diff line change
@@ -1091,7 +1091,7 @@ static int mt8192_mt6359_legacy_probe(struct mtk_soc_card_data *soc_card_data)
dai_link->ignore = 0;
}

if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
if (dai_link->num_codecs &&
strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
dai_link->ops = &mt8192_rt1015_i2s_ops;
}
@@ -1119,7 +1119,7 @@ static int mt8192_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
int i;

for_each_card_prelinks(card, i, dai_link)
if (dai_link->num_codecs && dai_link->codecs[0].dai_name &&
if (dai_link->num_codecs &&
strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0)
dai_link->ops = &mt8192_rt1015_i2s_ops;
}
9 changes: 7 additions & 2 deletions sound/soc/mediatek/mt8195/mt8195-mt6359.c
Original file line number Diff line number Diff line change
@@ -1378,10 +1378,12 @@ static int mt8195_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,

for_each_card_prelinks(card, i, dai_link) {
if (strcmp(dai_link->name, "DPTX_BE") == 0) {
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
if (dai_link->num_codecs &&
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
dai_link->init = mt8195_dptx_codec_init;
} else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
if (dai_link->num_codecs &&
strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai"))
dai_link->init = mt8195_hdmi_codec_init;
} else if (strcmp(dai_link->name, "DL_SRC_BE") == 0 ||
strcmp(dai_link->name, "UL_SRC1_BE") == 0 ||
@@ -1394,6 +1396,9 @@ static int mt8195_mt6359_soc_card_probe(struct mtk_soc_card_data *soc_card_data,
strcmp(dai_link->name, "ETDM2_OUT_BE") == 0 ||
strcmp(dai_link->name, "ETDM1_IN_BE") == 0 ||
strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
if (!dai_link->num_codecs)
continue;

if (!strcmp(dai_link->codecs->dai_name, MAX98390_CODEC_DAI)) {
if (!(codec_init & MAX98390_CODEC_INIT)) {
dai_link->init = mt8195_max98390_init;
26 changes: 24 additions & 2 deletions sound/soc/sof/ipc3-topology.c
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@
/* size of tplg ABI in bytes */
#define SOF_IPC3_TPLG_ABI_SIZE 3

/* Base of SOF_DAI_INTEL_ALH, this should be aligned with SOC_SDW_INTEL_BIDIR_PDI_BASE */
#define INTEL_ALH_DAI_INDEX_BASE 2

struct sof_widget_data {
int ctrl_type;
int ipc_cmd;
@@ -1594,6 +1597,17 @@ static int sof_ipc3_widget_setup_comp_dai(struct snd_sof_widget *swidget)
if (ret < 0)
goto free;

/* Subtract the base to match the FW dai index. */
if (comp_dai->type == SOF_DAI_INTEL_ALH) {
if (comp_dai->dai_index < INTEL_ALH_DAI_INDEX_BASE) {
dev_err(sdev->dev,
"Invalid ALH dai index %d, only Pin numbers >= %d can be used\n",
comp_dai->dai_index, INTEL_ALH_DAI_INDEX_BASE);
return -EINVAL;
}
comp_dai->dai_index -= INTEL_ALH_DAI_INDEX_BASE;
}

dev_dbg(scomp->dev, "dai %s: type %d index %d\n",
swidget->widget->name, comp_dai->type, comp_dai->dai_index);
sof_dbg_comp_config(scomp, &comp_dai->config);
@@ -2167,8 +2181,16 @@ static int sof_ipc3_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
case SOF_DAI_INTEL_ALH:
if (data) {
/* save the dai_index during hw_params and reuse it for hw_free */
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS)
config->dai_index = data->dai_index;
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
/* Subtract the base to match the FW dai index. */
if (data->dai_index < INTEL_ALH_DAI_INDEX_BASE) {
dev_err(sdev->dev,
"Invalid ALH dai index %d, only Pin numbers >= %d can be used\n",
config->dai_index, INTEL_ALH_DAI_INDEX_BASE);
return -EINVAL;
}
config->dai_index = data->dai_index - INTEL_ALH_DAI_INDEX_BASE;
}
config->alh.stream_id = data->dai_data;
}
break;

0 comments on commit 2e5bf5b

Please sign in to comment.