Skip to content

Commit 996a18e

Browse files
committed
Merge tag 'sound-5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Quite a few small fixes, hopefully the last batch for 5.16. Most of them are device-specific quirks and/or fixes, and nothing looks scary for the late stage" * tag 'sound-5.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek: Fix quirk for Clevo NJ51CU ALSA: rawmidi - fix the uninitalized user_pversion ALSA: hda: intel-sdw-acpi: go through HDAS ACPI at max depth of 2 ALSA: hda: intel-sdw-acpi: harden detection of controller ALSA: hda/hdmi: Disable silent stream on GLK ALSA: hda/realtek: fix mute/micmute LEDs for a HP ProBook ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent() ASoC: tas2770: Fix setting of high sample rates ASoC: rt5682: fix the wrong jack type detected ALSA: hda/realtek: Add new alc285-hp-amp-init model ALSA: hda/realtek: Amp init fixup for HP ZBook 15 G6 ASoC: tegra: Restore headphones jack name on Nyan Big ASoC: tegra: Add DAPM switches for headphones and mic jack ALSA: jack: Check the return value of kstrdup() ALSA: drivers: opl3: Fix incorrect use of vp->state ASoC: SOF: Intel: pci-tgl: add new ADL-P variant ASoC: SOF: Intel: pci-tgl: add ADL-N support
2 parents 3bf6f01 + edca7cc commit 996a18e

15 files changed

Lines changed: 107 additions & 47 deletions

File tree

Documentation/sound/hd-audio/models.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ usi-headset
326326
Headset support on USI machines
327327
dual-codecs
328328
Lenovo laptops with dual codecs
329+
alc285-hp-amp-init
330+
HP laptops which require speaker amplifier initialization (ALC285)
329331

330332
ALC680
331333
======

sound/core/jack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
509509
return -ENOMEM;
510510

511511
jack->id = kstrdup(id, GFP_KERNEL);
512+
if (jack->id == NULL) {
513+
kfree(jack);
514+
return -ENOMEM;
515+
}
512516

513517
/* don't creat input device for phantom jack */
514518
if (!phantom_jack) {

sound/core/rawmidi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file)
447447
err = -ENOMEM;
448448
goto __error;
449449
}
450+
rawmidi_file->user_pversion = 0;
450451
init_waitqueue_entry(&wait, current);
451452
add_wait_queue(&rmidi->open_wait, &wait);
452453
while (1) {

sound/drivers/opl3/opl3_midi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
397397
}
398398
if (instr_4op) {
399399
vp2 = &opl3->voices[voice + 3];
400-
if (vp->state > 0) {
400+
if (vp2->state > 0) {
401401
opl3_reg = reg_side | (OPL3_REG_KEYON_BLOCK +
402402
voice_offset + 3);
403403
reg_val = vp->keyon_reg & ~OPL3_KEYON_BIT;

sound/hda/intel-sdw-acpi.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
132132
return AE_NOT_FOUND;
133133
}
134134

135-
info->handle = handle;
136-
137135
/*
138136
* On some Intel platforms, multiple children of the HDAS
139137
* device can be found, but only one of them is the SoundWire
@@ -144,6 +142,9 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
144142
if (FIELD_GET(GENMASK(31, 28), adr) != SDW_LINK_TYPE)
145143
return AE_OK; /* keep going */
146144

145+
/* found the correct SoundWire controller */
146+
info->handle = handle;
147+
147148
/* device found, stop namespace walk */
148149
return AE_CTRL_TERMINATE;
149150
}
@@ -164,8 +165,14 @@ int sdw_intel_acpi_scan(acpi_handle *parent_handle,
164165
acpi_status status;
165166

166167
info->handle = NULL;
168+
/*
169+
* In the HDAS ACPI scope, 'SNDW' may be either the child of
170+
* 'HDAS' or the grandchild of 'HDAS'. So let's go through
171+
* the ACPI from 'HDAS' at max depth of 2 to find the 'SNDW'
172+
* device.
173+
*/
167174
status = acpi_walk_namespace(ACPI_TYPE_DEVICE,
168-
parent_handle, 1,
175+
parent_handle, 2,
169176
sdw_intel_acpi_cb,
170177
NULL, info, NULL);
171178
if (ACPI_FAILURE(status) || info->handle == NULL)

sound/pci/hda/patch_hdmi.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,8 @@ static int parse_intel_hdmi(struct hda_codec *codec)
29472947

29482948
/* Intel Haswell and onwards; audio component with eld notifier */
29492949
static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid,
2950-
const int *port_map, int port_num, int dev_num)
2950+
const int *port_map, int port_num, int dev_num,
2951+
bool send_silent_stream)
29512952
{
29522953
struct hdmi_spec *spec;
29532954
int err;
@@ -2980,20 +2981,26 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid,
29802981
* Enable silent stream feature, if it is enabled via
29812982
* module param or Kconfig option
29822983
*/
2983-
if (enable_silent_stream)
2984+
if (send_silent_stream)
29842985
spec->send_silent_stream = true;
29852986

29862987
return parse_intel_hdmi(codec);
29872988
}
29882989

29892990
static int patch_i915_hsw_hdmi(struct hda_codec *codec)
29902991
{
2991-
return intel_hsw_common_init(codec, 0x08, NULL, 0, 3);
2992+
return intel_hsw_common_init(codec, 0x08, NULL, 0, 3,
2993+
enable_silent_stream);
29922994
}
29932995

29942996
static int patch_i915_glk_hdmi(struct hda_codec *codec)
29952997
{
2996-
return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3);
2998+
/*
2999+
* Silent stream calls audio component .get_power() from
3000+
* .pin_eld_notify(). On GLK this will deadlock in i915 due
3001+
* to the audio vs. CDCLK workaround.
3002+
*/
3003+
return intel_hsw_common_init(codec, 0x0b, NULL, 0, 3, false);
29973004
}
29983005

29993006
static int patch_i915_icl_hdmi(struct hda_codec *codec)
@@ -3004,7 +3011,8 @@ static int patch_i915_icl_hdmi(struct hda_codec *codec)
30043011
*/
30053012
static const int map[] = {0x0, 0x4, 0x6, 0x8, 0xa, 0xb};
30063013

3007-
return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3);
3014+
return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 3,
3015+
enable_silent_stream);
30083016
}
30093017

30103018
static int patch_i915_tgl_hdmi(struct hda_codec *codec)
@@ -3016,7 +3024,8 @@ static int patch_i915_tgl_hdmi(struct hda_codec *codec)
30163024
static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
30173025
int ret;
30183026

3019-
ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4);
3027+
ret = intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map), 4,
3028+
enable_silent_stream);
30203029
if (!ret) {
30213030
struct hdmi_spec *spec = codec->spec;
30223031

sound/pci/hda/patch_realtek.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6546,6 +6546,23 @@ static void alc233_fixup_no_audio_jack(struct hda_codec *codec,
65466546
alc_process_coef_fw(codec, alc233_fixup_no_audio_jack_coefs);
65476547
}
65486548

6549+
static void alc256_fixup_mic_no_presence_and_resume(struct hda_codec *codec,
6550+
const struct hda_fixup *fix,
6551+
int action)
6552+
{
6553+
/*
6554+
* The Clevo NJ51CU comes either with the ALC293 or the ALC256 codec,
6555+
* but uses the 0x8686 subproduct id in both cases. The ALC256 codec
6556+
* needs an additional quirk for sound working after suspend and resume.
6557+
*/
6558+
if (codec->core.vendor_id == 0x10ec0256) {
6559+
alc_update_coef_idx(codec, 0x10, 1<<9, 0);
6560+
snd_hda_codec_set_pincfg(codec, 0x19, 0x04a11120);
6561+
} else {
6562+
snd_hda_codec_set_pincfg(codec, 0x1a, 0x04a1113c);
6563+
}
6564+
}
6565+
65496566
enum {
65506567
ALC269_FIXUP_GPIO2,
65516568
ALC269_FIXUP_SONY_VAIO,
@@ -6766,6 +6783,7 @@ enum {
67666783
ALC256_FIXUP_SET_COEF_DEFAULTS,
67676784
ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
67686785
ALC233_FIXUP_NO_AUDIO_JACK,
6786+
ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME,
67696787
};
67706788

67716789
static const struct hda_fixup alc269_fixups[] = {
@@ -8490,6 +8508,12 @@ static const struct hda_fixup alc269_fixups[] = {
84908508
.type = HDA_FIXUP_FUNC,
84918509
.v.func = alc233_fixup_no_audio_jack,
84928510
},
8511+
[ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME] = {
8512+
.type = HDA_FIXUP_FUNC,
8513+
.v.func = alc256_fixup_mic_no_presence_and_resume,
8514+
.chained = true,
8515+
.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
8516+
},
84938517
};
84948518

84958519
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -8660,6 +8684,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
86608684
SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN),
86618685
SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
86628686
SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360),
8687+
SND_PCI_QUIRK(0x103c, 0x860f, "HP ZBook 15 G6", ALC285_FIXUP_HP_GPIO_AMP_INIT),
86638688
SND_PCI_QUIRK(0x103c, 0x861f, "HP Elite Dragonfly G1", ALC285_FIXUP_HP_GPIO_AMP_INIT),
86648689
SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
86658690
SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO),
@@ -8705,6 +8730,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
87058730
SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED),
87068731
SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
87078732
SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
8733+
SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
87088734
SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
87098735
SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
87108736
SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -8829,7 +8855,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
88298855
SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC),
88308856
SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88318857
SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8832-
SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
8858+
SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME),
88338859
SND_PCI_QUIRK(0x1558, 0x8a20, "Clevo NH55DCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88348860
SND_PCI_QUIRK(0x1558, 0x8a51, "Clevo NH70RCQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
88358861
SND_PCI_QUIRK(0x1558, 0x8d50, "Clevo NH55RCQ-M", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -9123,6 +9149,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
91239149
{.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"},
91249150
{.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"},
91259151
{.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"},
9152+
{.id = ALC285_FIXUP_HP_GPIO_AMP_INIT, .name = "alc285-hp-amp-init"},
91269153
{}
91279154
};
91289155
#define ALC225_STANDARD_PINS \

sound/soc/codecs/rt5682.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
929929
unsigned int val, count;
930930

931931
if (jack_insert) {
932+
snd_soc_dapm_mutex_lock(dapm);
933+
932934
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1,
933935
RT5682_PWR_VREF2 | RT5682_PWR_MB,
934936
RT5682_PWR_VREF2 | RT5682_PWR_MB);
@@ -979,6 +981,8 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
979981
snd_soc_component_update_bits(component, RT5682_MICBIAS_2,
980982
RT5682_PWR_CLK25M_MASK | RT5682_PWR_CLK1M_MASK,
981983
RT5682_PWR_CLK25M_PU | RT5682_PWR_CLK1M_PU);
984+
985+
snd_soc_dapm_mutex_unlock(dapm);
982986
} else {
983987
rt5682_enable_push_button_irq(component, false);
984988
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,

sound/soc/codecs/tas2770.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ static int tas2770_set_samplerate(struct tas2770_priv *tas2770, int samplerate)
291291
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ |
292292
TAS2770_TDM_CFG_REG0_31_88_2_96KHZ;
293293
break;
294-
case 19200:
294+
case 192000:
295295
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_48KHZ |
296296
TAS2770_TDM_CFG_REG0_31_176_4_192KHZ;
297297
break;
298-
case 17640:
298+
case 176400:
299299
ramp_rate_val = TAS2770_TDM_CFG_REG0_SMP_44_1KHZ |
300300
TAS2770_TDM_CFG_REG0_31_176_4_192KHZ;
301301
break;

sound/soc/meson/aiu-encoder-i2s.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#define AIU_RST_SOFT_I2S_FAST BIT(0)
1919

2020
#define AIU_I2S_DAC_CFG_MSB_FIRST BIT(2)
21-
#define AIU_I2S_MISC_HOLD_EN BIT(2)
2221
#define AIU_CLK_CTRL_I2S_DIV_EN BIT(0)
2322
#define AIU_CLK_CTRL_I2S_DIV GENMASK(3, 2)
2423
#define AIU_CLK_CTRL_AOCLK_INVERT BIT(6)
@@ -36,37 +35,6 @@ static void aiu_encoder_i2s_divider_enable(struct snd_soc_component *component,
3635
enable ? AIU_CLK_CTRL_I2S_DIV_EN : 0);
3736
}
3837

39-
static void aiu_encoder_i2s_hold(struct snd_soc_component *component,
40-
bool enable)
41-
{
42-
snd_soc_component_update_bits(component, AIU_I2S_MISC,
43-
AIU_I2S_MISC_HOLD_EN,
44-
enable ? AIU_I2S_MISC_HOLD_EN : 0);
45-
}
46-
47-
static int aiu_encoder_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
48-
struct snd_soc_dai *dai)
49-
{
50-
struct snd_soc_component *component = dai->component;
51-
52-
switch (cmd) {
53-
case SNDRV_PCM_TRIGGER_START:
54-
case SNDRV_PCM_TRIGGER_RESUME:
55-
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
56-
aiu_encoder_i2s_hold(component, false);
57-
return 0;
58-
59-
case SNDRV_PCM_TRIGGER_STOP:
60-
case SNDRV_PCM_TRIGGER_SUSPEND:
61-
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
62-
aiu_encoder_i2s_hold(component, true);
63-
return 0;
64-
65-
default:
66-
return -EINVAL;
67-
}
68-
}
69-
7038
static int aiu_encoder_i2s_setup_desc(struct snd_soc_component *component,
7139
struct snd_pcm_hw_params *params)
7240
{
@@ -353,7 +321,6 @@ static void aiu_encoder_i2s_shutdown(struct snd_pcm_substream *substream,
353321
}
354322

355323
const struct snd_soc_dai_ops aiu_encoder_i2s_dai_ops = {
356-
.trigger = aiu_encoder_i2s_trigger,
357324
.hw_params = aiu_encoder_i2s_hw_params,
358325
.hw_free = aiu_encoder_i2s_hw_free,
359326
.set_fmt = aiu_encoder_i2s_set_fmt,

0 commit comments

Comments
 (0)