Commit 8def12d9 authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'for-linus' into for-next

Back-merge of UAC3 fixes for applying further enhancements.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents c5f13d75 c99f0802
...@@ -396,8 +396,7 @@ static int snd_ctl_elem_add_compat(struct snd_ctl_file *file, ...@@ -396,8 +396,7 @@ static int snd_ctl_elem_add_compat(struct snd_ctl_file *file,
if (copy_from_user(&data->id, &data32->id, sizeof(data->id)) || if (copy_from_user(&data->id, &data32->id, sizeof(data->id)) ||
copy_from_user(&data->type, &data32->type, 3 * sizeof(u32))) copy_from_user(&data->type, &data32->type, 3 * sizeof(u32)))
goto error; goto error;
if (get_user(data->owner, &data32->owner) || if (get_user(data->owner, &data32->owner))
get_user(data->type, &data32->type))
goto error; goto error;
switch (data->type) { switch (data->type) {
case SNDRV_CTL_ELEM_TYPE_BOOLEAN: case SNDRV_CTL_ELEM_TYPE_BOOLEAN:
......
...@@ -417,6 +417,8 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, ...@@ -417,6 +417,8 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream,
return -ENOTTY; return -ENOTTY;
if (substream->stream != dir) if (substream->stream != dir)
return -EINVAL; return -EINVAL;
if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN)
return -EBADFD;
if ((ch = substream->runtime->channels) > 128) if ((ch = substream->runtime->channels) > 128)
return -EINVAL; return -EINVAL;
......
...@@ -174,12 +174,12 @@ static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream, ...@@ -174,12 +174,12 @@ static void snd_virmidi_output_trigger(struct snd_rawmidi_substream *substream,
} }
return; return;
} }
spin_lock_irqsave(&substream->runtime->lock, flags);
if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) { if (vmidi->event.type != SNDRV_SEQ_EVENT_NONE) {
if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0) if (snd_seq_kernel_client_dispatch(vmidi->client, &vmidi->event, in_atomic(), 0) < 0)
return; goto out;
vmidi->event.type = SNDRV_SEQ_EVENT_NONE; vmidi->event.type = SNDRV_SEQ_EVENT_NONE;
} }
spin_lock_irqsave(&substream->runtime->lock, flags);
while (1) { while (1) {
count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf)); count = __snd_rawmidi_transmit_peek(substream, buf, sizeof(buf));
if (count <= 0) if (count <= 0)
......
...@@ -831,9 +831,11 @@ static int loopback_rate_shift_get(struct snd_kcontrol *kcontrol, ...@@ -831,9 +831,11 @@ static int loopback_rate_shift_get(struct snd_kcontrol *kcontrol,
{ {
struct loopback *loopback = snd_kcontrol_chip(kcontrol); struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] = ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice] loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].rate_shift; [kcontrol->id.device].rate_shift;
mutex_unlock(&loopback->cable_lock);
return 0; return 0;
} }
...@@ -865,9 +867,11 @@ static int loopback_notify_get(struct snd_kcontrol *kcontrol, ...@@ -865,9 +867,11 @@ static int loopback_notify_get(struct snd_kcontrol *kcontrol,
{ {
struct loopback *loopback = snd_kcontrol_chip(kcontrol); struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] = ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice] loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].notify; [kcontrol->id.device].notify;
mutex_unlock(&loopback->cable_lock);
return 0; return 0;
} }
...@@ -879,12 +883,14 @@ static int loopback_notify_put(struct snd_kcontrol *kcontrol, ...@@ -879,12 +883,14 @@ static int loopback_notify_put(struct snd_kcontrol *kcontrol,
int change = 0; int change = 0;
val = ucontrol->value.integer.value[0] ? 1 : 0; val = ucontrol->value.integer.value[0] ? 1 : 0;
mutex_lock(&loopback->cable_lock);
if (val != loopback->setup[kcontrol->id.subdevice] if (val != loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].notify) { [kcontrol->id.device].notify) {
loopback->setup[kcontrol->id.subdevice] loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].notify = val; [kcontrol->id.device].notify = val;
change = 1; change = 1;
} }
mutex_unlock(&loopback->cable_lock);
return change; return change;
} }
...@@ -892,15 +898,18 @@ static int loopback_active_get(struct snd_kcontrol *kcontrol, ...@@ -892,15 +898,18 @@ static int loopback_active_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
struct loopback *loopback = snd_kcontrol_chip(kcontrol); struct loopback *loopback = snd_kcontrol_chip(kcontrol);
struct loopback_cable *cable = loopback->cables struct loopback_cable *cable;
[kcontrol->id.subdevice][kcontrol->id.device ^ 1];
unsigned int val = 0; unsigned int val = 0;
mutex_lock(&loopback->cable_lock);
cable = loopback->cables[kcontrol->id.subdevice][kcontrol->id.device ^ 1];
if (cable != NULL) { if (cable != NULL) {
unsigned int running = cable->running ^ cable->pause; unsigned int running = cable->running ^ cable->pause;
val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0; val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0;
} }
mutex_unlock(&loopback->cable_lock);
ucontrol->value.integer.value[0] = val; ucontrol->value.integer.value[0] = val;
return 0; return 0;
} }
...@@ -943,9 +952,11 @@ static int loopback_rate_get(struct snd_kcontrol *kcontrol, ...@@ -943,9 +952,11 @@ static int loopback_rate_get(struct snd_kcontrol *kcontrol,
{ {
struct loopback *loopback = snd_kcontrol_chip(kcontrol); struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] = ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice] loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].rate; [kcontrol->id.device].rate;
mutex_unlock(&loopback->cable_lock);
return 0; return 0;
} }
...@@ -965,9 +976,11 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol, ...@@ -965,9 +976,11 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol,
{ {
struct loopback *loopback = snd_kcontrol_chip(kcontrol); struct loopback *loopback = snd_kcontrol_chip(kcontrol);
mutex_lock(&loopback->cable_lock);
ucontrol->value.integer.value[0] = ucontrol->value.integer.value[0] =
loopback->setup[kcontrol->id.subdevice] loopback->setup[kcontrol->id.subdevice]
[kcontrol->id.device].channels; [kcontrol->id.device].channels;
mutex_unlock(&loopback->cable_lock);
return 0; return 0;
} }
......
...@@ -773,8 +773,6 @@ static void amdtp_stream_first_callback(struct fw_iso_context *context, ...@@ -773,8 +773,6 @@ static void amdtp_stream_first_callback(struct fw_iso_context *context,
u32 cycle; u32 cycle;
unsigned int packets; unsigned int packets;
s->max_payload_length = amdtp_stream_get_max_payload(s);
/* /*
* For in-stream, first packet has come. * For in-stream, first packet has come.
* For out-stream, prepared to transmit first packet * For out-stream, prepared to transmit first packet
...@@ -879,6 +877,9 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed) ...@@ -879,6 +877,9 @@ int amdtp_stream_start(struct amdtp_stream *s, int channel, int speed)
amdtp_stream_update(s); amdtp_stream_update(s);
if (s->direction == AMDTP_IN_STREAM)
s->max_payload_length = amdtp_stream_get_max_payload(s);
if (s->flags & CIP_NO_HEADER) if (s->flags & CIP_NO_HEADER)
s->tag = TAG_NO_CIP_HEADER; s->tag = TAG_NO_CIP_HEADER;
else else
......
...@@ -519,7 +519,7 @@ int snd_dice_stream_init_duplex(struct snd_dice *dice) ...@@ -519,7 +519,7 @@ int snd_dice_stream_init_duplex(struct snd_dice *dice)
err = init_stream(dice, AMDTP_IN_STREAM, i); err = init_stream(dice, AMDTP_IN_STREAM, i);
if (err < 0) { if (err < 0) {
for (; i >= 0; i--) for (; i >= 0; i--)
destroy_stream(dice, AMDTP_OUT_STREAM, i); destroy_stream(dice, AMDTP_IN_STREAM, i);
goto end; goto end;
} }
} }
......
...@@ -2210,6 +2210,8 @@ static struct snd_pci_quirk power_save_blacklist[] = { ...@@ -2210,6 +2210,8 @@ static struct snd_pci_quirk power_save_blacklist[] = {
SND_PCI_QUIRK(0x1849, 0x0c0c, "Asrock B85M-ITX", 0), SND_PCI_QUIRK(0x1849, 0x0c0c, "Asrock B85M-ITX", 0),
/* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */
SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0), SND_PCI_QUIRK(0x1043, 0x8733, "Asus Prime X370-Pro", 0),
/* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
SND_PCI_QUIRK(0x17aa, 0x36a7, "Lenovo C50 All in one", 0),
/* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */ /* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */
SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0), SND_PCI_QUIRK(0x17aa, 0x2227, "Lenovo X1 Carbon 3rd Gen", 0),
{} {}
......
...@@ -2363,6 +2363,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { ...@@ -2363,6 +2363,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
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, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950),
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),
...@@ -3832,7 +3833,7 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec, ...@@ -3832,7 +3833,7 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec,
} }
} }
#if IS_REACHABLE(INPUT) #if IS_REACHABLE(CONFIG_INPUT)
static void gpio2_mic_hotkey_event(struct hda_codec *codec, static void gpio2_mic_hotkey_event(struct hda_codec *codec,
struct hda_jack_callback *event) struct hda_jack_callback *event)
{ {
......
...@@ -965,6 +965,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, ...@@ -965,6 +965,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
} }
break; break;
case USB_ID(0x0d8c, 0x0103):
if (!strcmp(kctl->id.name, "PCM Playback Volume")) {
usb_audio_info(chip,
"set volume quirk for CM102-A+/102S+\n");
cval->min = -256;
}
break;
case USB_ID(0x0471, 0x0101): case USB_ID(0x0471, 0x0101):
case USB_ID(0x0471, 0x0104): case USB_ID(0x0471, 0x0104):
case USB_ID(0x0471, 0x0105): case USB_ID(0x0471, 0x0105):
......
...@@ -576,7 +576,7 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, ...@@ -576,7 +576,7 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
if (protocol == UAC_VERSION_1) { if (protocol == UAC_VERSION_1) {
attributes = csep->bmAttributes; attributes = csep->bmAttributes;
} else { } else if (protocol == UAC_VERSION_2) {
struct uac2_iso_endpoint_descriptor *csep2 = struct uac2_iso_endpoint_descriptor *csep2 =
(struct uac2_iso_endpoint_descriptor *) csep; (struct uac2_iso_endpoint_descriptor *) csep;
...@@ -585,6 +585,13 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip, ...@@ -585,6 +585,13 @@ static int parse_uac_endpoint_attributes(struct snd_usb_audio *chip,
/* emulate the endpoint attributes of a v1 device */ /* emulate the endpoint attributes of a v1 device */
if (csep2->bmControls & UAC2_CONTROL_PITCH) if (csep2->bmControls & UAC2_CONTROL_PITCH)
attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL; attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
} else { /* UAC_VERSION_3 */
struct uac3_iso_endpoint_descriptor *csep3 =
(struct uac3_iso_endpoint_descriptor *) csep;
/* emulate the endpoint attributes of a v1 device */
if (le32_to_cpu(csep3->bmControls) & UAC2_CONTROL_PITCH)
attributes |= UAC_EP_CS_ATTR_PITCH_CONTROL;
} }
return attributes; return attributes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment