Skip to content

Commit 9e96716

Browse files
committed
Merge tag 'asoc-fix-v5.9-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.9 A bunch of fixes that came in during the merge window, mostly for issues that were uncovered by the changes to report errors on invalid register access plus one important fix in that code itself.
2 parents d8d0db7 + 062fa09 commit 9e96716

17 files changed

+266
-243
lines changed

sound/soc/amd/acp3x-rt5682-max9836.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int acp3x_1015_hw_params(struct snd_pcm_substream *substream,
138138
srate = params_rate(params);
139139

140140
for_each_rtd_codec_dais(rtd, i, codec_dai) {
141-
if (strcmp(codec_dai->component->name, "rt1015-aif"))
141+
if (strcmp(codec_dai->name, "rt1015-aif"))
142142
continue;
143143
ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
144144
if (ret < 0)

sound/soc/amd/renoir/acp3x-pdm-dma.c

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -314,40 +314,30 @@ static int acp_pdm_dma_close(struct snd_soc_component *component,
314314
return 0;
315315
}
316316

317-
static int acp_pdm_dai_hw_params(struct snd_pcm_substream *substream,
318-
struct snd_pcm_hw_params *params,
319-
struct snd_soc_dai *dai)
317+
static int acp_pdm_dai_trigger(struct snd_pcm_substream *substream,
318+
int cmd, struct snd_soc_dai *dai)
320319
{
321320
struct pdm_stream_instance *rtd;
321+
int ret;
322+
bool pdm_status;
322323
unsigned int ch_mask;
323324

324325
rtd = substream->runtime->private_data;
325-
switch (params_channels(params)) {
326+
ret = 0;
327+
switch (substream->runtime->channels) {
326328
case TWO_CH:
327329
ch_mask = 0x00;
328330
break;
329331
default:
330332
return -EINVAL;
331333
}
332-
rn_writel(ch_mask, rtd->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS);
333-
rn_writel(PDM_DECIMATION_FACTOR, rtd->acp_base +
334-
ACP_WOV_PDM_DECIMATION_FACTOR);
335-
return 0;
336-
}
337-
338-
static int acp_pdm_dai_trigger(struct snd_pcm_substream *substream,
339-
int cmd, struct snd_soc_dai *dai)
340-
{
341-
struct pdm_stream_instance *rtd;
342-
int ret;
343-
bool pdm_status;
344-
345-
rtd = substream->runtime->private_data;
346-
ret = 0;
347334
switch (cmd) {
348335
case SNDRV_PCM_TRIGGER_START:
349336
case SNDRV_PCM_TRIGGER_RESUME:
350337
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
338+
rn_writel(ch_mask, rtd->acp_base + ACP_WOV_PDM_NO_OF_CHANNELS);
339+
rn_writel(PDM_DECIMATION_FACTOR, rtd->acp_base +
340+
ACP_WOV_PDM_DECIMATION_FACTOR);
351341
rtd->bytescount = acp_pdm_get_byte_count(rtd,
352342
substream->stream);
353343
pdm_status = check_pdm_dma_status(rtd->acp_base);
@@ -369,7 +359,6 @@ static int acp_pdm_dai_trigger(struct snd_pcm_substream *substream,
369359
}
370360

371361
static struct snd_soc_dai_ops acp_pdm_dai_ops = {
372-
.hw_params = acp_pdm_dai_hw_params,
373362
.trigger = acp_pdm_dai_trigger,
374363
};
375364

sound/soc/codecs/msm8916-wcd-analog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
#define CDC_D_REVISION1 (0xf000)
2121
#define CDC_D_PERPH_SUBTYPE (0xf005)
22-
#define CDC_D_INT_EN_SET (0x015)
23-
#define CDC_D_INT_EN_CLR (0x016)
22+
#define CDC_D_INT_EN_SET (0xf015)
23+
#define CDC_D_INT_EN_CLR (0xf016)
2424
#define MBHC_SWITCH_INT BIT(7)
2525
#define MBHC_MIC_ELECTRICAL_INS_REM_DET BIT(6)
2626
#define MBHC_BUTTON_PRESS_DET BIT(5)

sound/soc/codecs/wm8958-dsp2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,12 @@ int wm8958_aif_ev(struct snd_soc_dapm_widget *w,
412412
struct snd_kcontrol *kcontrol, int event)
413413
{
414414
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
415+
struct wm8994 *control = dev_get_drvdata(component->dev->parent);
415416
int i;
416417

418+
if (control->type != WM8958)
419+
return 0;
420+
417421
switch (event) {
418422
case SND_SOC_DAPM_POST_PMU:
419423
case SND_SOC_DAPM_PRE_PMU:

sound/soc/codecs/wm8962.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ static const struct reg_default wm8962_reg[] = {
151151
{ 40, 0x0000 }, /* R40 - SPKOUTL volume */
152152
{ 41, 0x0000 }, /* R41 - SPKOUTR volume */
153153

154-
{ 48, 0x0000 }, /* R48 - Additional control(4) */
155154
{ 49, 0x0010 }, /* R49 - Class D Control 1 */
156155
{ 51, 0x0003 }, /* R51 - Class D Control 2 */
157156

@@ -842,6 +841,7 @@ static bool wm8962_readable_register(struct device *dev, unsigned int reg)
842841
case WM8962_SPKOUTL_VOLUME:
843842
case WM8962_SPKOUTR_VOLUME:
844843
case WM8962_THERMAL_SHUTDOWN_STATUS:
844+
case WM8962_ADDITIONAL_CONTROL_4:
845845
case WM8962_CLASS_D_CONTROL_1:
846846
case WM8962_CLASS_D_CONTROL_2:
847847
case WM8962_CLOCKING_4:

sound/soc/codecs/wm8994.c

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343
#define WM8994_NUM_DRC 3
4444
#define WM8994_NUM_EQ 3
4545

46-
static struct {
46+
struct wm8994_reg_mask {
4747
unsigned int reg;
4848
unsigned int mask;
49-
} wm8994_vu_bits[] = {
49+
};
50+
51+
static struct wm8994_reg_mask wm8994_vu_bits[] = {
5052
{ WM8994_LEFT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU },
5153
{ WM8994_RIGHT_LINE_INPUT_1_2_VOLUME, WM8994_IN1_VU },
5254
{ WM8994_LEFT_LINE_INPUT_3_4_VOLUME, WM8994_IN2_VU },
@@ -60,14 +62,10 @@ static struct {
6062

6163
{ WM8994_AIF1_DAC1_LEFT_VOLUME, WM8994_AIF1DAC1_VU },
6264
{ WM8994_AIF1_DAC1_RIGHT_VOLUME, WM8994_AIF1DAC1_VU },
63-
{ WM8994_AIF1_DAC2_LEFT_VOLUME, WM8994_AIF1DAC2_VU },
64-
{ WM8994_AIF1_DAC2_RIGHT_VOLUME, WM8994_AIF1DAC2_VU },
6565
{ WM8994_AIF2_DAC_LEFT_VOLUME, WM8994_AIF2DAC_VU },
6666
{ WM8994_AIF2_DAC_RIGHT_VOLUME, WM8994_AIF2DAC_VU },
6767
{ WM8994_AIF1_ADC1_LEFT_VOLUME, WM8994_AIF1ADC1_VU },
6868
{ WM8994_AIF1_ADC1_RIGHT_VOLUME, WM8994_AIF1ADC1_VU },
69-
{ WM8994_AIF1_ADC2_LEFT_VOLUME, WM8994_AIF1ADC2_VU },
70-
{ WM8994_AIF1_ADC2_RIGHT_VOLUME, WM8994_AIF1ADC2_VU },
7169
{ WM8994_AIF2_ADC_LEFT_VOLUME, WM8994_AIF2ADC_VU },
7270
{ WM8994_AIF2_ADC_RIGHT_VOLUME, WM8994_AIF1ADC2_VU },
7371
{ WM8994_DAC1_LEFT_VOLUME, WM8994_DAC1_VU },
@@ -76,6 +74,14 @@ static struct {
7674
{ WM8994_DAC2_RIGHT_VOLUME, WM8994_DAC2_VU },
7775
};
7876

77+
/* VU bitfields for ADC2, DAC2 not available on WM1811 */
78+
static struct wm8994_reg_mask wm8994_adc2_dac2_vu_bits[] = {
79+
{ WM8994_AIF1_DAC2_LEFT_VOLUME, WM8994_AIF1DAC2_VU },
80+
{ WM8994_AIF1_DAC2_RIGHT_VOLUME, WM8994_AIF1DAC2_VU },
81+
{ WM8994_AIF1_ADC2_LEFT_VOLUME, WM8994_AIF1ADC2_VU },
82+
{ WM8994_AIF1_ADC2_RIGHT_VOLUME, WM8994_AIF1ADC2_VU },
83+
};
84+
7985
static int wm8994_drc_base[] = {
8086
WM8994_AIF1_DRC1_1,
8187
WM8994_AIF1_DRC2_1,
@@ -1030,6 +1036,26 @@ static bool wm8994_check_class_w_digital(struct snd_soc_component *component)
10301036
return true;
10311037
}
10321038

1039+
static void wm8994_update_vu_bits(struct snd_soc_component *component)
1040+
{
1041+
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1042+
struct wm8994 *control = wm8994->wm8994;
1043+
int i;
1044+
1045+
for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
1046+
snd_soc_component_write(component, wm8994_vu_bits[i].reg,
1047+
snd_soc_component_read(component,
1048+
wm8994_vu_bits[i].reg));
1049+
if (control->type == WM1811)
1050+
return;
1051+
1052+
for (i = 0; i < ARRAY_SIZE(wm8994_adc2_dac2_vu_bits); i++)
1053+
snd_soc_component_write(component,
1054+
wm8994_adc2_dac2_vu_bits[i].reg,
1055+
snd_soc_component_read(component,
1056+
wm8994_adc2_dac2_vu_bits[i].reg));
1057+
}
1058+
10331059
static int aif_mclk_set(struct snd_soc_component *component, int aif, bool enable)
10341060
{
10351061
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
@@ -1076,7 +1102,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w,
10761102
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
10771103
struct wm8994 *control = wm8994->wm8994;
10781104
int mask = WM8994_AIF1DAC1L_ENA | WM8994_AIF1DAC1R_ENA;
1079-
int ret, i;
1105+
int ret;
10801106
int dac;
10811107
int adc;
10821108
int val;
@@ -1144,10 +1170,7 @@ static int aif1clk_ev(struct snd_soc_dapm_widget *w,
11441170
break;
11451171

11461172
case SND_SOC_DAPM_POST_PMU:
1147-
for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
1148-
snd_soc_component_write(component, wm8994_vu_bits[i].reg,
1149-
snd_soc_component_read(component,
1150-
wm8994_vu_bits[i].reg));
1173+
wm8994_update_vu_bits(component);
11511174
break;
11521175

11531176
case SND_SOC_DAPM_PRE_PMD:
@@ -1181,7 +1204,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w,
11811204
struct snd_kcontrol *kcontrol, int event)
11821205
{
11831206
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
1184-
int ret, i;
1207+
int ret;
11851208
int dac;
11861209
int adc;
11871210
int val;
@@ -1237,10 +1260,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w,
12371260
break;
12381261

12391262
case SND_SOC_DAPM_POST_PMU:
1240-
for (i = 0; i < ARRAY_SIZE(wm8994_vu_bits); i++)
1241-
snd_soc_component_write(component, wm8994_vu_bits[i].reg,
1242-
snd_soc_component_read(component,
1243-
wm8994_vu_bits[i].reg));
1263+
wm8994_update_vu_bits(component);
12441264
break;
12451265

12461266
case SND_SOC_DAPM_PRE_PMD:
@@ -4346,6 +4366,14 @@ static int wm8994_component_probe(struct snd_soc_component *component)
43464366
wm8994_vu_bits[i].mask,
43474367
wm8994_vu_bits[i].mask);
43484368

4369+
if (control->type != WM1811) {
4370+
for (i = 0; i < ARRAY_SIZE(wm8994_adc2_dac2_vu_bits); i++)
4371+
snd_soc_component_update_bits(component,
4372+
wm8994_adc2_dac2_vu_bits[i].reg,
4373+
wm8994_adc2_dac2_vu_bits[i].mask,
4374+
wm8994_adc2_dac2_vu_bits[i].mask);
4375+
}
4376+
43494377
/* Set the low bit of the 3D stereo depth so TLV matches */
43504378
snd_soc_component_update_bits(component, WM8994_AIF1_DAC1_FILTERS_2,
43514379
1 << WM8994_AIF1DAC1_3D_GAIN_SHIFT,

0 commit comments

Comments
 (0)