summaryrefslogtreecommitdiff
path: root/sound/soc/sof/topology.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-12-14 17:57:14 +0300
committerTakashi Iwai <tiwai@suse.de>2020-12-14 17:57:14 +0300
commit598100be3053fef628adf3ad6ee4f828ad308f64 (patch)
tree78069fd27e04f19fb14043ce16122ed1a6df1886 /sound/soc/sof/topology.c
parent175b8d89fe292796811fdee87fa39799a5b6b87a (diff)
parent460aa020f56c974a3e7e5b5378b2355fec6a2c11 (diff)
downloadlinux-598100be3053fef628adf3ad6ee4f828ad308f64.tar.xz
Merge tag 'asoc-v5.11' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.11 There's a lot of changes here but mostly cleanups and driver specific things, the most user visible change is the support for boot time selection of Intel DSP firmware which will make it easier for people to move over to the preferred modern implementations in distros and other large scale deployments. This also includes a merge of the new auxillary bus which was done in anticipation of use by the Intel DSP drivers which didn't quite make it. - Lots more cleanups and simplifications from Morimoto-san. - Support for some basic DPCM systems in the audio graph card from Sameer Pujar. - Remove some old pre-DT Freescale drivers for platforms that are now DT only. - Move selection of which Intel DSP implementation to use to boot time rather than requiring it to be selected at build time. - Support for Allwinner H6 I2S, Analog Devices ADAU1372, Intel Alderlake-S, GMediatek MT8192, NXP i.MX HDMI and XCVR, Realtek RT715, Qualcomm SM8250 and simple GPIO based muxes.
Diffstat (limited to 'sound/soc/sof/topology.c')
-rw-r--r--sound/soc/sof/topology.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 69313fbdb636..b6b32a7a91f8 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1041,6 +1041,15 @@ static int sof_control_load_volume(struct snd_soc_component *scomp,
goto out;
}
+ /*
+ * If control has more than 2 channels we need to override the info. This is because even if
+ * ASoC layer has defined topology's max channel count to SND_SOC_TPLG_MAX_CHAN = 8, the
+ * pre-defined dapm control types (and related functions) creating the actual control
+ * restrict the channels only to mono or stereo.
+ */
+ if (le32_to_cpu(mc->num_channels) > 2)
+ kc->info = snd_sof_volume_info;
+
/* init the volume get/put data */
scontrol->size = struct_size(scontrol->control_data, chanv,
le32_to_cpu(mc->num_channels));
@@ -1201,7 +1210,7 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp,
ret = -EINVAL;
goto out_free;
}
- if (cdata->data->size + sizeof(const struct sof_abi_hdr) !=
+ if (cdata->data->size + sizeof(struct sof_abi_hdr) !=
le32_to_cpu(control->priv.size)) {
dev_err(scomp->dev,
"error: Conflict in bytes vs. priv size.\n");
@@ -2777,18 +2786,18 @@ static void sof_dai_set_format(struct snd_soc_tplg_hw_config *hw_config,
struct sof_ipc_dai_config *config)
{
/* clock directions wrt codec */
- if (hw_config->bclk_master == SND_SOC_TPLG_BCLK_CM) {
- /* codec is bclk master */
- if (hw_config->fsync_master == SND_SOC_TPLG_FSYNC_CM)
- config->format |= SOF_DAI_FMT_CBM_CFM;
+ if (hw_config->bclk_provider == SND_SOC_TPLG_BCLK_CP) {
+ /* codec is bclk provider */
+ if (hw_config->fsync_provider == SND_SOC_TPLG_FSYNC_CP)
+ config->format |= SOF_DAI_FMT_CBP_CFP;
else
- config->format |= SOF_DAI_FMT_CBM_CFS;
+ config->format |= SOF_DAI_FMT_CBP_CFC;
} else {
- /* codec is bclk slave */
- if (hw_config->fsync_master == SND_SOC_TPLG_FSYNC_CM)
- config->format |= SOF_DAI_FMT_CBS_CFM;
+ /* codec is bclk consumer */
+ if (hw_config->fsync_provider == SND_SOC_TPLG_FSYNC_CP)
+ config->format |= SOF_DAI_FMT_CBC_CFP;
else
- config->format |= SOF_DAI_FMT_CBS_CFS;
+ config->format |= SOF_DAI_FMT_CBC_CFC;
}
/* inverted clocks ? */
@@ -3734,9 +3743,7 @@ int snd_sof_load_topology(struct snd_soc_component *scomp, const char *file)
return ret;
}
- ret = snd_soc_tplg_component_load(scomp,
- &sof_tplg_ops, fw,
- SND_SOC_TPLG_INDEX_ALL);
+ ret = snd_soc_tplg_component_load(scomp, &sof_tplg_ops, fw);
if (ret < 0) {
dev_err(scomp->dev, "error: tplg component load failed %d\n",
ret);