Skip to content

Commit 7f04f3e

Browse files
committed
Merge tag 'sound-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small fixes over several drivers, but all are driver- specific and nothing looks scary. Slightly large changes are seen in ASoC qcom driver for the bugs that were revealed by the recent ASoC core change to report the invalid register access errors. Also ASoC fsl got a slight intensive change for the distortion fix. Others are only trivial fixes or device-specific quirks" * tag 'sound-5.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (25 commits) ALSA: hda: avoid reset of sdo_limit ALSA: hda/realtek: Add quirk for Samsung Galaxy Book Ion ALSA: usb-audio: ignore broken processing/extension unit ASoC: intel: Fix memleak in sst_media_open ASoC: wm8994: Avoid attempts to read unreadable registers ASoC: msm8916-wcd-analog: fix register Interrupt offset ASoC: wm8994: Prevent access to invalid VU register bits on WM1811 ALSA: hda/realtek: Add model alc298-samsung-headphone ALSA: usb-audio: Update documentation comment for MS2109 quirk ALSA: isa: fix spelling mistakes in the comments ALSA: usb-audio: Add capture support for Saffire 6 (USB 1.1) ALSA: hda/realtek: Add quirk for Samsung Galaxy Flex Book ASoC: q6routing: add dummy register read/write function ASoC: q6afe-dai: mark all widgets registers as SND_SOC_NOPM ASoC: Make soc_component_read() returning an error code again ASoC: amd: Replacing component->name with codec_dai->name. ASoC: fsl: Fix unused variable warning ASoC: tegra: tegra210_i2s: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_dmic: Fix compile warning with CONFIG_PM=n ASoC: tegra: tegra210_ahub: Fix compile warning with CONFIG_PM=n ...
2 parents 43d387a + b90b925 commit 7f04f3e

23 files changed

+323
-260
lines changed

sound/hda/hdac_bus.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev,
4646
INIT_LIST_HEAD(&bus->hlink_list);
4747
init_waitqueue_head(&bus->rirb_wq);
4848
bus->irq = -1;
49+
50+
/*
51+
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
52+
* Following relation is used to derive STRIPE control value.
53+
* For sample rate <= 48K:
54+
* { ((num_channels * bits_per_sample) / number of SDOs) >= 8 }
55+
* For sample rate > 48K:
56+
* { ((num_channels * bits_per_sample * rate/48000) /
57+
* number of SDOs) >= 8 }
58+
*/
59+
bus->sdo_limit = 8;
60+
4961
return 0;
5062
}
5163
EXPORT_SYMBOL_GPL(snd_hdac_bus_init);

sound/hda/hdac_controller.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,6 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
529529

530530
bus->chip_init = true;
531531

532-
/*
533-
* Default value of '8' is as per the HD audio specification (Rev 1.0a).
534-
* Following relation is used to derive STRIPE control value.
535-
* For sample rate <= 48K:
536-
* { ((num_channels * bits_per_sample) / number of SDOs) >= 8 }
537-
* For sample rate > 48K:
538-
* { ((num_channels * bits_per_sample * rate/48000) /
539-
* number of SDOs) >= 8 }
540-
*/
541-
bus->sdo_limit = 8;
542-
543532
return true;
544533
}
545534
EXPORT_SYMBOL_GPL(snd_hdac_bus_init_chip);

sound/isa/sscape.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static inline int verify_mpu401(const struct snd_mpu401 *mpu)
308308
}
309309

310310
/*
311-
* This is apparently the standard way to initailise an MPU-401
311+
* This is apparently the standard way to initialise an MPU-401
312312
*/
313313
static inline void initialise_mpu401(const struct snd_mpu401 *mpu)
314314
{
@@ -339,7 +339,7 @@ static void soundscape_free(struct snd_card *c)
339339
}
340340

341341
/*
342-
* Tell the SoundScape to begin a DMA tranfer using the given channel.
342+
* Tell the SoundScape to begin a DMA transfer using the given channel.
343343
* All locking issues are left to the caller.
344344
*/
345345
static void sscape_start_dma_unsafe(unsigned io_base, enum GA_REG reg)
@@ -803,7 +803,7 @@ static int mpu401_open(struct snd_mpu401 *mpu)
803803
}
804804

805805
/*
806-
* Initialse an MPU-401 subdevice for MIDI support on the SoundScape.
806+
* Initialise an MPU-401 subdevice for MIDI support on the SoundScape.
807807
*/
808808
static int create_mpu401(struct snd_card *card, int devnum,
809809
unsigned long port, int irq)

sound/pci/hda/patch_realtek.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7694,6 +7694,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
76947694
SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
76957695
SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
76967696
SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
7697+
SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
7698+
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
76977699
SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
76987700
SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
76997701
SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
@@ -7955,6 +7957,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
79557957
{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
79567958
{.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
79577959
{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
7960+
{.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
79587961
{}
79597962
};
79607963
#define ALC225_STANDARD_PINS \

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)