Skip to content

Commit ac02e3c

Browse files
committed
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.
2 parents eb9d84b + c61711c commit ac02e3c

14 files changed

Lines changed: 54 additions & 41 deletions

sound/soc/atmel/mchp-pdmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ static int mchp_pdmc_process(struct snd_pcm_substream *substream,
966966

967967
static struct snd_dmaengine_pcm_config mchp_pdmc_config = {
968968
.process = mchp_pdmc_process,
969+
.prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
969970
};
970971

971972
static int mchp_pdmc_probe(struct platform_device *pdev)

sound/soc/codecs/da7219.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,21 +446,27 @@ static int da7219_tonegen_freq_put(struct snd_kcontrol *kcontrol,
446446
struct soc_mixer_control *mixer_ctrl =
447447
(struct soc_mixer_control *) kcontrol->private_value;
448448
unsigned int reg = mixer_ctrl->reg;
449-
__le16 val;
449+
__le16 val_new, val_old;
450450
int ret;
451451

452452
/*
453453
* Frequency value spans two 8-bit registers, lower then upper byte.
454454
* Therefore we need to convert to little endian here to align with
455455
* HW registers.
456456
*/
457-
val = cpu_to_le16(ucontrol->value.integer.value[0]);
457+
val_new = cpu_to_le16(ucontrol->value.integer.value[0]);
458458

459459
mutex_lock(&da7219->ctrl_lock);
460-
ret = regmap_raw_write(da7219->regmap, reg, &val, sizeof(val));
460+
ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old));
461+
if (ret == 0 && (val_old != val_new))
462+
ret = regmap_raw_write(da7219->regmap, reg,
463+
&val_new, sizeof(val_new));
461464
mutex_unlock(&da7219->ctrl_lock);
462465

463-
return ret;
466+
if (ret < 0)
467+
return ret;
468+
469+
return val_old != val_new;
464470
}
465471

466472

sound/soc/codecs/max98090.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol,
413413

414414
val = (val >> mc->shift) & mask;
415415

416+
if (sel < 0 || sel > mc->max)
417+
return -EINVAL;
418+
416419
*select = sel;
417420

418421
/* 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,
427430
mask << mc->shift,
428431
sel << mc->shift);
429432

430-
return 0;
433+
return *select != val;
431434
}
432435

433436
static const char *max98090_perf_pwr_text[] =

sound/soc/codecs/rt9120.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ static int rt9120_get_reg_size(unsigned int reg)
341341
{
342342
switch (reg) {
343343
case 0x00:
344-
case 0x09:
345344
case 0x20 ... 0x27:
346345
return 2;
347346
case 0x30 ... 0x3D:

sound/soc/codecs/wm8958-dsp2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol,
530530

531531
wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]);
532532

533-
return 0;
533+
return 1;
534534
}
535535

536536
#define WM8958_MBC_SWITCH(xname, xval) {\
@@ -656,7 +656,7 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol,
656656

657657
wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]);
658658

659-
return 0;
659+
return 1;
660660
}
661661

662662

@@ -730,7 +730,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol,
730730

731731
wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]);
732732

733-
return 0;
733+
return 1;
734734
}
735735

736736
#define WM8958_HPF_SWITCH(xname, xval) {\
@@ -824,7 +824,7 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol,
824824

825825
wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]);
826826

827-
return 0;
827+
return 1;
828828
}
829829

830830
#define WM8958_ENH_EQ_SWITCH(xname, xval) {\

sound/soc/generic/simple-card-utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void asoc_simple_shutdown(struct snd_pcm_substream *substream)
322322

323323
if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai))
324324
snd_soc_dai_set_sysclk(cpu_dai,
325-
0, 0, SND_SOC_CLOCK_IN);
325+
0, 0, SND_SOC_CLOCK_OUT);
326326

327327
asoc_simple_clk_disable(dai);
328328
}

sound/soc/meson/aiu-acodec-ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int aiu_acodec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol,
5858

5959
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
6060

61-
return 0;
61+
return 1;
6262
}
6363

6464
static SOC_ENUM_SINGLE_DECL(aiu_acodec_ctrl_mux_enum, AIU_ACODEC_CTRL,

sound/soc/meson/aiu-codec-ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int aiu_codec_ctrl_mux_put_enum(struct snd_kcontrol *kcontrol,
5757

5858
snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
5959

60-
return 0;
60+
return 1;
6161
}
6262

6363
static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL,

sound/soc/meson/axg-card.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
320320

321321
dai_link->cpus = cpu;
322322
dai_link->num_cpus = 1;
323-
dai_link->nonatomic = true;
324323

325324
ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
326325
&dai_link->cpus->dai_name);

sound/soc/meson/axg-tdm-interface.c

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -351,29 +351,13 @@ static int axg_tdm_iface_hw_free(struct snd_pcm_substream *substream,
351351
return 0;
352352
}
353353

354-
static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream,
355-
int cmd,
354+
static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream,
356355
struct snd_soc_dai *dai)
357356
{
358-
struct axg_tdm_stream *ts =
359-
snd_soc_dai_get_dma_data(dai, substream);
360-
361-
switch (cmd) {
362-
case SNDRV_PCM_TRIGGER_START:
363-
case SNDRV_PCM_TRIGGER_RESUME:
364-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
365-
axg_tdm_stream_start(ts);
366-
break;
367-
case SNDRV_PCM_TRIGGER_SUSPEND:
368-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
369-
case SNDRV_PCM_TRIGGER_STOP:
370-
axg_tdm_stream_stop(ts);
371-
break;
372-
default:
373-
return -EINVAL;
374-
}
357+
struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream);
375358

376-
return 0;
359+
/* Force all attached formatters to update */
360+
return axg_tdm_stream_reset(ts);
377361
}
378362

379363
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 = {
413397
.set_fmt = axg_tdm_iface_set_fmt,
414398
.startup = axg_tdm_iface_startup,
415399
.hw_params = axg_tdm_iface_hw_params,
400+
.prepare = axg_tdm_iface_prepare,
416401
.hw_free = axg_tdm_iface_hw_free,
417-
.trigger = axg_tdm_iface_trigger,
418402
};
419403

420404
/* TDM Backend DAIs */

0 commit comments

Comments
 (0)