diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-21 14:53:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-21 14:53:00 -0500 |
commit | a2a6937da0b95644008ede0eb309493d16cf2ac2 (patch) | |
tree | 6950882662b3cbe9c569720c5e173dd16b7f3c85 | |
parent | f5e25f0db07ee6d083d6376c400ca1065a10fa1a (diff) | |
parent | 3cd1ce0420ce89937bef9096d5bdb13fbdf0f8b0 (diff) |
Merge tag 'sound-fix-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here are a few small fix patches for 3.20-rc1:
- Quirks for Denon and Lifecam USB-audio devices and HD-audio on HP
laptops
- A long-time regression fix for HDSP eMADI
- Add missing DRAIN_TRIGGER flag set for ASoC intel-sst
- Trivial fixes for sequencer core and HD-audio Tegra, a LINE6
cleanup"
* tag 'sound-fix-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: usb: Fix support for Denon DA-300USB DAC (ID 154e:1003)
ASoC: Intel: add SNDRV_PCM_INFO_DRAIN_TRIGGER flag
ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate
ALSA: hda/tegra check correct return value from ioremap_resource
ALSA: hdspm - Constrain periods to 2 on older cards
ALSA: hda - enable mute led quirk for one more hp machine.
ALSA: seq: potential out of bounds in do_control()
ALSA: line6: Improve line6_read/write_data() interfaces
-rw-r--r-- | sound/core/seq/seq_midi_emul.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/hda_tegra.c | 4 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 1 | ||||
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 6 | ||||
-rw-r--r-- | sound/soc/intel/sst-haswell-pcm.c | 3 | ||||
-rw-r--r-- | sound/usb/clock.c | 5 | ||||
-rw-r--r-- | sound/usb/line6/driver.c | 14 | ||||
-rw-r--r-- | sound/usb/line6/driver.h | 8 | ||||
-rw-r--r-- | sound/usb/quirks.c | 8 | ||||
-rw-r--r-- | sound/usb/quirks.h | 2 |
10 files changed, 43 insertions, 11 deletions
diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 9b6470cdcf24..7ba937399ac7 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c | |||
@@ -269,6 +269,9 @@ do_control(struct snd_midi_op *ops, void *drv, struct snd_midi_channel_set *chse | |||
269 | { | 269 | { |
270 | int i; | 270 | int i; |
271 | 271 | ||
272 | if (control >= ARRAY_SIZE(chan->control)) | ||
273 | return; | ||
274 | |||
272 | /* Switches */ | 275 | /* Switches */ |
273 | if ((control >=64 && control <=69) || (control >= 80 && control <= 83)) { | 276 | if ((control >=64 && control <=69) || (control >= 80 && control <= 83)) { |
274 | /* These are all switches; either off or on so set to 0 or 127 */ | 277 | /* These are all switches; either off or on so set to 0 or 127 */ |
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 227990bc02e3..375e94f4cf52 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c | |||
@@ -329,8 +329,8 @@ static int hda_tegra_init_chip(struct azx *chip, struct platform_device *pdev) | |||
329 | 329 | ||
330 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 330 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
331 | hda->regs = devm_ioremap_resource(dev, res); | 331 | hda->regs = devm_ioremap_resource(dev, res); |
332 | if (IS_ERR(chip->remap_addr)) | 332 | if (IS_ERR(hda->regs)) |
333 | return PTR_ERR(chip->remap_addr); | 333 | return PTR_ERR(hda->regs); |
334 | 334 | ||
335 | chip->remap_addr = hda->regs + HDA_BAR0; | 335 | chip->remap_addr = hda->regs + HDA_BAR0; |
336 | chip->addr = res->start + HDA_BAR0; | 336 | chip->addr = res->start + HDA_BAR0; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ddb93083a2af..b2b24a8b3dac 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4937,6 +4937,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
4937 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), | 4937 | SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), |
4938 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), | 4938 | SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), |
4939 | /* ALC282 */ | 4939 | /* ALC282 */ |
4940 | SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | ||
4940 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4941 | SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4941 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 4942 | SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4942 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), | 4943 | SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED), |
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 2c363fdca9fd..ca67f896d117 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -6082,6 +6082,9 @@ static int snd_hdspm_playback_open(struct snd_pcm_substream *substream) | |||
6082 | snd_pcm_hw_constraint_minmax(runtime, | 6082 | snd_pcm_hw_constraint_minmax(runtime, |
6083 | SNDRV_PCM_HW_PARAM_PERIOD_SIZE, | 6083 | SNDRV_PCM_HW_PARAM_PERIOD_SIZE, |
6084 | 64, 8192); | 6084 | 64, 8192); |
6085 | snd_pcm_hw_constraint_minmax(runtime, | ||
6086 | SNDRV_PCM_HW_PARAM_PERIODS, | ||
6087 | 2, 2); | ||
6085 | break; | 6088 | break; |
6086 | } | 6089 | } |
6087 | 6090 | ||
@@ -6156,6 +6159,9 @@ static int snd_hdspm_capture_open(struct snd_pcm_substream *substream) | |||
6156 | snd_pcm_hw_constraint_minmax(runtime, | 6159 | snd_pcm_hw_constraint_minmax(runtime, |
6157 | SNDRV_PCM_HW_PARAM_PERIOD_SIZE, | 6160 | SNDRV_PCM_HW_PARAM_PERIOD_SIZE, |
6158 | 64, 8192); | 6161 | 64, 8192); |
6162 | snd_pcm_hw_constraint_minmax(runtime, | ||
6163 | SNDRV_PCM_HW_PARAM_PERIODS, | ||
6164 | 2, 2); | ||
6159 | break; | 6165 | break; |
6160 | } | 6166 | } |
6161 | 6167 | ||
diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c index d6fa9d5514e1..7e21e8f85885 100644 --- a/sound/soc/intel/sst-haswell-pcm.c +++ b/sound/soc/intel/sst-haswell-pcm.c | |||
@@ -91,7 +91,8 @@ static const struct snd_pcm_hardware hsw_pcm_hardware = { | |||
91 | SNDRV_PCM_INFO_INTERLEAVED | | 91 | SNDRV_PCM_INFO_INTERLEAVED | |
92 | SNDRV_PCM_INFO_PAUSE | | 92 | SNDRV_PCM_INFO_PAUSE | |
93 | SNDRV_PCM_INFO_RESUME | | 93 | SNDRV_PCM_INFO_RESUME | |
94 | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP, | 94 | SNDRV_PCM_INFO_NO_PERIOD_WAKEUP | |
95 | SNDRV_PCM_INFO_DRAIN_TRIGGER, | ||
95 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | | 96 | .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | |
96 | SNDRV_PCM_FMTBIT_S32_LE, | 97 | SNDRV_PCM_FMTBIT_S32_LE, |
97 | .period_bytes_min = PAGE_SIZE, | 98 | .period_bytes_min = PAGE_SIZE, |
diff --git a/sound/usb/clock.c b/sound/usb/clock.c index 03fed6611d9e..2ed260b10f6d 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c | |||
@@ -303,6 +303,11 @@ static int set_sample_rate_v1(struct snd_usb_audio *chip, int iface, | |||
303 | return err; | 303 | return err; |
304 | } | 304 | } |
305 | 305 | ||
306 | /* Don't check the sample rate for devices which we know don't | ||
307 | * support reading */ | ||
308 | if (snd_usb_get_sample_rate_quirk(chip)) | ||
309 | return 0; | ||
310 | |||
306 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR, | 311 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR, |
307 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, | 312 | USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, |
308 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, | 313 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, |
diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c index 99b63a7902f3..81b7da8e56d3 100644 --- a/sound/usb/line6/driver.c +++ b/sound/usb/line6/driver.c | |||
@@ -302,14 +302,17 @@ static void line6_data_received(struct urb *urb) | |||
302 | /* | 302 | /* |
303 | Read data from device. | 303 | Read data from device. |
304 | */ | 304 | */ |
305 | int line6_read_data(struct usb_line6 *line6, int address, void *data, | 305 | int line6_read_data(struct usb_line6 *line6, unsigned address, void *data, |
306 | size_t datalen) | 306 | unsigned datalen) |
307 | { | 307 | { |
308 | struct usb_device *usbdev = line6->usbdev; | 308 | struct usb_device *usbdev = line6->usbdev; |
309 | int ret; | 309 | int ret; |
310 | unsigned char len; | 310 | unsigned char len; |
311 | unsigned count; | 311 | unsigned count; |
312 | 312 | ||
313 | if (address > 0xffff || datalen > 0xff) | ||
314 | return -EINVAL; | ||
315 | |||
313 | /* query the serial number: */ | 316 | /* query the serial number: */ |
314 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, | 317 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, |
315 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, | 318 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, |
@@ -370,14 +373,17 @@ EXPORT_SYMBOL_GPL(line6_read_data); | |||
370 | /* | 373 | /* |
371 | Write data to device. | 374 | Write data to device. |
372 | */ | 375 | */ |
373 | int line6_write_data(struct usb_line6 *line6, int address, void *data, | 376 | int line6_write_data(struct usb_line6 *line6, unsigned address, void *data, |
374 | size_t datalen) | 377 | unsigned datalen) |
375 | { | 378 | { |
376 | struct usb_device *usbdev = line6->usbdev; | 379 | struct usb_device *usbdev = line6->usbdev; |
377 | int ret; | 380 | int ret; |
378 | unsigned char status; | 381 | unsigned char status; |
379 | int count; | 382 | int count; |
380 | 383 | ||
384 | if (address > 0xffff || datalen > 0xffff) | ||
385 | return -EINVAL; | ||
386 | |||
381 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, | 387 | ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, |
382 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, | 388 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, |
383 | 0x0022, address, data, datalen, | 389 | 0x0022, address, data, datalen, |
diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index 5d20294d64f4..7da643e79e3b 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h | |||
@@ -147,8 +147,8 @@ struct usb_line6 { | |||
147 | 147 | ||
148 | extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, | 148 | extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, |
149 | int code2, int size); | 149 | int code2, int size); |
150 | extern int line6_read_data(struct usb_line6 *line6, int address, void *data, | 150 | extern int line6_read_data(struct usb_line6 *line6, unsigned address, |
151 | size_t datalen); | 151 | void *data, unsigned datalen); |
152 | extern int line6_read_serial_number(struct usb_line6 *line6, | 152 | extern int line6_read_serial_number(struct usb_line6 *line6, |
153 | u32 *serial_number); | 153 | u32 *serial_number); |
154 | extern int line6_send_raw_message_async(struct usb_line6 *line6, | 154 | extern int line6_send_raw_message_async(struct usb_line6 *line6, |
@@ -161,8 +161,8 @@ extern void line6_start_timer(struct timer_list *timer, unsigned long msecs, | |||
161 | void (*function)(unsigned long), | 161 | void (*function)(unsigned long), |
162 | unsigned long data); | 162 | unsigned long data); |
163 | extern int line6_version_request_async(struct usb_line6 *line6); | 163 | extern int line6_version_request_async(struct usb_line6 *line6); |
164 | extern int line6_write_data(struct usb_line6 *line6, int address, void *data, | 164 | extern int line6_write_data(struct usb_line6 *line6, unsigned address, |
165 | size_t datalen); | 165 | void *data, unsigned datalen); |
166 | 166 | ||
167 | int line6_probe(struct usb_interface *interface, | 167 | int line6_probe(struct usb_interface *interface, |
168 | const struct usb_device_id *id, | 168 | const struct usb_device_id *id, |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index a7398412310b..753a47de8459 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1111,6 +1111,11 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs, | |||
1111 | } | 1111 | } |
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) | ||
1115 | { | ||
1116 | /* MS Lifecam HD-5000 doesn't support reading the sample rate. */ | ||
1117 | return chip->usb_id == USB_ID(0x045E, 0x076D); | ||
1118 | } | ||
1114 | 1119 | ||
1115 | /* Marantz/Denon USB DACs need a vendor cmd to switch | 1120 | /* Marantz/Denon USB DACs need a vendor cmd to switch |
1116 | * between PCM and native DSD mode | 1121 | * between PCM and native DSD mode |
@@ -1122,6 +1127,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, | |||
1122 | int err; | 1127 | int err; |
1123 | 1128 | ||
1124 | switch (subs->stream->chip->usb_id) { | 1129 | switch (subs->stream->chip->usb_id) { |
1130 | case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ | ||
1125 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ | 1131 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ |
1126 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ | 1132 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ |
1127 | 1133 | ||
@@ -1201,6 +1207,7 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, | |||
1201 | (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) { | 1207 | (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) { |
1202 | 1208 | ||
1203 | switch (le16_to_cpu(dev->descriptor.idProduct)) { | 1209 | switch (le16_to_cpu(dev->descriptor.idProduct)) { |
1210 | case 0x1003: /* Denon DA300-USB */ | ||
1204 | case 0x3005: /* Marantz HD-DAC1 */ | 1211 | case 0x3005: /* Marantz HD-DAC1 */ |
1205 | case 0x3006: /* Marantz SA-14S1 */ | 1212 | case 0x3006: /* Marantz SA-14S1 */ |
1206 | mdelay(20); | 1213 | mdelay(20); |
@@ -1262,6 +1269,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
1262 | 1269 | ||
1263 | /* Denon/Marantz devices with USB DAC functionality */ | 1270 | /* Denon/Marantz devices with USB DAC functionality */ |
1264 | switch (chip->usb_id) { | 1271 | switch (chip->usb_id) { |
1272 | case USB_ID(0x154e, 0x1003): /* Denon DA300-USB */ | ||
1265 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ | 1273 | case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ |
1266 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ | 1274 | case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ |
1267 | if (fp->altsetting == 2) | 1275 | if (fp->altsetting == 2) |
diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h index 1b862386577d..2cd71ed1201f 100644 --- a/sound/usb/quirks.h +++ b/sound/usb/quirks.h | |||
@@ -21,6 +21,8 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev, | |||
21 | void snd_usb_set_format_quirk(struct snd_usb_substream *subs, | 21 | void snd_usb_set_format_quirk(struct snd_usb_substream *subs, |
22 | struct audioformat *fmt); | 22 | struct audioformat *fmt); |
23 | 23 | ||
24 | bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip); | ||
25 | |||
24 | int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, | 26 | int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, |
25 | struct audioformat *fp); | 27 | struct audioformat *fp); |
26 | 28 | ||