Skip to content

Commit c536419

Browse files
committed
Merge tag 'sound-5.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Just a collection of small fixes around this time: - One more try for fixing PCM OSS regression - HD-audio: a new quirk for Lenovo, the improved driver blacklisting, a lock fix in the minor error path, and a fix for the possible race at monitor notifiaction - USB-audio: a quirk ID fix, a fix for POD HD500 workaround" * tag 'sound-5.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: usb-audio: Correct a typo of NuPrime DAC-10 USB ID ALSA: opti9xx: shut up gcc-10 range warning ALSA: hda/hdmi: fix without unlocked before return ALSA: hda/hdmi: fix race in monitor detection during probe ALSA: hda/realtek - Two front mics on a Lenovo ThinkCenter ALSA: line6: Fix POD HD500 audio playback ALSA: pcm: oss: Place the plugin buffer overflow checks correctly (for 5.7) ALSA: pcm: oss: Place the plugin buffer overflow checks correctly ALSA: hda: Match both PCI ID and SSID for driver blacklist
2 parents 477bfeb + 547d2c9 commit c536419

File tree

8 files changed

+35
-33
lines changed

8 files changed

+35
-33
lines changed

sound/core/oss/pcm_plugin.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,14 @@ static snd_pcm_sframes_t calc_dst_frames(struct snd_pcm_substream *plug,
205205
plugin = snd_pcm_plug_first(plug);
206206
while (plugin && frames > 0) {
207207
plugin_next = plugin->next;
208+
if (check_size && plugin->buf_frames &&
209+
frames > plugin->buf_frames)
210+
frames = plugin->buf_frames;
208211
if (plugin->dst_frames) {
209212
frames = plugin->dst_frames(plugin, frames);
210213
if (frames < 0)
211214
return frames;
212215
}
213-
if (check_size && frames > plugin->buf_frames)
214-
frames = plugin->buf_frames;
215216
plugin = plugin_next;
216217
}
217218
return frames;
@@ -225,14 +226,15 @@ static snd_pcm_sframes_t calc_src_frames(struct snd_pcm_substream *plug,
225226

226227
plugin = snd_pcm_plug_last(plug);
227228
while (plugin && frames > 0) {
228-
if (check_size && frames > plugin->buf_frames)
229-
frames = plugin->buf_frames;
230229
plugin_prev = plugin->prev;
231230
if (plugin->src_frames) {
232231
frames = plugin->src_frames(plugin, frames);
233232
if (frames < 0)
234233
return frames;
235234
}
235+
if (check_size && plugin->buf_frames &&
236+
frames > plugin->buf_frames)
237+
frames = plugin->buf_frames;
236238
plugin = plugin_prev;
237239
}
238240
return frames;

sound/isa/opti9xx/miro.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -867,10 +867,13 @@ static void snd_miro_write(struct snd_miro *chip, unsigned char reg,
867867
spin_unlock_irqrestore(&chip->lock, flags);
868868
}
869869

870+
static inline void snd_miro_write_mask(struct snd_miro *chip,
871+
unsigned char reg, unsigned char value, unsigned char mask)
872+
{
873+
unsigned char oldval = snd_miro_read(chip, reg);
870874

871-
#define snd_miro_write_mask(chip, reg, value, mask) \
872-
snd_miro_write(chip, reg, \
873-
(snd_miro_read(chip, reg) & ~(mask)) | ((value) & (mask)))
875+
snd_miro_write(chip, reg, (oldval & ~mask) | (value & mask));
876+
}
874877

875878
/*
876879
* Proc Interface

sound/isa/opti9xx/opti92x-ad1848.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,13 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
317317
}
318318

319319

320-
#define snd_opti9xx_write_mask(chip, reg, value, mask) \
321-
snd_opti9xx_write(chip, reg, \
322-
(snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask)))
320+
static inline void snd_opti9xx_write_mask(struct snd_opti9xx *chip,
321+
unsigned char reg, unsigned char value, unsigned char mask)
322+
{
323+
unsigned char oldval = snd_opti9xx_read(chip, reg);
323324

325+
snd_opti9xx_write(chip, reg, (oldval & ~mask) | (value & mask));
326+
}
324327

325328
static int snd_opti9xx_configure(struct snd_opti9xx *chip,
326329
long port,

sound/pci/hda/hda_intel.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,9 +2078,10 @@ static void pcm_mmap_prepare(struct snd_pcm_substream *substream,
20782078
* some HD-audio PCI entries are exposed without any codecs, and such devices
20792079
* should be ignored from the beginning.
20802080
*/
2081-
static const struct snd_pci_quirk driver_blacklist[] = {
2082-
SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0),
2083-
SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0),
2081+
static const struct pci_device_id driver_blacklist[] = {
2082+
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1043, 0x874f) }, /* ASUS ROG Zenith II / Strix */
2083+
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb59) }, /* MSI TRX40 Creator */
2084+
{ PCI_DEVICE_SUB(0x1022, 0x1487, 0x1462, 0xcb60) }, /* MSI TRX40 */
20842085
{}
20852086
};
20862087

@@ -2100,7 +2101,7 @@ static int azx_probe(struct pci_dev *pci,
21002101
bool schedule_probe;
21012102
int err;
21022103

2103-
if (snd_pci_quirk_lookup(pci, driver_blacklist)) {
2104+
if (pci_match_id(driver_blacklist, pci)) {
21042105
dev_info(&pci->dev, "Skipping the blacklisted device\n");
21052106
return -ENODEV;
21062107
}

sound/pci/hda/patch_hdmi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid)
18481848
/* Add sanity check to pass klockwork check.
18491849
* This should never happen.
18501850
*/
1851-
if (WARN_ON(spdif == NULL))
1851+
if (WARN_ON(spdif == NULL)) {
1852+
mutex_unlock(&codec->spdif_mutex);
18521853
return true;
1854+
}
18531855
non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO);
18541856
mutex_unlock(&codec->spdif_mutex);
18551857
return non_pcm;
@@ -2198,7 +2200,9 @@ static int generic_hdmi_build_controls(struct hda_codec *codec)
21982200

21992201
for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
22002202
struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
2203+
struct hdmi_eld *pin_eld = &per_pin->sink_eld;
22012204

2205+
pin_eld->eld_valid = false;
22022206
hdmi_present_sense(per_pin, 0);
22032207
}
22042208

sound/pci/hda/patch_realtek.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7420,6 +7420,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
74207420
SND_PCI_QUIRK(0x1558, 0x8560, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
74217421
SND_PCI_QUIRK(0x1558, 0x8561, "System76 Gazelle (gaze14)", ALC269_FIXUP_HEADSET_MIC),
74227422
SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
7423+
SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
74237424
SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
74247425
SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
74257426
SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),

sound/usb/line6/podhd.c

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
enum {
2222
LINE6_PODHD300,
2323
LINE6_PODHD400,
24-
LINE6_PODHD500_0,
25-
LINE6_PODHD500_1,
24+
LINE6_PODHD500,
2625
LINE6_PODX3,
2726
LINE6_PODX3LIVE,
2827
LINE6_PODHD500X,
@@ -318,8 +317,7 @@ static const struct usb_device_id podhd_id_table[] = {
318317
/* TODO: no need to alloc data interfaces when only audio is used */
319318
{ LINE6_DEVICE(0x5057), .driver_info = LINE6_PODHD300 },
320319
{ LINE6_DEVICE(0x5058), .driver_info = LINE6_PODHD400 },
321-
{ LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500_0 },
322-
{ LINE6_IF_NUM(0x414D, 1), .driver_info = LINE6_PODHD500_1 },
320+
{ LINE6_IF_NUM(0x414D, 0), .driver_info = LINE6_PODHD500 },
323321
{ LINE6_IF_NUM(0x414A, 0), .driver_info = LINE6_PODX3 },
324322
{ LINE6_IF_NUM(0x414B, 0), .driver_info = LINE6_PODX3LIVE },
325323
{ LINE6_IF_NUM(0x4159, 0), .driver_info = LINE6_PODHD500X },
@@ -352,23 +350,13 @@ static const struct line6_properties podhd_properties_table[] = {
352350
.ep_audio_r = 0x82,
353351
.ep_audio_w = 0x01,
354352
},
355-
[LINE6_PODHD500_0] = {
353+
[LINE6_PODHD500] = {
356354
.id = "PODHD500",
357355
.name = "POD HD500",
358-
.capabilities = LINE6_CAP_PCM
356+
.capabilities = LINE6_CAP_PCM | LINE6_CAP_CONTROL
359357
| LINE6_CAP_HWMON,
360358
.altsetting = 1,
361-
.ep_ctrl_r = 0x81,
362-
.ep_ctrl_w = 0x01,
363-
.ep_audio_r = 0x86,
364-
.ep_audio_w = 0x02,
365-
},
366-
[LINE6_PODHD500_1] = {
367-
.id = "PODHD500",
368-
.name = "POD HD500",
369-
.capabilities = LINE6_CAP_PCM
370-
| LINE6_CAP_HWMON,
371-
.altsetting = 0,
359+
.ctrl_if = 1,
372360
.ep_ctrl_r = 0x81,
373361
.ep_ctrl_w = 0x01,
374362
.ep_audio_r = 0x86,

sound/usb/quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
16871687

16881688
case USB_ID(0x0d8c, 0x0316): /* Hegel HD12 DSD */
16891689
case USB_ID(0x10cb, 0x0103): /* The Bit Opus #3; with fp->dsd_raw */
1690-
case USB_ID(0x16b0, 0x06b2): /* NuPrime DAC-10 */
1690+
case USB_ID(0x16d0, 0x06b2): /* NuPrime DAC-10 */
16911691
case USB_ID(0x16d0, 0x09dd): /* Encore mDSD */
16921692
case USB_ID(0x16d0, 0x0733): /* Furutech ADL Stratos */
16931693
case USB_ID(0x16d0, 0x09db): /* NuPrime Audio DAC-9 */

0 commit comments

Comments
 (0)