Commit ac02e3cd authored by Takashi Iwai's avatar Takashi Iwai

Merge tag 'asoc-fix-v5.18-rc4' of...

Merge tag 'asoc-fix-v5.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.18

A larger collection of fixes than I'd like, mainly because mixer-test
is making it's way into the CI systems and turning up issues on a wider
range of systems.  The most substantial thing though is a revert and an
alternative fix for a dmaengine issue where the fix caused disruption
for some other configurations, the core fix is backed out an a driver
specific thing done instead.
parents eb9d84b0 c61711c1
...@@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream, ...@@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream,
static struct snd_dmaengine_pcm_config mchp_pdmc_config = { static struct snd_dmaengine_pcm_config mchp_pdmc_config = {
.process = mchp_pdmc_process, .process = mchp_pdmc_process,
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
}; };
static int mchp_pdmc_probe(struct platform_device *pdev) static int mchp_pdmc_probe(struct platform_device *pdev)
......
...@@ -446,7 +446,7 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol, ...@@ -446,7 +446,7 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol,
struct soc_mixer_control *mixer_ctrl = struct soc_mixer_control *mixer_ctrl =
(struct soc_mixer_control *) kcontrol->private_value; (struct soc_mixer_control *) kcontrol->private_value;
unsigned int reg = mixer_ctrl->reg; unsigned int reg = mixer_ctrl->reg;
__le16 val; __le16 val_new, val_old;
int ret; int ret;
/* /*
...@@ -454,13 +454,19 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol, ...@@ -454,13 +454,19 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol,
* Therefore we need to convert to little endian here to align with * Therefore we need to convert to little endian here to align with
* HW registers. * HW registers.
*/ */
val = cpu_to_le16(ucontrol->value.integer.value[0]); val_new = cpu_to_le16(ucontrol->value.integer.value[0]);
mutex_lock(&da7219->ctrl_lock); mutex_lock(&da7219->ctrl_lock);
ret = regmap_raw_write(da7219->regmap, reg, &val, sizeof(val)); ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old));
if (ret == 0 && (val_old != val_new))
ret = regmap_raw_write(da7219->regmap, reg,
&val_new, sizeof(val_new));
mutex_unlock(&da7219->ctrl_lock); mutex_unlock(&da7219->ctrl_lock);
if (ret < 0)
return ret; return ret;
return val_old != val_new;
} }
......
...@@ -413,6 +413,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, ...@@ -413,6 +413,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
val = (val >> mc->shift) & mask; val = (val >> mc->shift) & mask;
if (sel < 0 || sel > mc->max)
return -EINVAL;
*select = sel; *select = sel;
/* Setting a volume is only valid if it is already On */ /* Setting a volume is only valid if it is already On */
...@@ -427,7 +430,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, ...@@ -427,7 +430,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
mask << mc->shift, mask << mc->shift,
sel << mc->shift); sel << mc->shift);
return 0; return *select != val;
} }
static const char *max98090_perf_pwr_text[] = static const char *max98090_perf_pwr_text[] =
......
...@@ -341,7 +341,6 @@ static int rt9120_get_reg_size(unsigned int reg) ...@@ -341,7 +341,6 @@ static int rt9120_get_reg_size(unsigned int reg)
{ {
switch (reg) { switch (reg) {
case 0x00: case 0x00:
case 0x09:
case 0x20 ... 0x27: case 0x20 ... 0x27:
return 2; return 2;
case 0x30 ... 0x3D: case 0x30 ... 0x3D:
......
...@@ -530,7 +530,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol, ...@@ -530,7 +530,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol,
wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]);
return 0; return 1;
} }
#define WM8958_MBC_SWITCH(xname, xval) {\ #define WM8958_MBC_SWITCH(xname, xval) {\
...@@ -656,7 +656,7 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol, ...@@ -656,7 +656,7 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol,
wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]);
return 0; return 1;
} }
...@@ -730,7 +730,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol, ...@@ -730,7 +730,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]);
return 0; return 1;
} }
#define WM8958_HPF_SWITCH(xname, xval) {\ #define WM8958_HPF_SWITCH(xname, xval) {\
...@@ -824,7 +824,7 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol, ...@@ -824,7 +824,7 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol,
wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]);
return 0; return 1;
} }
#define WM8958_ENH_EQ_SWITCH(xname, xval) {\ #define WM8958_ENH_EQ_SWITCH(xname, xval) {\
......
...@@ -322,7 +322,7 @@ void asoc_simple_shutdown(struct snd_pcm_substream *substream) ...@@ -322,7 +322,7 @@ void asoc_simple_shutdown(struct snd_pcm_substream *substream)
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai)) if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
snd_soc_dai_set_sysclk(cpu_dai, snd_soc_dai_set_sysclk(cpu_dai,
0, 0, SND_SOC_CLOCK_IN); 0, 0, SND_SOC_CLOCK_OUT);
asoc_simple_clk_disable(dai); asoc_simple_clk_disable(dai);
} }
......
...@@ -58,7 +58,7 @@ static int aiu_acodec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, ...@@ -58,7 +58,7 @@ static int aiu_acodec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol,
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
return 0; return 1;
} }
static SOC_ENUM_SINGLE_DECL(aiu_acodec_ctrl_mux_enum, AIU_ACODEC_CTRL, static SOC_ENUM_SINGLE_DECL(aiu_acodec_ctrl_mux_enum, AIU_ACODEC_CTRL,
......
...@@ -57,7 +57,7 @@ static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol, ...@@ -57,7 +57,7 @@ static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol,
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
return 0; return 1;
} }
static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL, static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL,
......
...@@ -320,7 +320,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np, ...@@ -320,7 +320,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
dai_link->cpus = cpu; dai_link->cpus = cpu;
dai_link->num_cpus = 1; dai_link->num_cpus = 1;
dai_link->nonatomic = true;
ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node, ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
&dai_link->cpus->dai_name); &dai_link->cpus->dai_name);
......
...@@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream, ...@@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream, static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream,
int cmd,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct axg_tdm_stream *ts = struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream);
snd_soc_dai_get_dma_data(dai, substream);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
axg_tdm_stream_start(ts);
break;
case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
case SNDRV_PCM_TRIGGER_STOP:
axg_tdm_stream_stop(ts);
break;
default:
return -EINVAL;
}
return 0; /* Force all attached formatters to update */
return axg_tdm_stream_reset(ts);
} }
static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai)
...@@ -413,8 +397,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = { ...@@ -413,8 +397,8 @@ static const struct snd_soc_dai_ops axg_tdm_iface_ops = {
.set_fmt = axg_tdm_iface_set_fmt, .set_fmt = axg_tdm_iface_set_fmt,
.startup = axg_tdm_iface_startup, .startup = axg_tdm_iface_startup,
.hw_params = axg_tdm_iface_hw_params, .hw_params = axg_tdm_iface_hw_params,
.prepare = axg_tdm_iface_prepare,
.hw_free = axg_tdm_iface_hw_free, .hw_free = axg_tdm_iface_hw_free,
.trigger = axg_tdm_iface_trigger,
}; };
/* TDM Backend DAIs */ /* TDM Backend DAIs */
......
...@@ -67,7 +67,7 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol, ...@@ -67,7 +67,7 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol,
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
return 0; return 1;
} }
static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_i2s_mux_enum, TOHDMITX_CTRL0, static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_i2s_mux_enum, TOHDMITX_CTRL0,
......
...@@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, ...@@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component,
memset(&slave_config, 0, sizeof(slave_config)); memset(&slave_config, 0, sizeof(slave_config));
if (pcm->config && pcm->config->prepare_slave_config) if (!pcm->config)
prepare_slave_config = pcm->config->prepare_slave_config;
else
prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
else
prepare_slave_config = pcm->config->prepare_slave_config;
if (prepare_slave_config) { if (prepare_slave_config) {
int ret = prepare_slave_config(substream, params, &slave_config); int ret = prepare_slave_config(substream, params, &slave_config);
......
...@@ -461,7 +461,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, ...@@ -461,7 +461,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
ret = err; ret = err;
} }
} }
return err; return ret;
} }
EXPORT_SYMBOL_GPL(snd_soc_put_volsw_sx); EXPORT_SYMBOL_GPL(snd_soc_put_volsw_sx);
...@@ -519,7 +519,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ...@@ -519,7 +519,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
unsigned int mask = (1 << fls(max)) - 1; unsigned int mask = (1 << fls(max)) - 1;
unsigned int invert = mc->invert; unsigned int invert = mc->invert;
unsigned int val, val_mask; unsigned int val, val_mask;
int err, ret; int err, ret, tmp;
tmp = ucontrol->value.integer.value[0];
if (tmp < 0)
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
if (tmp > mc->max - mc->min + 1)
return -EINVAL;
if (invert) if (invert)
val = (max - ucontrol->value.integer.value[0]) & mask; val = (max - ucontrol->value.integer.value[0]) & mask;
...@@ -534,6 +542,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, ...@@ -534,6 +542,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,
ret = err; ret = err;
if (snd_soc_volsw_is_stereo(mc)) { if (snd_soc_volsw_is_stereo(mc)) {
tmp = ucontrol->value.integer.value[1];
if (tmp < 0)
return -EINVAL;
if (mc->platform_max && tmp > mc->platform_max)
return -EINVAL;
if (tmp > mc->max - mc->min + 1)
return -EINVAL;
if (invert) if (invert)
val = (max - ucontrol->value.integer.value[1]) & mask; val = (max - ucontrol->value.integer.value[1]) & mask;
else else
......
...@@ -153,6 +153,11 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) ...@@ -153,6 +153,11 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
dev_dbg(&pci->dev, "PCI DSP detected"); dev_dbg(&pci->dev, "PCI DSP detected");
if (!desc) {
dev_err(dev, "error: no matching PCI descriptor\n");
return -ENODEV;
}
if (!desc->ops) { if (!desc->ops) {
dev_err(dev, "error: no matching PCI descriptor ops\n"); dev_err(dev, "error: no matching PCI descriptor ops\n");
return -ENODEV; return -ENODEV;
......
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