Commit e8b96a66 authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-fix-v6.11-merge-window' of...

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.
parents dcfed708 ab53dfdc
......@@ -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, "21M5"),
}
},
{
.driver_data = &acp6x_card,
.matches = {
......
......@@ -2162,7 +2162,7 @@ static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i)
return;
cal = cal_fmw->calibrations;
if (cal)
if (!cal)
return;
load_calib_data(priv, &cal->dev_data);
......
......@@ -306,27 +306,12 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
return 0;
}
SND_SOC_DAILINK_DEFS(hifi,
DAILINK_COMP_ARRAY(COMP_EMPTY()),
DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(hifi_fe,
DAILINK_COMP_ARRAY(COMP_EMPTY()),
DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(hifi_be,
DAILINK_COMP_ARRAY(COMP_EMPTY()),
DAILINK_COMP_ARRAY(COMP_EMPTY(), COMP_EMPTY()));
static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
/* Default ASoC DAI Link*/
{
.name = "HiFi",
.stream_name = "HiFi",
.ops = &fsl_asoc_card_ops,
SND_SOC_DAILINK_REG(hifi),
},
/* DPCM Link between Front-End and Back-End (Optional) */
{
......@@ -335,7 +320,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
.dpcm_playback = 1,
.dpcm_capture = 1,
.dynamic = 1,
SND_SOC_DAILINK_REG(hifi_fe),
},
{
.name = "HiFi-ASRC-BE",
......@@ -345,7 +329,6 @@ static const struct snd_soc_dai_link fsl_asoc_card_dai[] = {
.dpcm_playback = 1,
.dpcm_capture = 1,
.no_pcm = 1,
SND_SOC_DAILINK_REG(hifi_be),
},
};
......@@ -637,6 +620,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
struct platform_device *cpu_pdev;
struct fsl_asoc_card_priv *priv;
struct device *codec_dev[2] = { NULL, NULL };
struct snd_soc_dai_link_component *dlc;
const char *codec_dai_name[2];
const char *codec_dev_name[2];
u32 asrc_fmt = 0;
......@@ -717,7 +701,35 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
memcpy(priv->dai_link, fsl_asoc_card_dai,
sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
/*
* "Default ASoC DAI Link": 1 cpus, 2 codecs, 1 platforms
* "DPCM Link Front-End": 1 cpus, 1 codecs (dummy), 1 platforms
* "DPCM Link Back-End": 1 cpus, 2 codecs
* totally 10 components
*/
dlc = devm_kcalloc(&pdev->dev, 10, sizeof(*dlc), GFP_KERNEL);
if (!dlc) {
ret = -ENOMEM;
goto asrc_fail;
}
priv->dai_link[0].cpus = &dlc[0];
priv->dai_link[0].num_cpus = 1;
priv->dai_link[0].codecs = &dlc[1];
priv->dai_link[0].num_codecs = 1;
priv->dai_link[0].platforms = &dlc[3];
priv->dai_link[0].num_platforms = 1;
priv->dai_link[1].cpus = &dlc[4];
priv->dai_link[1].num_cpus = 1;
priv->dai_link[1].codecs = &dlc[5];
priv->dai_link[1].num_codecs = 0; /* dummy */
priv->dai_link[1].platforms = &dlc[6];
priv->dai_link[1].num_platforms = 1;
priv->dai_link[2].cpus = &dlc[7];
priv->dai_link[2].num_cpus = 1;
priv->dai_link[2].codecs = &dlc[8];
priv->dai_link[2].num_codecs = 1;
priv->card.dapm_routes = audio_map;
......
......@@ -64,6 +64,15 @@ static const struct codec_map amps[] = {
CODEC_MAP_ENTRY("RT1015P", "rt1015", RT1015P_ACPI_HID, CODEC_RT1015P),
CODEC_MAP_ENTRY("RT1019P", "rt1019", RT1019P_ACPI_HID, CODEC_RT1019P),
CODEC_MAP_ENTRY("RT1308", "rt1308", RT1308_ACPI_HID, CODEC_RT1308),
/*
* Monolithic components
*
* Only put components that can serve as both the amp and the codec below this line.
* This will ensure that if the part is used just as a codec and there is an amp as well
* then the amp will be selected properly.
*/
CODEC_MAP_ENTRY("RT5650", "rt5650", RT5650_ACPI_HID, CODEC_RT5650),
};
enum snd_soc_acpi_intel_codec
......
......@@ -11,7 +11,7 @@
#include <linux/platform_data/x86/soc.h>
#if IS_ENABLED(CONFIG_X86)
#if IS_REACHABLE(CONFIG_IOSF_MBI)
#include <linux/dmi.h>
#include <asm/iosf_mbi.h>
......
......@@ -34,7 +34,6 @@ static const struct sof_amd_acp_desc vangogh_chip_info = {
.dsp_intr_base = ACP5X_DSP_SW_INTR_BASE,
.sram_pte_offset = ACP5X_SRAM_PTE_OFFSET,
.hw_semaphore_offset = ACP5X_AXI2DAGB_SEM_0,
.acp_clkmux_sel = ACP5X_CLKMUX_SEL,
.probe_reg_offset = ACP5X_FUTURE_REG_ACLK_0,
};
......
......@@ -234,7 +234,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev)
/* set default mailbox offset for FW ready message */
sdev->dsp_box.offset = MBOX_OFFSET;
priv->regmap = syscon_regmap_lookup_by_compatible("fsl,dsp-ctrl");
priv->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,dsp-ctrl");
if (IS_ERR(priv->regmap)) {
dev_err(sdev->dev, "cannot find dsp-ctrl registers");
ret = PTR_ERR(priv->regmap);
......
......@@ -310,6 +310,7 @@ int hda_cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream
return ret;
}
if (sdev->pdata->ipc_type == SOF_IPC_TYPE_4) {
/* Wait for completion of transfer */
time_left = wait_for_completion_timeout(&hda_stream->ioc,
msecs_to_jiffies(HDA_CL_DMA_IOC_TIMEOUT_MS));
......@@ -318,7 +319,10 @@ int hda_cl_copy_fw(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream
dev_err(sdev->dev, "Code loader DMA did not complete\n");
return -ETIMEDOUT;
}
dev_dbg(sdev->dev, "Code loader DMA done, waiting for FW_ENTERED status\n");
dev_dbg(sdev->dev, "Code loader DMA done\n");
}
dev_dbg(sdev->dev, "waiting for FW_ENTERED status\n");
status = snd_sof_dsp_read_poll_timeout(sdev, HDA_DSP_BAR,
chip->rom_status_reg, reg,
......
......@@ -1307,9 +1307,10 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
const struct sof_dev_desc *desc = sof_pdata->desc;
struct hdac_bus *bus = sof_to_bus(sdev);
struct snd_soc_acpi_mach *mach = NULL;
enum snd_soc_acpi_intel_codec codec_type;
enum snd_soc_acpi_intel_codec codec_type, amp_type;
const char *tplg_filename;
const char *tplg_suffix;
bool amp_name_valid;
/* Try I2S or DMIC if it is supported */
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)
}
}
codec_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
amp_type = snd_soc_acpi_intel_detect_amp_type(sdev->dev);
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
amp_name_valid = amp_type != CODEC_NONE && amp_type != codec_type;
if (tplg_fixup &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME &&
codec_type != CODEC_NONE) {
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(codec_type);
if (tplg_fixup && amp_name_valid &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_AMP_NAME) {
tplg_suffix = snd_soc_acpi_intel_get_amp_tplg_suffix(amp_type);
if (!tplg_suffix) {
dev_err(sdev->dev, "no tplg suffix found, amp %d\n",
codec_type);
amp_type);
return NULL;
}
......@@ -1436,7 +1438,6 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
add_extension = true;
}
codec_type = snd_soc_acpi_intel_detect_codec_type(sdev->dev);
if (tplg_fixup &&
mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_CODEC_NAME &&
......
......@@ -1358,7 +1358,13 @@ static void sof_ipc4_unprepare_copier_module(struct snd_sof_widget *swidget)
ipc4_copier = dai->private;
if (pipeline->use_chain_dma) {
pipeline->msg.primary = 0;
/*
* Preserve the DMA Link ID and clear other bits since
* the DMA Link ID is only configured once during
* dai_config, other fields are expected to be 0 for
* re-configuration
*/
pipeline->msg.primary &= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
pipeline->msg.extension = 0;
}
......@@ -3095,8 +3101,14 @@ static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
return 0;
if (pipeline->use_chain_dma) {
/*
* Only configure the DMA Link ID for ChainDMA when this op is
* invoked with SOF_DAI_CONFIG_FLAGS_HW_PARAMS
*/
if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_LINK_ID_MASK;
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_LINK_ID(data->dai_data);
}
return 0;
}
......
......@@ -78,6 +78,7 @@ config SND_SOC_TEGRA210_DMIC
config SND_SOC_TEGRA210_I2S
tristate "Tegra210 I2S module"
select SND_SIMPLE_CARD_UTILS
help
Config to enable the Inter-IC Sound (I2S) Controller which
implements full-duplex and bidirectional and single direction
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment