Merge tag 'sound-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai: "Here are a collection of small fixes for: - A race with ASoC HD-audio registration - LINE6 usb-audio memory overwrite by malformed descriptor - FireWire MIDI handling - Missing cast for bit shifts in a few USB-audio quirks - The wrong function calls in minor OSS sequencer code paths - A couple of HD-audio quirks" * tag 'sound-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: line6: Fix write on zero-sized buffer ALSA: hda: Fix widget_mutex incomplete protection ALSA: firewire-lib/fireworks: fix miss detection of received MIDI messages ALSA: seq: fix incorrect order of dest_client/dest_ports arguments ALSA: hda/realtek - Change front mic location for Lenovo M710q ALSA: usb-audio: fix sign unintended sign extension on left shifts ALSA: hda/realtek: Add quirks for several Clevo notebook barebones
This commit is contained in:
@ -49,7 +49,7 @@ static int snd_seq_oss_oob_user(struct seq_oss_devinfo *dp, void __user *arg)
|
|||||||
if (copy_from_user(ev, arg, 8))
|
if (copy_from_user(ev, arg, 8))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
memset(&tmpev, 0, sizeof(tmpev));
|
memset(&tmpev, 0, sizeof(tmpev));
|
||||||
snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.port, dp->addr.client);
|
snd_seq_oss_fill_addr(dp, &tmpev, dp->addr.client, dp->addr.port);
|
||||||
tmpev.time.tick = 0;
|
tmpev.time.tick = 0;
|
||||||
if (! snd_seq_oss_process_event(dp, (union evrec *)ev, &tmpev)) {
|
if (! snd_seq_oss_process_event(dp, (union evrec *)ev, &tmpev)) {
|
||||||
snd_seq_oss_dispatch(dp, &tmpev, 0, 0);
|
snd_seq_oss_dispatch(dp, &tmpev, 0, 0);
|
||||||
|
@ -161,7 +161,7 @@ insert_queue(struct seq_oss_devinfo *dp, union evrec *rec, struct file *opt)
|
|||||||
memset(&event, 0, sizeof(event));
|
memset(&event, 0, sizeof(event));
|
||||||
/* set dummy -- to be sure */
|
/* set dummy -- to be sure */
|
||||||
event.type = SNDRV_SEQ_EVENT_NOTEOFF;
|
event.type = SNDRV_SEQ_EVENT_NOTEOFF;
|
||||||
snd_seq_oss_fill_addr(dp, &event, dp->addr.port, dp->addr.client);
|
snd_seq_oss_fill_addr(dp, &event, dp->addr.client, dp->addr.port);
|
||||||
|
|
||||||
if (snd_seq_oss_process_event(dp, rec, &event))
|
if (snd_seq_oss_process_event(dp, rec, &event))
|
||||||
return 0; /* invalid event - no need to insert queue */
|
return 0; /* invalid event - no need to insert queue */
|
||||||
|
@ -320,7 +320,7 @@ static void read_midi_messages(struct amdtp_stream *s,
|
|||||||
u8 *b;
|
u8 *b;
|
||||||
|
|
||||||
for (f = 0; f < frames; f++) {
|
for (f = 0; f < frames; f++) {
|
||||||
port = (s->data_block_counter + f) % 8;
|
port = (8 - s->tx_first_dbc + s->data_block_counter + f) % 8;
|
||||||
b = (u8 *)&buffer[p->midi_position];
|
b = (u8 *)&buffer[p->midi_position];
|
||||||
|
|
||||||
len = b[0] - 0x80;
|
len = b[0] - 0x80;
|
||||||
|
@ -400,27 +400,33 @@ static void setup_fg_nodes(struct hdac_device *codec)
|
|||||||
int snd_hdac_refresh_widgets(struct hdac_device *codec, bool sysfs)
|
int snd_hdac_refresh_widgets(struct hdac_device *codec, bool sysfs)
|
||||||
{
|
{
|
||||||
hda_nid_t start_nid;
|
hda_nid_t start_nid;
|
||||||
int nums, err;
|
int nums, err = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Serialize against multiple threads trying to update the sysfs
|
||||||
|
* widgets array.
|
||||||
|
*/
|
||||||
|
mutex_lock(&codec->widget_lock);
|
||||||
nums = snd_hdac_get_sub_nodes(codec, codec->afg, &start_nid);
|
nums = snd_hdac_get_sub_nodes(codec, codec->afg, &start_nid);
|
||||||
if (!start_nid || nums <= 0 || nums >= 0xff) {
|
if (!start_nid || nums <= 0 || nums >= 0xff) {
|
||||||
dev_err(&codec->dev, "cannot read sub nodes for FG 0x%02x\n",
|
dev_err(&codec->dev, "cannot read sub nodes for FG 0x%02x\n",
|
||||||
codec->afg);
|
codec->afg);
|
||||||
return -EINVAL;
|
err = -EINVAL;
|
||||||
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sysfs) {
|
if (sysfs) {
|
||||||
mutex_lock(&codec->widget_lock);
|
|
||||||
err = hda_widget_sysfs_reinit(codec, start_nid, nums);
|
err = hda_widget_sysfs_reinit(codec, start_nid, nums);
|
||||||
mutex_unlock(&codec->widget_lock);
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
codec->num_nodes = nums;
|
codec->num_nodes = nums;
|
||||||
codec->start_nid = start_nid;
|
codec->start_nid = start_nid;
|
||||||
codec->end_nid = start_nid + nums;
|
codec->end_nid = start_nid + nums;
|
||||||
return 0;
|
unlock:
|
||||||
|
mutex_unlock(&codec->widget_lock);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_hdac_refresh_widgets);
|
EXPORT_SYMBOL_GPL(snd_hdac_refresh_widgets);
|
||||||
|
|
||||||
|
@ -2448,9 +2448,10 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
|
SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950),
|
||||||
SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
|
SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950),
|
||||||
SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
|
SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
|
||||||
SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
|
SND_PCI_QUIRK(0x1558, 0x96e1, "Clevo P960[ER][CDFN]-K", ALC1220_FIXUP_CLEVO_P950),
|
||||||
SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
|
SND_PCI_QUIRK(0x1558, 0x97e1, "Clevo P970[ER][CDFN]", ALC1220_FIXUP_CLEVO_P950),
|
||||||
SND_PCI_QUIRK(0x1558, 0x65d1, "Tuxedo Book XC1509", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
|
SND_PCI_QUIRK(0x1558, 0x65d1, "Clevo PB51[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
|
||||||
|
SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
|
||||||
SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
|
SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
|
||||||
SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
|
SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
|
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),
|
||||||
@ -7074,6 +7075,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
|||||||
SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
|
SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
|
SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||||
|
SND_PCI_QUIRK(0x17aa, 0x3111, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||||
SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
|
||||||
|
@ -556,6 +556,11 @@ int line6_init_pcm(struct usb_line6 *line6,
|
|||||||
line6pcm->max_packet_size_out =
|
line6pcm->max_packet_size_out =
|
||||||
usb_maxpacket(line6->usbdev,
|
usb_maxpacket(line6->usbdev,
|
||||||
usb_sndisocpipe(line6->usbdev, ep_write), 1);
|
usb_sndisocpipe(line6->usbdev, ep_write), 1);
|
||||||
|
if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
|
||||||
|
dev_err(line6pcm->line6->ifcdev,
|
||||||
|
"cannot get proper max packet size\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock_init(&line6pcm->out.lock);
|
spin_lock_init(&line6pcm->out.lock);
|
||||||
spin_lock_init(&line6pcm->in.lock);
|
spin_lock_init(&line6pcm->in.lock);
|
||||||
|
@ -741,7 +741,7 @@ static int snd_ni_control_init_val(struct usb_mixer_interface *mixer,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
kctl->private_value |= (value << 24);
|
kctl->private_value |= ((unsigned int)value << 24);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -902,7 +902,7 @@ static int snd_ftu_eff_switch_init(struct usb_mixer_interface *mixer,
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
kctl->private_value |= value[0] << 24;
|
kctl->private_value |= (unsigned int)value[0] << 24;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user