Assorted usb-audio patches
Hi,
here are some patches I collected for the usb-audio driver. Most of them have been discussed on this list already, and all are rather small and shouldn't cause any problems.
FWIW, they can also be pulled from
git://github.com/zonque/linux-2.6.git usb-audio
Daniel
Daniel Mack (8):
MAINTAINERS: Add entry for Native Instruments sound driver
ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set
ALSA: usb-audio: include format.h in format.c
ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6
ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interface
ALSA: usb-audio: add quirks for Roland GR-55
ALSA: usb-audio: assume valid clock
ALSA: usb-audio: handle "Fast Track Ultra" with USB_DEVICE_VENDOR_SPEC()
MAINTAINERS | 7 +++++++ sound/usb/clock.c | 11 ++++++++++- sound/usb/debug.h | 2 +- sound/usb/format.c | 1 + sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 43 ++++++++++++++++++++++++++++++++++++++++--- sound/usb/quirks.c | 2 +- 7 files changed, 60 insertions(+), 23 deletions(-)
PATCH 1/8 MAINTAINERS: Add entry for Native Instruments sound driver
--- MAINTAINERS | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
MAINTAINERS +7 -0
@@ -4271,6 +4271,13 @@ M: Tim Hockin <[email protected]> S: Maintained F: drivers/net/natsemi.c +NATIVE INSTRUMENTS USB SOUND INTERFACE DRIVER +M: Daniel Mack <[email protected]> +S: Maintained +L: [email protected] +W: http://www.native-instruments.com +F: sound/usb/caiaq/ + NCP FILESYSTEM M: Petr Vandrovec <[email protected]> S: Odd Fixes
Signature · 1 line
1.7.5.1
PATCH 2/8 ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set
In reply to Daniel MackJust defining it to nothing is dangerous as it can alter the code execution flow, for example when used in as only function in a conditional code block.
--- sound/usb/debug.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/usb/debug.h +1 -1
@@ -8,7 +8,7 @@#ifdef HW_CONST_DEBUG #define hwc_debug(fmt, args...) printk(KERN_DEBUG fmt, ##args)#else -#define hwc_debug(fmt, args...) /**/ +#define hwc_debug(fmt, args...) do { } while(0)#endif #endif /* __USBAUDIO_DEBUG_H */
Signature · 1 line
1.7.5.1
PATCH 3/8 ALSA: usb-audio: include format.h in format.c
In reply to Daniel MackJust in case a prototype changes, we'll be warned. This also fixes a sparse warning.
--- sound/usb/format.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
sound/usb/format.c +1 -0
@@ -30,6 +30,7 @@#include "helper.h" #include "debug.h" #include "clock.h" +#include "format.h" /* * parse the audio format type I descriptor
Signature · 1 line
1.7.5.1
PATCH 4/8 ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6
In reply to Daniel MackThis was a flaw in the reading of the spec tables - Native Instrument's "Komplete Audio 6" device has no such extra controls.
This patch also fixes the device name in two comments.
--- sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 2 +- sound/usb/quirks.c | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-)
sound/usb/mixer_quirks.c +0 -17
@@ -398,17 +398,6 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol,return 0 ; } -static struct snd_kcontrol_new snd_nativeinstruments_ak6_mixers[] = { - { - .name ="Direct Monitor Channel 1+2" , - .private_value =_MAKE_NI_CONTROL (0x03 ,0x03 ), - }, - { - .name ="Direct Monitor Channel 3+4" , - .private_value =_MAKE_NI_CONTROL (0x03 ,0x05 ), - }, -}; -static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { { .name ="Direct Thru Channel A" ,
@@ -537,12 +526,6 @@ int snd_usb_mixer_apply_create_quirk(struct usb_mixer_interface *mixer) err =snd_xonar_u1_controls_create (mixer);break ; -case USB_ID (0x17cc ,0x1001 ):/* Audio Kontrol 6 */ - err =snd_nativeinstruments_create_mixer (mixer, - snd_nativeinstruments_ak6_mixers, -ARRAY_SIZE (snd_nativeinstruments_ak6_mixers)); -break ; -case USB_ID (0x17cc ,0x1011 ):/* Traktor Audio 6 */ err = snd_nativeinstruments_create_mixer(mixer, snd_nativeinstruments_ta6_mixers,
sound/usb/quirks-table.h +1 -1
@@ -2332,7 +2332,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),/* Native Instruments MK2 series */ { -/* Audio Kontrol 6 */ +/* Komplete Audio 6 */ .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = 0x17cc, .idProduct = 0x1000,
sound/usb/quirks.c +1 -1
@@ -540,7 +540,7 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,/* Access Music VirusTI Desktop */ return snd_usb_accessmusic_boot_quirk (dev); -case USB_ID (0x17cc ,0x1000 ):/* Audio Kontrol 6 */ +case USB_ID (0x17cc ,0x1000 ):/* Komplete Audio 6 */ case USB_ID (0x17cc ,0x1010 ):/* Traktor Audio 6 */ case USB_ID (0x17cc ,0x1020 ):/* Traktor Audio 10 */ return snd_usb_nativeinstruments_boot_quirk (dev);
Signature · 1 line
1.7.5.1
PATCH 5/8 ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interface
In reply to Daniel Mack--- sound/usb/quirks-table.h | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
sound/usb/quirks-table.h +11 -0
@@ -2179,6 +2179,17 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, +/* KORG devices */ +{ + USB_DEVICE_VENDOR_SPEC(0x0944, 0x0200), + .driver_info = (unsigned long ) & (const struct snd_usb_audio_quirk ) { + .vendor_name ="KORG, Inc." , +/* .product_name = "PANDORA PX5D", */ + .ifnum =3 , + .type =QUIRK_MIDI_STANDARD_INTERFACE , + } +}, +/* AKAI devices */ { USB_DEVICE(0x09e8, 0x0062),
Signature · 6 lines
1.7.5.1 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/8 ALSA: usb-audio: add quirks for Roland GR-55
In reply to Daniel Mack--- sound/usb/quirks-table.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-)
sound/usb/quirks-table.h +26 -0
@@ -1651,6 +1651,32 @@ YAMAHA_DEVICE(0x7010, "UB99"), } } }, +{ + USB_DEVICE(0x0582, 0x0127), + .driver_info = (unsigned long ) & (const struct snd_usb_audio_quirk ) { +/* .vendor_name = "Roland", */ +/* .product_name = "GR-55", */ + .ifnum =QUIRK_ANY_INTERFACE , + .type =QUIRK_COMPOSITE , + .data = (const struct snd_usb_audio_quirk []) { + { + .ifnum =0 , + .type =QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum =1 , + .type =QUIRK_AUDIO_STANDARD_INTERFACE + }, + { + .ifnum =2 , + .type =QUIRK_MIDI_STANDARD_INTERFACE + }, + { + .ifnum =-1 + } + } + } +}, /* Guillemot devices */ {
Signature · 1 line
1.7.5.1
PATCH 7/8 ALSA: usb-audio: assume valid clock
In reply to Daniel MackIf the interface can't report a clock's validity, assume that it's valid.
--- sound/usb/clock.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
sound/usb/clock.c +10 -1
@@ -104,6 +104,15 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)int err;unsigned char data;struct usb_device *dev = chip->dev; +struct uac_clock_source_descriptor *cs_desc = +snd_usb_find_clock_source (chip->ctrl_intf, source_id); + +if (!cs_desc) +return 0 ; + +/* If a clock source can't tell us whether it's valid, we assume it is */ +if (!uac2_control_is_readable (cs_desc->bmControls,UAC2_CS_CONTROL_CLOCK_VALID )) +return 1 ; err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN,
@@ -114,7 +123,7 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)if (err <0 ) {snd_printk (KERN_WARNING "%s(): cannot get clock validity for id %d\n" , __func__, source_id); -return err; +return 0 ; }return !!data;
Signature · 1 line
1.7.5.1
PATCH 8/8 ALSA: usb-audio: handle "Fast Track Ultra" with USB_DEVICE_VENDOR_SPEC()
In reply to Daniel MackThat way, the class compliant MIDI interface is also handled.
--- sound/usb/quirks-table.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/usb/quirks-table.h +2 -2
@@ -1979,7 +1979,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - USB_DEVICE(0x0763, 0x2080), + USB_DEVICE_VENDOR_SPEC(0x0763, 0x2080), .driver_info = (unsigned long ) & (const struct snd_usb_audio_quirk ) {/* .vendor_name = "M-Audio", */ /* .product_name = "Fast Track Ultra", */
@@ -2046,7 +2046,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), } }, { - USB_DEVICE(0x0763, 0x2081), + USB_DEVICE_VENDOR_SPEC(0x0763, 0x2081), .driver_info = (unsigned long ) & (const struct snd_usb_audio_quirk ) {/* .vendor_name = "M-Audio", */ /* .product_name = "Fast Track Ultra 8R", */
Signature · 1 line
1.7.5.1
At Wed, 18 May 2011 11:28:37 +0200,
Quoted 6 lines · Daniel Mack
Hi,
here are some patches I collected for the usb-audio driver. Most of them have been discussed on this list already, and all are rather small and shouldn't cause any problems.
Thanks! I applied all patches now.
Takashi
Quoted 28 lines
FWIW, they can also be pulled from
git://github.com/zonque/linux-2.6.gitusb-audioDaniel
Daniel Mack (8):
MAINTAINERS: Add entry for Native Instruments sound driver
ALSA: usb-audio: makehwc_debuga noop in caseHW_CONST_DEBUGis not set
ALSA: usb-audio: includeformat.hinformat.c
ALSA: usb-audio: remove invalid extra mixers for Komplete Audio 6
ALSA: usb-audio: Add quirk for KORG PANDORA PX5D MIDI interface
ALSA: usb-audio: add quirks for Roland GR-55
ALSA: usb-audio: assume valid clock
ALSA: usb-audio: handle "Fast Track Ultra" withUSB_DEVICE_VENDOR_SPEC()MAINTAINERS | 7 +++++++ sound/usb/clock.c | 11 ++++++++++- sound/usb/debug.h | 2 +- sound/usb/format.c | 1 + sound/usb/mixer_quirks.c | 17 ----------------- sound/usb/quirks-table.h | 43 ++++++++++++++++++++++++++++++++++++++++--- sound/usb/quirks.c | 2 +- 7 files changed, 60 insertions(+), 23 deletions(-)