Skip to content

Commit e8b96a6

Browse files
committed
Merge tag 'asoc-fix-v6.11-merge-window' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.11 A selection of routine fixes and quirks that came in since the merge window. The fsl-asoc-card change is a fix for systems with multiple cards where updating templates in place leaks data from one card to another.
2 parents dcfed70 + ab53dfd commit e8b96a6

File tree

11 files changed

+85
-40
lines changed

11 files changed

+85
-40
lines changed

sound/soc/amd/yc/acp6x-mach.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
220220
DMI_MATCH(DMI_PRODUCT_NAME, "21J6"),
221221
}
222222
},
223+
{
224+
.driver_data = &acp6x_card,
225+
.matches = {
226+
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
227+
DMI_MATCH(DMI_PRODUCT_NAME, "21M5"),
228+
}
229+
},
223230
{
224231
.driver_data = &acp6x_card,
225232
.matches = {

sound/soc/codecs/tas2781-fmwlib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,7 @@ static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i)
21622162
return;
21632163

21642164
cal = cal_fmw->calibrations;
2165-
if (cal)
2165+
if (!cal)
21662166
return;
21672167

21682168
load_calib_data(priv, &cal->dev_data);

sound/soc/fsl/fsl-asoc-card.c

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -306,27 +306,12 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
306306
return 0;
307307
}
308308

309-
SND_SOC_DAILINK_DEFS(hifi,
310-
DAILINK_COMP_ARRAY(COMP_EMPTY()),
311-
DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()),
312-
DAILINK_COMP_ARRAY(COMP_EMPTY()));
313-
314-
SND_SOC_DAILINK_DEFS(hifi_fe,
315-
DAILINK_COMP_ARRAY(COMP_EMPTY()),
316-
DAILINK_COMP_ARRAY(COMP_DUMMY()),
317-
DAILINK_COMP_ARRAY(COMP_EMPTY()));
318-
319-
SND_SOC_DAILINK_DEFS(hifi_be,
320-
DAILINK_COMP_ARRAY(COMP_EMPTY()),
321-
DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()));
322-
323309
static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
324310
/* Default ASoC DAI Link*/
325311
{
326312
.name = "HiFi",
327313
.stream_name = "HiFi",
328314
.ops = &fsl_asoc_card_ops,
329-
SND_SOC_DAILINK_REG(hifi),
330315
},
331316
/* DPCM Link between Front-End and Back-End (Optional) */
332317
{
@@ -335,7 +320,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
335320
.dpcm_playback = 1,
336321
.dpcm_capture = 1,
337322
.dynamic = 1,
338-
SND_SOC_DAILINK_REG(hifi_fe),
339323
},
340324
{
341325
.name = "HiFi-ASRC-BE",
@@ -345,7 +329,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
345329
.dpcm_playback = 1,
346330
.dpcm_capture = 1,
347331
.no_pcm = 1,
348-
SND_SOC_DAILINK_REG(hifi_be),
349332
},
350333
};
351334

@@ -637,6 +620,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
637620
struct platform_device *cpu_pdev;
638621
struct fsl_asoc_card_priv *priv;
639622
struct device *codec_dev[2] = { NULL, NULL };
623+
struct snd_soc_dai_link_component *dlc;
640624
const char *codec_dai_name[2];
641625
const char *codec_dev_name[2];
642626
u32 asrc_fmt = 0;
@@ -717,7 +701,35 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
717701

718702
memcpy(priv->dai_link, fsl_asoc_card_dai,
719703
sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
704+
/*
705+
* "Default ASoC DAI Link": 1 cpus, 2 codecs, 1 platforms
706+
* "DPCM Link Front-End": 1 cpus, 1 codecs (dummy), 1 platforms
707+
* "DPCM Link Back-End": 1 cpus, 2 codecs
708+
* totally 10 components
709+
*/
710+
dlc = devm_kcalloc(&pdev->dev, 10, sizeof(*dlc), GFP_KERNEL);
711+
if (!dlc) {
712+
ret = -ENOMEM;
713+
goto asrc_fail;
714+
}
715+
716+
priv->dai_link[0].cpus = &dlc[0];
717+
priv->dai_link[0].num_cpus = 1;
718+
priv->dai_link[0].codecs = &dlc[1];
720719
priv->dai_link[0].num_codecs = 1;
720+
priv->dai_link[0].platforms = &dlc[3];
721+
priv->dai_link[0].num_platforms = 1;
722+
723+
priv->dai_link[1].cpus = &dlc[4];
724+
priv->dai_link[1].num_cpus = 1;
725+
priv->dai_link[1].codecs = &dlc[5];
726+
priv->dai_link[1].num_codecs = 0; /* dummy */
727+
priv->dai_link[1].platforms = &dlc[6];
728+
priv->dai_link[1].num_platforms = 1;
729+
730+
priv->dai_link[2].cpus = &dlc[7];
731+
priv->dai_link[2].num_cpus = 1;
732+
priv->dai_link[2].codecs = &dlc[8];
721733
priv->dai_link[2].num_codecs = 1;
722734

723735
priv->card.dapm_routes = audio_map;

sound/soc/intel/common/soc-acpi-intel-ssp-common.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ static const struct codec_map amps[] = {
6464
CODEC_MAP_ENTRY("RT1015P", "rt1015", RT1015P_ACPI_HID, CODEC_RT1015P),
6565
CODEC_MAP_ENTRY("RT1019P", "rt1019", RT1019P_ACPI_HID, CODEC_RT1019P),
6666
CODEC_MAP_ENTRY("RT1308", "rt1308", RT1308_ACPI_HID, CODEC_RT1308),
67+
68+
/*
69+
* Monolithic components
70+
*
71+
* Only put components that can serve as both the amp and the codec below this line.
72+
* This will ensure that if the part is used just as a codec and there is an amp as well
73+
* then the amp will be selected properly.
74+
*/
75+
CODEC_MAP_ENTRY("RT5650", "rt5650", RT5650_ACPI_HID, CODEC_RT5650),
6776
};
6877

6978
enum snd_soc_acpi_intel_codec

sound/soc/intel/common/soc-intel-quirks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <linux/platform_data/x86/soc.h>
1313

14-
#if IS_ENABLED(CONFIG_X86)
14+
#if IS_REACHABLE(CONFIG_IOSF_MBI)
1515

1616
#include <linux/dmi.h>
1717
#include <asm/iosf_mbi.h>

sound/soc/sof/amd/pci-vangogh.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static const struct sof_amd_acp_desc vangogh_chip_info = {
3434
.dsp_intr_base = ACP5X_DSP_SW_INTR_BASE,
3535
.sram_pte_offset = ACP5X_SRAM_PTE_OFFSET,
3636
.hw_semaphore_offset = ACP5X_AXI2DAGB_SEM_0,
37-
.acp_clkmux_sel = ACP5X_CLKMUX_SEL,
3837
.probe_reg_offset = ACP5X_FUTURE_REG_ACLK_0,
3938
};
4039

sound/soc/sof/imx/imx8m.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev)
234234
/* set default mailbox offset for FW ready message */
235235
sdev->dsp_box.offset = MBOX_OFFSET;
236236

237-
priv->regmap = syscon_regmap_lookup_by_compatible("fsl,dsp-ctrl");
237+
priv->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,dsp-ctrl");
238238
if (IS_ERR(priv->regmap)) {
239239
dev_err(sdev->dev, "cannot find dsp-ctrl registers");
240240
ret = PTR_ERR(priv->regmap);

sound/soc/sof/intel/hda-loader.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,15 +310,19 @@ int hda_cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream
310310
return ret;
311311
}
312312

313-
/* Wait for completion of transfer */
314-
time_left = wait_for_completion_timeout(&hda_stream->ioc,
315-
msecs_to_jiffies(HDA_CL_DMA_IOC_TIMEOUT_MS));
316-
317-
if (!time_left) {
318-
dev_err(sdev->dev, "Code loader DMA did not complete\n");
319-
return -ETIMEDOUT;
313+
if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) {
314+
/* Wait for completion of transfer */
315+
time_left = wait_for_completion_timeout(&hda_stream->ioc,
316+
msecs_to_jiffies(HDA_CL_DMA_IOC_TIMEOUT_MS));
317+
318+
if (!time_left) {
319+
dev_err(sdev->dev, "Code loader DMA did not complete\n");
320+
return -ETIMEDOUT;
321+
}
322+
dev_dbg(sdev->dev, "Code loader DMA done\n");
320323
}
321-
dev_dbg(sdev->dev, "Code loader DMA done, waiting for FW_ENTERED status\n");
324+
325+
dev_dbg(sdev->dev, "waiting for FW_ENTERED status\n");
322326

323327
status = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
324328
chip->rom_status_reg, reg,

sound/soc/sof/intel/hda.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,9 +1307,10 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
13071307
const struct sof_dev_desc *desc = sof_pdata->desc;
13081308
struct hdac_bus *bus = sof_to_bus(sdev);
13091309
struct snd_soc_acpi_mach *mach = NULL;
1310-
enum snd_soc_acpi_intel_codec codec_type;
1310+
enum snd_soc_acpi_intel_codec codec_type, amp_type;
13111311
const char *tplg_filename;
13121312
const char *tplg_suffix;
1313+
bool amp_name_valid;
13131314

13141315
/* Try I2S or DMIC if it is supported */
13151316
if (interface_mask & (BIT(SOF_DAI_INTEL_SSP) | BIT(SOF_DAI_INTEL_DMIC)))
@@ -1413,15 +1414,16 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
14131414
}
14141415
}
14151416

1416-
codec_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
1417+
amp_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
1418+
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
1419+
amp_name_valid = amp_type != CODEC_NONE && amp_type != codec_type;
14171420

1418-
if (tplg_fixup &&
1419-
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME &&
1420-
codec_type != CODEC_NONE) {
1421-
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(codec_type);
1421+
if (tplg_fixup && amp_name_valid &&
1422+
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME) {
1423+
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(amp_type);
14221424
if (!tplg_suffix) {
14231425
dev_err(sdev->dev, "no tplg suffix found, amp %d\n",
1424-
codec_type);
1426+
amp_type);
14251427
return NULL;
14261428
}
14271429

@@ -1436,7 +1438,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
14361438
add_extension = true;
14371439
}
14381440

1439-
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
14401441

14411442
if (tplg_fixup &&
14421443
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME &&

sound/soc/sof/ipc4-topology.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,13 @@ static void sof_ipc4_unprepare_copier_module(struct snd_sof_widget *swidget)
13581358
ipc4_copier = dai->private;
13591359

13601360
if (pipeline->use_chain_dma) {
1361-
pipeline->msg.primary = 0;
1361+
/*
1362+
* Preserve the DMA Link ID and clear other bits since
1363+
* the DMA Link ID is only configured once during
1364+
* dai_config, other fields are expected to be 0 for
1365+
* re-configuration
1366+
*/
1367+
pipeline->msg.primary &= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
13621368
pipeline->msg.extension = 0;
13631369
}
13641370

@@ -3095,8 +3101,14 @@ static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
30953101
return 0;
30963102

30973103
if (pipeline->use_chain_dma) {
3098-
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
3099-
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID(data->dai_data);
3104+
/*
3105+
* Only configure the DMA Link ID for ChainDMA when this op is
3106+
* invoked with SOF_DAI_CONFIG_FLAGS_HW_PARAMS
3107+
*/
3108+
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
3109+
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
3110+
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID(data->dai_data);
3111+
}
31003112
return 0;
31013113
}
31023114

0 commit comments

Comments
 (0)