Skip to content

Commit 63e1968

Browse files
committed
Merge tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "A collection of small, mostly device-specific fixes. The significant one is the regression fix for USB-audio implicit feedback devices due to the incorrect frame size calculation, which landed in 5.8 and stable trees. In addition, a few usual HD-audio and USB-audio quirks, Intel HDMI fixes, ASoC fsl and rt5682 fixes, as well as the fix in compress-offload partial drain operation" * tag 'sound-5.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: compress: fix partial_drain completion state ALSA: usb-audio: Add implicit feedback quirk for RTX6001 ALSA: usb-audio: add quirk for MacroSilicon MS2109 ALSA: hda/realtek: Enable headset mic of Acer Veriton N4660G with ALC269VC ALSA: hda/realtek: Enable headset mic of Acer C20-820 with ALC269VC ALSA: hda/realtek - Enable audio jacks of Acer vCopperbox with ALC269VC ALSA: hda/realtek - Fix Lenovo Thinkpad X1 Carbon 7th quirk subdevice id ALSA: hda/hdmi: improve debug traces for stream lookups ALSA: hda/hdmi: fix failures at PCM open on Intel ICL and later ALSA: opl3: fix infoleak in opl3 ALSA: usb-audio: Replace s/frame/packet/ where appropriate ALSA: usb-audio: Fix packet size calculation AsoC: amd: add missing snd- module prefix to the acp3x-rn driver kernel module ALSA: hda - let hs_mic be picked ahead of hp_mic ASoC: rt5682: fix the pop noise while OMTP type headset plugin ASoC: fsl_mqs: Fix unchecked return value for clk_prepare_enable ASoC: fsl_mqs: Don't check clock is NULL before calling clk API
2 parents 6ec4476 + f79a732 commit 63e1968

File tree

13 files changed

+174
-43
lines changed

13 files changed

+174
-43
lines changed

include/sound/compress_driver.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct snd_compr_runtime {
6666
* @direction: stream direction, playback/recording
6767
* @metadata_set: metadata set flag, true when set
6868
* @next_track: has userspace signal next track transition, true when set
69+
* @partial_drain: undergoing partial_drain for stream, true when set
6970
* @private_data: pointer to DSP private data
7071
* @dma_buffer: allocated buffer if any
7172
*/
@@ -78,6 +79,7 @@ struct snd_compr_stream {
7879
enum snd_compr_direction direction;
7980
bool metadata_set;
8081
bool next_track;
82+
bool partial_drain;
8183
void *private_data;
8284
struct snd_dma_buffer dma_buffer;
8385
};
@@ -182,7 +184,13 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
182184
if (snd_BUG_ON(!stream))
183185
return;
184186

185-
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
187+
/* for partial_drain case we are back to running state on success */
188+
if (stream->partial_drain) {
189+
stream->runtime->state = SNDRV_PCM_STATE_RUNNING;
190+
stream->partial_drain = false; /* clear this flag as well */
191+
} else {
192+
stream->runtime->state = SNDRV_PCM_STATE_SETUP;
193+
}
186194

187195
wake_up(&stream->runtime->sleep);
188196
}

sound/core/compress_offload.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,9 @@ static int snd_compr_stop(struct snd_compr_stream *stream)
764764

765765
retval = stream->ops->trigger(stream, SNDRV_PCM_TRIGGER_STOP);
766766
if (!retval) {
767+
/* clear flags and stop any drain wait */
768+
stream->partial_drain = false;
769+
stream->metadata_set = false;
767770
snd_compr_drain_notify(stream);
768771
stream->runtime->total_bytes_available = 0;
769772
stream->runtime->total_bytes_transferred = 0;
@@ -921,6 +924,7 @@ static int snd_compr_partial_drain(struct snd_compr_stream *stream)
921924
if (stream->next_track == false)
922925
return -EPERM;
923926

927+
stream->partial_drain = true;
924928
retval = stream->ops->trigger(stream, SND_COMPR_TRIGGER_PARTIAL_DRAIN);
925929
if (retval) {
926930
pr_debug("Partial drain returned failure\n");

sound/drivers/opl3/opl3_synth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
9191
{
9292
struct snd_dm_fm_info info;
9393

94+
memset(&info, 0, sizeof(info));
95+
9496
info.fm_mode = opl3->fm_mode;
9597
info.rhythm = opl3->rhythm;
9698
if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info)))

sound/pci/hda/hda_auto_parser.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ static int compare_input_type(const void *ap, const void *bp)
7272
if (a->type != b->type)
7373
return (int)(a->type - b->type);
7474

75+
/* If has both hs_mic and hp_mic, pick the hs_mic ahead of hp_mic. */
76+
if (a->is_headset_mic && b->is_headphone_mic)
77+
return -1; /* don't swap */
78+
else if (a->is_headphone_mic && b->is_headset_mic)
79+
return 1; /* swap */
80+
7581
/* In case one has boost and the other one has not,
7682
pick the one with boost first. */
7783
return (int)(b->has_boost_on_pin - a->has_boost_on_pin);

sound/pci/hda/patch_hdmi.c

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static int hinfo_to_pcm_index(struct hda_codec *codec,
259259
if (get_pcm_rec(spec, pcm_idx)->stream == hinfo)
260260
return pcm_idx;
261261

262-
codec_warn(codec, "HDMI: hinfo %p not registered\n", hinfo);
262+
codec_warn(codec, "HDMI: hinfo %p not tied to a PCM\n", hinfo);
263263
return -EINVAL;
264264
}
265265

@@ -277,7 +277,8 @@ static int hinfo_to_pin_index(struct hda_codec *codec,
277277
return pin_idx;
278278
}
279279

280-
codec_dbg(codec, "HDMI: hinfo %p not registered\n", hinfo);
280+
codec_dbg(codec, "HDMI: hinfo %p (pcm %d) not registered\n", hinfo,
281+
hinfo_to_pcm_index(codec, hinfo));
281282
return -EINVAL;
282283
}
283284

@@ -1804,33 +1805,43 @@ static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
18041805

18051806
static int hdmi_parse_codec(struct hda_codec *codec)
18061807
{
1807-
hda_nid_t nid;
1808+
hda_nid_t start_nid;
1809+
unsigned int caps;
18081810
int i, nodes;
18091811

1810-
nodes = snd_hda_get_sub_nodes(codec, codec->core.afg, &nid);
1811-
if (!nid || nodes < 0) {
1812+
nodes = snd_hda_get_sub_nodes(codec, codec->core.afg, &start_nid);
1813+
if (!start_nid || nodes < 0) {
18121814
codec_warn(codec, "HDMI: failed to get afg sub nodes\n");
18131815
return -EINVAL;
18141816
}
18151817

1816-
for (i = 0; i < nodes; i++, nid++) {
1817-
unsigned int caps;
1818-
unsigned int type;
1818+
/*
1819+
* hdmi_add_pin() assumes total amount of converters to
1820+
* be known, so first discover all converters
1821+
*/
1822+
for (i = 0; i < nodes; i++) {
1823+
hda_nid_t nid = start_nid + i;
18191824

18201825
caps = get_wcaps(codec, nid);
1821-
type = get_wcaps_type(caps);
18221826

18231827
if (!(caps & AC_WCAP_DIGITAL))
18241828
continue;
18251829

1826-
switch (type) {
1827-
case AC_WID_AUD_OUT:
1830+
if (get_wcaps_type(caps) == AC_WID_AUD_OUT)
18281831
hdmi_add_cvt(codec, nid);
1829-
break;
1830-
case AC_WID_PIN:
1832+
}
1833+
1834+
/* discover audio pins */
1835+
for (i = 0; i < nodes; i++) {
1836+
hda_nid_t nid = start_nid + i;
1837+
1838+
caps = get_wcaps(codec, nid);
1839+
1840+
if (!(caps & AC_WCAP_DIGITAL))
1841+
continue;
1842+
1843+
if (get_wcaps_type(caps) == AC_WID_PIN)
18311844
hdmi_add_pin(codec, nid);
1832-
break;
1833-
}
18341845
}
18351846

18361847
return 0;

sound/pci/hda/patch_realtek.c

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6149,6 +6149,9 @@ enum {
61496149
ALC236_FIXUP_HP_MUTE_LED,
61506150
ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
61516151
ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
6152+
ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
6153+
ALC269VC_FIXUP_ACER_HEADSET_MIC,
6154+
ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
61526155
};
61536156

61546157
static const struct hda_fixup alc269_fixups[] = {
@@ -7327,6 +7330,35 @@ static const struct hda_fixup alc269_fixups[] = {
73277330
.chained = true,
73287331
.chain_id = ALC269_FIXUP_HEADSET_MODE
73297332
},
7333+
[ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS] = {
7334+
.type = HDA_FIXUP_PINS,
7335+
.v.pins = (const struct hda_pintbl[]) {
7336+
{ 0x14, 0x90100120 }, /* use as internal speaker */
7337+
{ 0x18, 0x02a111f0 }, /* use as headset mic, without its own jack detect */
7338+
{ 0x1a, 0x01011020 }, /* use as line out */
7339+
{ },
7340+
},
7341+
.chained = true,
7342+
.chain_id = ALC269_FIXUP_HEADSET_MIC
7343+
},
7344+
[ALC269VC_FIXUP_ACER_HEADSET_MIC] = {
7345+
.type = HDA_FIXUP_PINS,
7346+
.v.pins = (const struct hda_pintbl[]) {
7347+
{ 0x18, 0x02a11030 }, /* use as headset mic */
7348+
{ }
7349+
},
7350+
.chained = true,
7351+
.chain_id = ALC269_FIXUP_HEADSET_MIC
7352+
},
7353+
[ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE] = {
7354+
.type = HDA_FIXUP_PINS,
7355+
.v.pins = (const struct hda_pintbl[]) {
7356+
{ 0x18, 0x01a11130 }, /* use as headset mic, without its own jack detect */
7357+
{ }
7358+
},
7359+
.chained = true,
7360+
.chain_id = ALC269_FIXUP_HEADSET_MIC
7361+
},
73307362
};
73317363

73327364
static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7342,10 +7374,13 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
73427374
SND_PCI_QUIRK(0x1025, 0x0775, "Acer Aspire E1-572", ALC271_FIXUP_HP_GATE_MIC_JACK_E1_572),
73437375
SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
73447376
SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
7377+
SND_PCI_QUIRK(0x1025, 0x1065, "Acer Aspire C20-820", ALC269VC_FIXUP_ACER_HEADSET_MIC),
73457378
SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK),
73467379
SND_PCI_QUIRK(0x1025, 0x1099, "Acer Aspire E5-523G", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
73477380
SND_PCI_QUIRK(0x1025, 0x110e, "Acer Aspire ES1-432", ALC255_FIXUP_ACER_MIC_NO_PRESENCE),
73487381
SND_PCI_QUIRK(0x1025, 0x1246, "Acer Predator Helios 500", ALC299_FIXUP_PREDATOR_SPK),
7382+
SND_PCI_QUIRK(0x1025, 0x1247, "Acer vCopperbox", ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS),
7383+
SND_PCI_QUIRK(0x1025, 0x1248, "Acer Veriton N4660G", ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE),
73497384
SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
73507385
SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
73517386
SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_HEADSET_MIC),
@@ -7571,8 +7606,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
75717606
SND_PCI_QUIRK(0x17aa, 0x224c, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
75727607
SND_PCI_QUIRK(0x17aa, 0x224d, "Thinkpad", ALC298_FIXUP_TPT470_DOCK),
75737608
SND_PCI_QUIRK(0x17aa, 0x225d, "Thinkpad T480", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
7574-
SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Yoga 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7575-
SND_PCI_QUIRK(0x17aa, 0x2293, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
7609+
SND_PCI_QUIRK(0x17aa, 0x2292, "Thinkpad X1 Carbon 7th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
75767610
SND_PCI_QUIRK(0x17aa, 0x22be, "Thinkpad X1 Carbon 8th", ALC285_FIXUP_THINKPAD_HEADSET_JACK),
75777611
SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
75787612
SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),

sound/soc/amd/renoir/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Renoir platform Support
33
snd-rn-pci-acp3x-objs := rn-pci-acp3x.o
44
snd-acp3x-pdm-dma-objs := acp3x-pdm-dma.o
5-
obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-rn-pci-acp3x.o
6-
obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-acp3x-pdm-dma.o
7-
obj-$(CONFIG_SND_SOC_AMD_RENOIR_MACH) += acp3x-rn.o
5+
snd-acp3x-rn-objs := acp3x-rn.o
6+
obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-rn-pci-acp3x.o
7+
obj-$(CONFIG_SND_SOC_AMD_RENOIR) += snd-acp3x-pdm-dma.o
8+
obj-$(CONFIG_SND_SOC_AMD_RENOIR_MACH) += snd-acp3x-rn.o

sound/soc/codecs/rt5682.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,9 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
932932
RT5682_PWR_ANLG_1, RT5682_PWR_FV2, RT5682_PWR_FV2);
933933
snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3,
934934
RT5682_PWR_CBJ, RT5682_PWR_CBJ);
935-
935+
snd_soc_component_update_bits(component,
936+
RT5682_HP_CHARGE_PUMP_1,
937+
RT5682_OSW_L_MASK | RT5682_OSW_R_MASK, 0);
936938
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,
937939
RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_HIGH);
938940

@@ -956,6 +958,11 @@ int rt5682_headset_detect(struct snd_soc_component *component, int jack_insert)
956958
rt5682->jack_type = SND_JACK_HEADPHONE;
957959
break;
958960
}
961+
962+
snd_soc_component_update_bits(component,
963+
RT5682_HP_CHARGE_PUMP_1,
964+
RT5682_OSW_L_MASK | RT5682_OSW_R_MASK,
965+
RT5682_OSW_L_EN | RT5682_OSW_R_EN);
959966
} else {
960967
rt5682_enable_push_button_irq(component, false);
961968
snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1,

sound/soc/fsl/fsl_mqs.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,20 @@ static int fsl_mqs_remove(struct platform_device *pdev)
265265
static int fsl_mqs_runtime_resume(struct device *dev)
266266
{
267267
struct fsl_mqs *mqs_priv = dev_get_drvdata(dev);
268+
int ret;
268269

269-
if (mqs_priv->ipg)
270-
clk_prepare_enable(mqs_priv->ipg);
270+
ret = clk_prepare_enable(mqs_priv->ipg);
271+
if (ret) {
272+
dev_err(dev, "failed to enable ipg clock\n");
273+
return ret;
274+
}
271275

272-
if (mqs_priv->mclk)
273-
clk_prepare_enable(mqs_priv->mclk);
276+
ret = clk_prepare_enable(mqs_priv->mclk);
277+
if (ret) {
278+
dev_err(dev, "failed to enable mclk clock\n");
279+
clk_disable_unprepare(mqs_priv->ipg);
280+
return ret;
281+
}
274282

275283
if (mqs_priv->use_gpr)
276284
regmap_write(mqs_priv->regmap, IOMUXC_GPR2,
@@ -292,11 +300,8 @@ static int fsl_mqs_runtime_suspend(struct device *dev)
292300
regmap_read(mqs_priv->regmap, REG_MQS_CTRL,
293301
&mqs_priv->reg_mqs_ctrl);
294302

295-
if (mqs_priv->mclk)
296-
clk_disable_unprepare(mqs_priv->mclk);
297-
298-
if (mqs_priv->ipg)
299-
clk_disable_unprepare(mqs_priv->ipg);
303+
clk_disable_unprepare(mqs_priv->mclk);
304+
clk_disable_unprepare(mqs_priv->ipg);
300305

301306
return 0;
302307
}

sound/usb/card.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ struct snd_usb_endpoint {
8484
dma_addr_t sync_dma; /* DMA address of syncbuf */
8585

8686
unsigned int pipe; /* the data i/o pipe */
87-
unsigned int framesize[2]; /* small/large frame sizes in samples */
88-
unsigned int sample_rem; /* remainder from division fs/fps */
87+
unsigned int packsize[2]; /* small/large packet sizes in samples */
88+
unsigned int sample_rem; /* remainder from division fs/pps */
8989
unsigned int sample_accum; /* sample accumulator */
90-
unsigned int fps; /* frames per second */
90+
unsigned int pps; /* packets per second */
9191
unsigned int freqn; /* nominal sampling rate in fs/fps in Q16.16 format */
9292
unsigned int freqm; /* momentary sampling rate in fs/fps in Q16.16 format */
9393
int freqshift; /* how much to shift the feedback value to get Q16.16 */

0 commit comments

Comments
 (0)