Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+43 -11
+3
sound/core/seq/seq_midi_emul.c
··· 269 269 { 270 270 int i; 271 271 272 + if (control >= ARRAY_SIZE(chan->control)) 273 + return; 274 + 272 275 /* Switches */ 273 276 if ((control >=64 && control <=69) || (control >= 80 && control <= 83)) { 274 277 /* These are all switches; either off or on so set to 0 or 127 */
+2 -2
sound/pci/hda/hda_tegra.c
··· 329 329 330 330 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 331 331 hda->regs = devm_ioremap_resource(dev, res); 332 - if (IS_ERR(chip->remap_addr)) 333 - return PTR_ERR(chip->remap_addr); 332 + if (IS_ERR(hda->regs)) 333 + return PTR_ERR(hda->regs); 334 334 335 335 chip->remap_addr = hda->regs + HDA_BAR0; 336 336 chip->addr = res->start + HDA_BAR0;
+1
sound/pci/hda/patch_realtek.c
··· 4937 4937 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 4938 4938 SND_PCI_QUIRK(0x103c, 0x225f, "HP", ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY), 4939 4939 /* ALC282 */ 4940 + SND_PCI_QUIRK(0x103c, 0x21f9, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4940 4941 SND_PCI_QUIRK(0x103c, 0x2210, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4941 4942 SND_PCI_QUIRK(0x103c, 0x2214, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4942 4943 SND_PCI_QUIRK(0x103c, 0x2236, "HP", ALC269_FIXUP_HP_LINE1_MIC1_LED),
+6
sound/pci/rme9652/hdspm.c
··· 6082 6082 snd_pcm_hw_constraint_minmax(runtime, 6083 6083 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 6084 6084 64, 8192); 6085 + snd_pcm_hw_constraint_minmax(runtime, 6086 + SNDRV_PCM_HW_PARAM_PERIODS, 6087 + 2, 2); 6085 6088 break; 6086 6089 } 6087 6090 ··· 6159 6156 snd_pcm_hw_constraint_minmax(runtime, 6160 6157 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 6161 6158 64, 8192); 6159 + snd_pcm_hw_constraint_minmax(runtime, 6160 + SNDRV_PCM_HW_PARAM_PERIODS, 6161 + 2, 2); 6162 6162 break; 6163 6163 } 6164 6164
+2 -1
sound/soc/intel/sst-haswell-pcm.c
··· 91 91 SNDRV_PCM_INFO_INTERLEAVED | 92 92 SNDRV_PCM_INFO_PAUSE | 93 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 96 .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | 96 97 SNDRV_PCM_FMTBIT_S32_LE, 97 98 .period_bytes_min = PAGE_SIZE,
+5
sound/usb/clock.c
··· 303 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 311 if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR, 307 312 USB_TYPE_CLASS | USB_RECIP_ENDPOINT | USB_DIR_IN, 308 313 UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep,
+10 -4
sound/usb/line6/driver.c
··· 302 302 /* 303 303 Read data from device. 304 304 */ 305 - int line6_read_data(struct usb_line6 *line6, int address, void *data, 306 - size_t datalen) 305 + int line6_read_data(struct usb_line6 *line6, unsigned address, void *data, 306 + unsigned datalen) 307 307 { 308 308 struct usb_device *usbdev = line6->usbdev; 309 309 int ret; 310 310 unsigned char len; 311 311 unsigned count; 312 + 313 + if (address > 0xffff || datalen > 0xff) 314 + return -EINVAL; 312 315 313 316 /* query the serial number: */ 314 317 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, ··· 373 370 /* 374 371 Write data to device. 375 372 */ 376 - int line6_write_data(struct usb_line6 *line6, int address, void *data, 377 - size_t datalen) 373 + int line6_write_data(struct usb_line6 *line6, unsigned address, void *data, 374 + unsigned datalen) 378 375 { 379 376 struct usb_device *usbdev = line6->usbdev; 380 377 int ret; 381 378 unsigned char status; 382 379 int count; 380 + 381 + if (address > 0xffff || datalen > 0xffff) 382 + return -EINVAL; 383 383 384 384 ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67, 385 385 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
+4 -4
sound/usb/line6/driver.h
··· 147 147 148 148 extern char *line6_alloc_sysex_buffer(struct usb_line6 *line6, int code1, 149 149 int code2, int size); 150 - extern int line6_read_data(struct usb_line6 *line6, int address, void *data, 151 - size_t datalen); 150 + extern int line6_read_data(struct usb_line6 *line6, unsigned address, 151 + void *data, unsigned datalen); 152 152 extern int line6_read_serial_number(struct usb_line6 *line6, 153 153 u32 *serial_number); 154 154 extern int line6_send_raw_message_async(struct usb_line6 *line6, ··· 161 161 void (*function)(unsigned long), 162 162 unsigned long data); 163 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, 165 - size_t datalen); 164 + extern int line6_write_data(struct usb_line6 *line6, unsigned address, 165 + void *data, unsigned datalen); 166 166 167 167 int line6_probe(struct usb_interface *interface, 168 168 const struct usb_device_id *id,
+8
sound/usb/quirks.c
··· 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 1120 /* Marantz/Denon USB DACs need a vendor cmd to switch 1116 1121 * between PCM and native DSD mode ··· 1127 1122 int err; 1128 1123 1129 1124 switch (subs->stream->chip->usb_id) { 1125 + case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */ 1130 1126 case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ 1131 1127 case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ 1132 1128 ··· 1207 1201 (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS) { 1208 1202 1209 1203 switch (le16_to_cpu(dev->descriptor.idProduct)) { 1204 + case 0x1003: /* Denon DA300-USB */ 1210 1205 case 0x3005: /* Marantz HD-DAC1 */ 1211 1206 case 0x3006: /* Marantz SA-14S1 */ 1212 1207 mdelay(20); ··· 1269 1262 1270 1263 /* Denon/Marantz devices with USB DAC functionality */ 1271 1264 switch (chip->usb_id) { 1265 + case USB_ID(0x154e, 0x1003): /* Denon DA300-USB */ 1272 1266 case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */ 1273 1267 case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */ 1274 1268 if (fp->altsetting == 2)
+2
sound/usb/quirks.h
··· 21 21 void snd_usb_set_format_quirk(struct snd_usb_substream *subs, 22 22 struct audioformat *fmt); 23 23 24 + bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip); 25 + 24 26 int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, 25 27 struct audioformat *fp); 26 28