Commit cb247857 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A collection of small fixes, mostly for regression fixes (sequencer
  kconfig and emu10k1 probe) and device-specific quirks (three for USB
  and one for HD-audio).

  One significant change is a fix for races in ALSA sequencer core,
  which covers over the previous incomplete fix"

* tag 'sound-4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: emu10k1: Fix forgotten user-copy conversion in init code
  ALSA: usb-audio: add DSD support for new Amanero PID
  ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices
  ALSA: usb-audio: Apply sample rate quirk to Sennheiser headset
  ALSA: seq: 2nd attempt at fixing race creating a queue
  ALSA: hda/realtek - Fix pincfg for Dell XPS 13 9370
  ALSA: seq: Fix CONFIG_SND_SEQ_MIDI dependency
parents 4478976a 0b36f2bd
...@@ -47,10 +47,10 @@ config SND_SEQ_HRTIMER_DEFAULT ...@@ -47,10 +47,10 @@ config SND_SEQ_HRTIMER_DEFAULT
timer. timer.
config SND_SEQ_MIDI_EVENT config SND_SEQ_MIDI_EVENT
def_tristate SND_RAWMIDI tristate
config SND_SEQ_MIDI config SND_SEQ_MIDI
tristate def_tristate SND_RAWMIDI
select SND_SEQ_MIDI_EVENT select SND_SEQ_MIDI_EVENT
config SND_SEQ_MIDI_EMUL config SND_SEQ_MIDI_EMUL
......
...@@ -1502,16 +1502,11 @@ static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, ...@@ -1502,16 +1502,11 @@ static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client,
static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg)
{ {
struct snd_seq_queue_info *info = arg; struct snd_seq_queue_info *info = arg;
int result;
struct snd_seq_queue *q; struct snd_seq_queue *q;
result = snd_seq_queue_alloc(client->number, info->locked, info->flags); q = snd_seq_queue_alloc(client->number, info->locked, info->flags);
if (result < 0) if (IS_ERR(q))
return result; return PTR_ERR(q);
q = queueptr(result);
if (q == NULL)
return -EINVAL;
info->queue = q->queue; info->queue = q->queue;
info->locked = q->locked; info->locked = q->locked;
...@@ -1521,7 +1516,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) ...@@ -1521,7 +1516,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg)
if (!info->name[0]) if (!info->name[0])
snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue); snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue);
strlcpy(q->name, info->name, sizeof(q->name)); strlcpy(q->name, info->name, sizeof(q->name));
queuefree(q); snd_use_lock_free(&q->use_lock);
return 0; return 0;
} }
......
...@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) ...@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void)
static void queue_use(struct snd_seq_queue *queue, int client, int use); static void queue_use(struct snd_seq_queue *queue, int client, int use);
/* allocate a new queue - /* allocate a new queue -
* return queue index value or negative value for error * return pointer to new queue or ERR_PTR(-errno) for error
* The new queue's use_lock is set to 1. It is the caller's responsibility to
* call snd_use_lock_free(&q->use_lock).
*/ */
int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
{ {
struct snd_seq_queue *q; struct snd_seq_queue *q;
q = queue_new(client, locked); q = queue_new(client, locked);
if (q == NULL) if (q == NULL)
return -ENOMEM; return ERR_PTR(-ENOMEM);
q->info_flags = info_flags; q->info_flags = info_flags;
queue_use(q, client, 1); queue_use(q, client, 1);
snd_use_lock_use(&q->use_lock);
if (queue_list_add(q) < 0) { if (queue_list_add(q) < 0) {
snd_use_lock_free(&q->use_lock);
queue_delete(q); queue_delete(q);
return -ENOMEM; return ERR_PTR(-ENOMEM);
} }
return q->queue; return q;
} }
/* delete a queue - queue must be owned by the client */ /* delete a queue - queue must be owned by the client */
......
...@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); ...@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void);
/* create new queue (constructor) */ /* create new queue (constructor) */
int snd_seq_queue_alloc(int client, int locked, unsigned int flags); struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags);
/* delete queue (destructor) */ /* delete queue (destructor) */
int snd_seq_queue_delete(int client, int queueid); int snd_seq_queue_delete(int client, int queueid);
......
...@@ -698,10 +698,18 @@ static int copy_gctl(struct snd_emu10k1 *emu, ...@@ -698,10 +698,18 @@ static int copy_gctl(struct snd_emu10k1 *emu,
{ {
struct snd_emu10k1_fx8010_control_old_gpr __user *octl; struct snd_emu10k1_fx8010_control_old_gpr __user *octl;
if (emu->support_tlv) if (emu->support_tlv) {
return copy_from_user(gctl, &_gctl[idx], sizeof(*gctl)); if (in_kernel)
memcpy(gctl, (void *)&_gctl[idx], sizeof(*gctl));
else if (copy_from_user(gctl, &_gctl[idx], sizeof(*gctl)))
return -EFAULT;
return 0;
}
octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl; octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl;
if (copy_from_user(gctl, &octl[idx], sizeof(*octl))) if (in_kernel)
memcpy(gctl, (void *)&octl[idx], sizeof(*octl));
else if (copy_from_user(gctl, &octl[idx], sizeof(*octl)))
return -EFAULT; return -EFAULT;
gctl->tlv = NULL; gctl->tlv = NULL;
return 0; return 0;
......
...@@ -6647,7 +6647,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { ...@@ -6647,7 +6647,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE,
ALC225_STANDARD_PINS, ALC225_STANDARD_PINS,
{0x12, 0xb7a60130}, {0x12, 0xb7a60130},
{0x13, 0xb8a61140},
{0x17, 0x90170110}), {0x17, 0x90170110}),
{} {}
}; };
......
...@@ -542,6 +542,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, ...@@ -542,6 +542,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
if (size < sizeof(scale)) if (size < sizeof(scale))
return -ENOMEM; return -ENOMEM;
if (cval->min_mute)
scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE;
scale[2] = cval->dBmin; scale[2] = cval->dBmin;
scale[3] = cval->dBmax; scale[3] = cval->dBmax;
if (copy_to_user(_tlv, scale, sizeof(scale))) if (copy_to_user(_tlv, scale, sizeof(scale)))
......
...@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { ...@@ -64,6 +64,7 @@ struct usb_mixer_elem_info {
int cached; int cached;
int cache_val[MAX_CHANNELS]; int cache_val[MAX_CHANNELS];
u8 initialized; u8 initialized;
u8 min_mute;
void *private_data; void *private_data;
}; };
......
...@@ -1878,6 +1878,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, ...@@ -1878,6 +1878,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer,
if (unitid == 7 && cval->control == UAC_FU_VOLUME) if (unitid == 7 && cval->control == UAC_FU_VOLUME)
snd_dragonfly_quirk_db_scale(mixer, cval, kctl); snd_dragonfly_quirk_db_scale(mixer, cval, kctl);
break; break;
/* lowest playback value is muted on C-Media devices */
case USB_ID(0x0d8c, 0x000c):
case USB_ID(0x0d8c, 0x0014):
if (strstr(kctl->id.name, "Playback"))
cval->min_mute = 1;
break;
} }
} }
...@@ -1142,6 +1142,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) ...@@ -1142,6 +1142,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */
case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */
case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */
case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */
case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */
case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */
case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */
...@@ -1374,6 +1375,10 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, ...@@ -1374,6 +1375,10 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
} }
} }
break; break;
case USB_ID(0x16d0, 0x0a23):
if (fp->altsetting == 2)
return SNDRV_PCM_FMTBIT_DSD_U32_BE;
break;
default: default:
break; break;
......
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