diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-02-22 17:49:13 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-02-23 02:51:56 -0500 |
commit | de48c7bc6f93c6c8e0be8612c9d72a2dc92eaa01 (patch) | |
tree | f27b2849a4f78959f7c448eaaafd7bca8cb8f8ac /sound/usb | |
parent | 7b8a043f2686af9f41e313a78ed5e98233e5fded (diff) |
ALSA: usbaudio: consolidate header files
Use the definitions from linux/usb/audio.h all over the ALSA USB audio
driver and add some missing definitions there as well.
Use the endpoint attribute macros from linux/usb/ch9 and remove the own
things from sound/usb/usbaudio.h.
Now things are also nicely prefixed which makes understanding the code
easier.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/usbaudio.c | 125 | ||||
-rw-r--r-- | sound/usb/usbaudio.h | 100 | ||||
-rw-r--r-- | sound/usb/usbmidi.c | 10 | ||||
-rw-r--r-- | sound/usb/usbmixer.c | 62 | ||||
-rw-r--r-- | sound/usb/usbquirks.h | 34 | ||||
-rw-r--r-- | sound/usb/usx2y/us122l.c | 6 |
6 files changed, 121 insertions, 216 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 411a6cf43c21..c539f7fe292f 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/moduleparam.h> | 47 | #include <linux/moduleparam.h> |
48 | #include <linux/mutex.h> | 48 | #include <linux/mutex.h> |
49 | #include <linux/usb/audio.h> | 49 | #include <linux/usb/audio.h> |
50 | #include <linux/usb/ch9.h> | ||
50 | 51 | ||
51 | #include <sound/core.h> | 52 | #include <sound/core.h> |
52 | #include <sound/info.h> | 53 | #include <sound/info.h> |
@@ -598,7 +599,7 @@ static int prepare_playback_urb(struct snd_usb_substream *subs, | |||
598 | if (subs->transfer_done >= runtime->period_size) { | 599 | if (subs->transfer_done >= runtime->period_size) { |
599 | subs->transfer_done -= runtime->period_size; | 600 | subs->transfer_done -= runtime->period_size; |
600 | period_elapsed = 1; | 601 | period_elapsed = 1; |
601 | if (subs->fmt_type == USB_FORMAT_TYPE_II) { | 602 | if (subs->fmt_type == UAC_FORMAT_TYPE_II) { |
602 | if (subs->transfer_done > 0) { | 603 | if (subs->transfer_done > 0) { |
603 | /* FIXME: fill-max mode is not | 604 | /* FIXME: fill-max mode is not |
604 | * supported yet */ | 605 | * supported yet */ |
@@ -1106,7 +1107,7 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri | |||
1106 | u->packets = (i + 1) * total_packs / subs->nurbs | 1107 | u->packets = (i + 1) * total_packs / subs->nurbs |
1107 | - i * total_packs / subs->nurbs; | 1108 | - i * total_packs / subs->nurbs; |
1108 | u->buffer_size = maxsize * u->packets; | 1109 | u->buffer_size = maxsize * u->packets; |
1109 | if (subs->fmt_type == USB_FORMAT_TYPE_II) | 1110 | if (subs->fmt_type == UAC_FORMAT_TYPE_II) |
1110 | u->packets++; /* for transfer delimiter */ | 1111 | u->packets++; /* for transfer delimiter */ |
1111 | u->urb = usb_alloc_urb(u->packets, GFP_KERNEL); | 1112 | u->urb = usb_alloc_urb(u->packets, GFP_KERNEL); |
1112 | if (!u->urb) | 1113 | if (!u->urb) |
@@ -1182,7 +1183,7 @@ static struct audioformat *find_format(struct snd_usb_substream *subs, unsigned | |||
1182 | if (i >= fp->nr_rates) | 1183 | if (i >= fp->nr_rates) |
1183 | continue; | 1184 | continue; |
1184 | } | 1185 | } |
1185 | attr = fp->ep_attr & EP_ATTR_MASK; | 1186 | attr = fp->ep_attr & USB_ENDPOINT_SYNCTYPE; |
1186 | if (! found) { | 1187 | if (! found) { |
1187 | found = fp; | 1188 | found = fp; |
1188 | cur_attr = attr; | 1189 | cur_attr = attr; |
@@ -1194,14 +1195,14 @@ static struct audioformat *find_format(struct snd_usb_substream *subs, unsigned | |||
1194 | * M-audio audiophile USB. | 1195 | * M-audio audiophile USB. |
1195 | */ | 1196 | */ |
1196 | if (attr != cur_attr) { | 1197 | if (attr != cur_attr) { |
1197 | if ((attr == EP_ATTR_ASYNC && | 1198 | if ((attr == USB_ENDPOINT_SYNC_ASYNC && |
1198 | subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || | 1199 | subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || |
1199 | (attr == EP_ATTR_ADAPTIVE && | 1200 | (attr == USB_ENDPOINT_SYNC_ADAPTIVE && |
1200 | subs->direction == SNDRV_PCM_STREAM_CAPTURE)) | 1201 | subs->direction == SNDRV_PCM_STREAM_CAPTURE)) |
1201 | continue; | 1202 | continue; |
1202 | if ((cur_attr == EP_ATTR_ASYNC && | 1203 | if ((cur_attr == USB_ENDPOINT_SYNC_ASYNC && |
1203 | subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || | 1204 | subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || |
1204 | (cur_attr == EP_ATTR_ADAPTIVE && | 1205 | (cur_attr == USB_ENDPOINT_SYNC_ADAPTIVE && |
1205 | subs->direction == SNDRV_PCM_STREAM_CAPTURE)) { | 1206 | subs->direction == SNDRV_PCM_STREAM_CAPTURE)) { |
1206 | found = fp; | 1207 | found = fp; |
1207 | cur_attr = attr; | 1208 | cur_attr = attr; |
@@ -1231,11 +1232,11 @@ static int init_usb_pitch(struct usb_device *dev, int iface, | |||
1231 | 1232 | ||
1232 | ep = get_endpoint(alts, 0)->bEndpointAddress; | 1233 | ep = get_endpoint(alts, 0)->bEndpointAddress; |
1233 | /* if endpoint has pitch control, enable it */ | 1234 | /* if endpoint has pitch control, enable it */ |
1234 | if (fmt->attributes & EP_CS_ATTR_PITCH_CONTROL) { | 1235 | if (fmt->attributes & UAC_EP_CS_ATTR_PITCH_CONTROL) { |
1235 | data[0] = 1; | 1236 | data[0] = 1; |
1236 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, | 1237 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), UAC_SET_CUR, |
1237 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, | 1238 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, |
1238 | PITCH_CONTROL << 8, ep, data, 1, 1000)) < 0) { | 1239 | UAC_EP_CS_ATTR_PITCH_CONTROL << 8, ep, data, 1, 1000)) < 0) { |
1239 | snd_printk(KERN_ERR "%d:%d:%d: cannot set enable PITCH\n", | 1240 | snd_printk(KERN_ERR "%d:%d:%d: cannot set enable PITCH\n", |
1240 | dev->devnum, iface, ep); | 1241 | dev->devnum, iface, ep); |
1241 | return err; | 1242 | return err; |
@@ -1254,21 +1255,21 @@ static int init_usb_sample_rate(struct usb_device *dev, int iface, | |||
1254 | 1255 | ||
1255 | ep = get_endpoint(alts, 0)->bEndpointAddress; | 1256 | ep = get_endpoint(alts, 0)->bEndpointAddress; |
1256 | /* if endpoint has sampling rate control, set it */ | 1257 | /* if endpoint has sampling rate control, set it */ |
1257 | if (fmt->attributes & EP_CS_ATTR_SAMPLE_RATE) { | 1258 | if (fmt->attributes & UAC_EP_CS_ATTR_SAMPLE_RATE) { |
1258 | int crate; | 1259 | int crate; |
1259 | data[0] = rate; | 1260 | data[0] = rate; |
1260 | data[1] = rate >> 8; | 1261 | data[1] = rate >> 8; |
1261 | data[2] = rate >> 16; | 1262 | data[2] = rate >> 16; |
1262 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, | 1263 | if ((err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), UAC_SET_CUR, |
1263 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, | 1264 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, |
1264 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { | 1265 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, data, 3, 1000)) < 0) { |
1265 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep %#x\n", | 1266 | snd_printk(KERN_ERR "%d:%d:%d: cannot set freq %d to ep %#x\n", |
1266 | dev->devnum, iface, fmt->altsetting, rate, ep); | 1267 | dev->devnum, iface, fmt->altsetting, rate, ep); |
1267 | return err; | 1268 | return err; |
1268 | } | 1269 | } |
1269 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, | 1270 | if ((err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC_GET_CUR, |
1270 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN, | 1271 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN, |
1271 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) { | 1272 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, data, 3, 1000)) < 0) { |
1272 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep %#x\n", | 1273 | snd_printk(KERN_WARNING "%d:%d:%d: cannot get freq at ep %#x\n", |
1273 | dev->devnum, iface, fmt->altsetting, ep); | 1274 | dev->devnum, iface, fmt->altsetting, ep); |
1274 | return 0; /* some devices don't support reading */ | 1275 | return 0; /* some devices don't support reading */ |
@@ -1386,9 +1387,9 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
1386 | * descriptors which fool us. if it has only one EP, | 1387 | * descriptors which fool us. if it has only one EP, |
1387 | * assume it as adaptive-out or sync-in. | 1388 | * assume it as adaptive-out or sync-in. |
1388 | */ | 1389 | */ |
1389 | attr = fmt->ep_attr & EP_ATTR_MASK; | 1390 | attr = fmt->ep_attr & USB_ENDPOINT_SYNCTYPE; |
1390 | if (((is_playback && attr == EP_ATTR_ASYNC) || | 1391 | if (((is_playback && attr == USB_ENDPOINT_SYNC_ASYNC) || |
1391 | (! is_playback && attr == EP_ATTR_ADAPTIVE)) && | 1392 | (! is_playback && attr == USB_ENDPOINT_SYNC_ADAPTIVE)) && |
1392 | altsd->bNumEndpoints >= 2) { | 1393 | altsd->bNumEndpoints >= 2) { |
1393 | /* check sync-pipe endpoint */ | 1394 | /* check sync-pipe endpoint */ |
1394 | /* ... and check descriptor size before accessing bSynchAddress | 1395 | /* ... and check descriptor size before accessing bSynchAddress |
@@ -1428,7 +1429,7 @@ static int set_format(struct snd_usb_substream *subs, struct audioformat *fmt) | |||
1428 | } | 1429 | } |
1429 | 1430 | ||
1430 | /* always fill max packet size */ | 1431 | /* always fill max packet size */ |
1431 | if (fmt->attributes & EP_CS_ATTR_FILL_MAX) | 1432 | if (fmt->attributes & UAC_EP_CS_ATTR_FILL_MAX) |
1432 | subs->fill_max = 1; | 1433 | subs->fill_max = 1; |
1433 | 1434 | ||
1434 | if ((err = init_usb_pitch(dev, subs->interface, alts, fmt)) < 0) | 1435 | if ((err = init_usb_pitch(dev, subs->interface, alts, fmt)) < 0) |
@@ -1886,7 +1887,7 @@ static int setup_hw_info(struct snd_pcm_runtime *runtime, struct snd_usb_substre | |||
1886 | runtime->hw.channels_min = fp->channels; | 1887 | runtime->hw.channels_min = fp->channels; |
1887 | if (runtime->hw.channels_max < fp->channels) | 1888 | if (runtime->hw.channels_max < fp->channels) |
1888 | runtime->hw.channels_max = fp->channels; | 1889 | runtime->hw.channels_max = fp->channels; |
1889 | if (fp->fmt_type == USB_FORMAT_TYPE_II && fp->frame_size > 0) { | 1890 | if (fp->fmt_type == UAC_FORMAT_TYPE_II && fp->frame_size > 0) { |
1890 | /* FIXME: there might be more than one audio formats... */ | 1891 | /* FIXME: there might be more than one audio formats... */ |
1891 | runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = | 1892 | runtime->hw.period_bytes_min = runtime->hw.period_bytes_max = |
1892 | fp->frame_size; | 1893 | fp->frame_size; |
@@ -2120,7 +2121,7 @@ static struct usb_device_id usb_audio_ids [] = { | |||
2120 | #include "usbquirks.h" | 2121 | #include "usbquirks.h" |
2121 | { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS), | 2122 | { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS), |
2122 | .bInterfaceClass = USB_CLASS_AUDIO, | 2123 | .bInterfaceClass = USB_CLASS_AUDIO, |
2123 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL }, | 2124 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL }, |
2124 | { } /* Terminating entry */ | 2125 | { } /* Terminating entry */ |
2125 | }; | 2126 | }; |
2126 | 2127 | ||
@@ -2159,7 +2160,7 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s | |||
2159 | snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", | 2160 | snd_iprintf(buffer, " Endpoint: %d %s (%s)\n", |
2160 | fp->endpoint & USB_ENDPOINT_NUMBER_MASK, | 2161 | fp->endpoint & USB_ENDPOINT_NUMBER_MASK, |
2161 | fp->endpoint & USB_DIR_IN ? "IN" : "OUT", | 2162 | fp->endpoint & USB_DIR_IN ? "IN" : "OUT", |
2162 | sync_types[(fp->ep_attr & EP_ATTR_MASK) >> 2]); | 2163 | sync_types[(fp->ep_attr & USB_ENDPOINT_SYNCTYPE) >> 2]); |
2163 | if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) { | 2164 | if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS) { |
2164 | snd_iprintf(buffer, " Rates: %d - %d (continuous)\n", | 2165 | snd_iprintf(buffer, " Rates: %d - %d (continuous)\n", |
2165 | fp->rate_min, fp->rate_max); | 2166 | fp->rate_min, fp->rate_max); |
@@ -2471,11 +2472,11 @@ static int parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
2471 | pcm_format = -1; | 2472 | pcm_format = -1; |
2472 | 2473 | ||
2473 | switch (format) { | 2474 | switch (format) { |
2474 | case 0: /* some devices don't define this correctly... */ | 2475 | case UAC_FORMAT_TYPE_I_UNDEFINED: /* some devices don't define this correctly... */ |
2475 | snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n", | 2476 | snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n", |
2476 | chip->dev->devnum, fp->iface, fp->altsetting); | 2477 | chip->dev->devnum, fp->iface, fp->altsetting); |
2477 | /* fall-through */ | 2478 | /* fall-through */ |
2478 | case USB_AUDIO_FORMAT_PCM: | 2479 | case UAC_FORMAT_TYPE_I_PCM: |
2479 | if (sample_width > sample_bytes * 8) { | 2480 | if (sample_width > sample_bytes * 8) { |
2480 | snd_printk(KERN_INFO "%d:%u:%d : sample bitwidth %d in over sample bytes %d\n", | 2481 | snd_printk(KERN_INFO "%d:%u:%d : sample bitwidth %d in over sample bytes %d\n", |
2481 | chip->dev->devnum, fp->iface, fp->altsetting, | 2482 | chip->dev->devnum, fp->iface, fp->altsetting, |
@@ -2509,7 +2510,7 @@ static int parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
2509 | break; | 2510 | break; |
2510 | } | 2511 | } |
2511 | break; | 2512 | break; |
2512 | case USB_AUDIO_FORMAT_PCM8: | 2513 | case UAC_FORMAT_TYPE_I_PCM8: |
2513 | pcm_format = SNDRV_PCM_FORMAT_U8; | 2514 | pcm_format = SNDRV_PCM_FORMAT_U8; |
2514 | 2515 | ||
2515 | /* Dallas DS4201 workaround: it advertises U8 format, but really | 2516 | /* Dallas DS4201 workaround: it advertises U8 format, but really |
@@ -2517,13 +2518,13 @@ static int parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
2517 | if (chip->usb_id == USB_ID(0x04fa, 0x4201)) | 2518 | if (chip->usb_id == USB_ID(0x04fa, 0x4201)) |
2518 | pcm_format = SNDRV_PCM_FORMAT_S8; | 2519 | pcm_format = SNDRV_PCM_FORMAT_S8; |
2519 | break; | 2520 | break; |
2520 | case USB_AUDIO_FORMAT_IEEE_FLOAT: | 2521 | case UAC_FORMAT_TYPE_I_IEEE_FLOAT: |
2521 | pcm_format = SNDRV_PCM_FORMAT_FLOAT_LE; | 2522 | pcm_format = SNDRV_PCM_FORMAT_FLOAT_LE; |
2522 | break; | 2523 | break; |
2523 | case USB_AUDIO_FORMAT_ALAW: | 2524 | case UAC_FORMAT_TYPE_I_ALAW: |
2524 | pcm_format = SNDRV_PCM_FORMAT_A_LAW; | 2525 | pcm_format = SNDRV_PCM_FORMAT_A_LAW; |
2525 | break; | 2526 | break; |
2526 | case USB_AUDIO_FORMAT_MU_LAW: | 2527 | case UAC_FORMAT_TYPE_I_MULAW: |
2527 | pcm_format = SNDRV_PCM_FORMAT_MU_LAW; | 2528 | pcm_format = SNDRV_PCM_FORMAT_MU_LAW; |
2528 | break; | 2529 | break; |
2529 | default: | 2530 | default: |
@@ -2551,7 +2552,7 @@ static int parse_audio_format_rates_v1(struct snd_usb_audio *chip, struct audiof | |||
2551 | int nr_rates = fmt[offset]; | 2552 | int nr_rates = fmt[offset]; |
2552 | 2553 | ||
2553 | if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) { | 2554 | if (fmt[0] < offset + 1 + 3 * (nr_rates ? nr_rates : 2)) { |
2554 | snd_printk(KERN_ERR "%d:%u:%d : invalid FORMAT_TYPE desc\n", | 2555 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_FORMAT_TYPE desc\n", |
2555 | chip->dev->devnum, fp->iface, fp->altsetting); | 2556 | chip->dev->devnum, fp->iface, fp->altsetting); |
2556 | return -1; | 2557 | return -1; |
2557 | } | 2558 | } |
@@ -2614,7 +2615,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
2614 | int i, nr_rates, data_size, ret = 0; | 2615 | int i, nr_rates, data_size, ret = 0; |
2615 | 2616 | ||
2616 | /* get the number of sample rates first by only fetching 2 bytes */ | 2617 | /* get the number of sample rates first by only fetching 2 bytes */ |
2617 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), CS_RANGE, | 2618 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, |
2618 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, | 2619 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, |
2619 | 0x0100, chip->clock_id << 8, tmp, sizeof(tmp), 1000); | 2620 | 0x0100, chip->clock_id << 8, tmp, sizeof(tmp), 1000); |
2620 | 2621 | ||
@@ -2632,7 +2633,7 @@ static int parse_audio_format_rates_v2(struct snd_usb_audio *chip, | |||
2632 | } | 2633 | } |
2633 | 2634 | ||
2634 | /* now get the full information */ | 2635 | /* now get the full information */ |
2635 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), CS_RANGE, | 2636 | ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_RANGE, |
2636 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, | 2637 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, |
2637 | 0x0100, chip->clock_id << 8, data, data_size, 1000); | 2638 | 0x0100, chip->clock_id << 8, data, data_size, 1000); |
2638 | 2639 | ||
@@ -2682,7 +2683,7 @@ static int parse_audio_format_i(struct snd_usb_audio *chip, | |||
2682 | int protocol = altsd->bInterfaceProtocol; | 2683 | int protocol = altsd->bInterfaceProtocol; |
2683 | int pcm_format, ret; | 2684 | int pcm_format, ret; |
2684 | 2685 | ||
2685 | if (fmt->bFormatType == USB_FORMAT_TYPE_III) { | 2686 | if (fmt->bFormatType == UAC_FORMAT_TYPE_III) { |
2686 | /* FIXME: the format type is really IECxxx | 2687 | /* FIXME: the format type is really IECxxx |
2687 | * but we give normal PCM format to get the existing | 2688 | * but we give normal PCM format to get the existing |
2688 | * apps working... | 2689 | * apps working... |
@@ -2745,12 +2746,12 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
2745 | int protocol = altsd->bInterfaceProtocol; | 2746 | int protocol = altsd->bInterfaceProtocol; |
2746 | 2747 | ||
2747 | switch (format) { | 2748 | switch (format) { |
2748 | case USB_AUDIO_FORMAT_AC3: | 2749 | case UAC_FORMAT_TYPE_II_AC3: |
2749 | /* FIXME: there is no AC3 format defined yet */ | 2750 | /* FIXME: there is no AC3 format defined yet */ |
2750 | // fp->format = SNDRV_PCM_FORMAT_AC3; | 2751 | // fp->format = SNDRV_PCM_FORMAT_AC3; |
2751 | fp->format = SNDRV_PCM_FORMAT_U8; /* temporarily hack to receive byte streams */ | 2752 | fp->format = SNDRV_PCM_FORMAT_U8; /* temporarily hack to receive byte streams */ |
2752 | break; | 2753 | break; |
2753 | case USB_AUDIO_FORMAT_MPEG: | 2754 | case UAC_FORMAT_TYPE_II_MPEG: |
2754 | fp->format = SNDRV_PCM_FORMAT_MPEG; | 2755 | fp->format = SNDRV_PCM_FORMAT_MPEG; |
2755 | break; | 2756 | break; |
2756 | default: | 2757 | default: |
@@ -2793,11 +2794,11 @@ static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp | |||
2793 | int err; | 2794 | int err; |
2794 | 2795 | ||
2795 | switch (fmt[3]) { | 2796 | switch (fmt[3]) { |
2796 | case USB_FORMAT_TYPE_I: | 2797 | case UAC_FORMAT_TYPE_I: |
2797 | case USB_FORMAT_TYPE_III: | 2798 | case UAC_FORMAT_TYPE_III: |
2798 | err = parse_audio_format_i(chip, fp, format, fmt, iface); | 2799 | err = parse_audio_format_i(chip, fp, format, fmt, iface); |
2799 | break; | 2800 | break; |
2800 | case USB_FORMAT_TYPE_II: | 2801 | case UAC_FORMAT_TYPE_II: |
2801 | err = parse_audio_format_ii(chip, fp, format, fmt, iface); | 2802 | err = parse_audio_format_ii(chip, fp, format, fmt, iface); |
2802 | break; | 2803 | break; |
2803 | default: | 2804 | default: |
@@ -2816,7 +2817,7 @@ static int parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp | |||
2816 | if (chip->usb_id == USB_ID(0x041e, 0x3000) || | 2817 | if (chip->usb_id == USB_ID(0x041e, 0x3000) || |
2817 | chip->usb_id == USB_ID(0x041e, 0x3020) || | 2818 | chip->usb_id == USB_ID(0x041e, 0x3020) || |
2818 | chip->usb_id == USB_ID(0x041e, 0x3061)) { | 2819 | chip->usb_id == USB_ID(0x041e, 0x3061)) { |
2819 | if (fmt[3] == USB_FORMAT_TYPE_I && | 2820 | if (fmt[3] == UAC_FORMAT_TYPE_I && |
2820 | fp->rates != SNDRV_PCM_RATE_48000 && | 2821 | fp->rates != SNDRV_PCM_RATE_48000 && |
2821 | fp->rates != SNDRV_PCM_RATE_96000) | 2822 | fp->rates != SNDRV_PCM_RATE_96000) |
2822 | return -1; | 2823 | return -1; |
@@ -2871,7 +2872,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2871 | /* skip invalid one */ | 2872 | /* skip invalid one */ |
2872 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && | 2873 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && |
2873 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || | 2874 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || |
2874 | (altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIO_STREAMING && | 2875 | (altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING && |
2875 | altsd->bInterfaceSubClass != USB_SUBCLASS_VENDOR_SPEC) || | 2876 | altsd->bInterfaceSubClass != USB_SUBCLASS_VENDOR_SPEC) || |
2876 | altsd->bNumEndpoints < 1 || | 2877 | altsd->bNumEndpoints < 1 || |
2877 | le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) == 0) | 2878 | le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) == 0) |
@@ -2895,16 +2896,16 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2895 | switch (protocol) { | 2896 | switch (protocol) { |
2896 | case UAC_VERSION_1: { | 2897 | case UAC_VERSION_1: { |
2897 | struct uac_as_header_descriptor_v1 *as = | 2898 | struct uac_as_header_descriptor_v1 *as = |
2898 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, AS_GENERAL); | 2899 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); |
2899 | 2900 | ||
2900 | if (!as) { | 2901 | if (!as) { |
2901 | snd_printk(KERN_ERR "%d:%u:%d : AS_GENERAL descriptor not found\n", | 2902 | snd_printk(KERN_ERR "%d:%u:%d : UAC_AS_GENERAL descriptor not found\n", |
2902 | dev->devnum, iface_no, altno); | 2903 | dev->devnum, iface_no, altno); |
2903 | continue; | 2904 | continue; |
2904 | } | 2905 | } |
2905 | 2906 | ||
2906 | if (as->bLength < sizeof(*as)) { | 2907 | if (as->bLength < sizeof(*as)) { |
2907 | snd_printk(KERN_ERR "%d:%u:%d : invalid AS_GENERAL desc\n", | 2908 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_AS_GENERAL desc\n", |
2908 | dev->devnum, iface_no, altno); | 2909 | dev->devnum, iface_no, altno); |
2909 | continue; | 2910 | continue; |
2910 | } | 2911 | } |
@@ -2915,16 +2916,16 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2915 | 2916 | ||
2916 | case UAC_VERSION_2: { | 2917 | case UAC_VERSION_2: { |
2917 | struct uac_as_header_descriptor_v2 *as = | 2918 | struct uac_as_header_descriptor_v2 *as = |
2918 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, AS_GENERAL); | 2919 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); |
2919 | 2920 | ||
2920 | if (!as) { | 2921 | if (!as) { |
2921 | snd_printk(KERN_ERR "%d:%u:%d : AS_GENERAL descriptor not found\n", | 2922 | snd_printk(KERN_ERR "%d:%u:%d : UAC_AS_GENERAL descriptor not found\n", |
2922 | dev->devnum, iface_no, altno); | 2923 | dev->devnum, iface_no, altno); |
2923 | continue; | 2924 | continue; |
2924 | } | 2925 | } |
2925 | 2926 | ||
2926 | if (as->bLength < sizeof(*as)) { | 2927 | if (as->bLength < sizeof(*as)) { |
2927 | snd_printk(KERN_ERR "%d:%u:%d : invalid AS_GENERAL desc\n", | 2928 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_AS_GENERAL desc\n", |
2928 | dev->devnum, iface_no, altno); | 2929 | dev->devnum, iface_no, altno); |
2929 | continue; | 2930 | continue; |
2930 | } | 2931 | } |
@@ -2942,15 +2943,15 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2942 | } | 2943 | } |
2943 | 2944 | ||
2944 | /* get format type */ | 2945 | /* get format type */ |
2945 | fmt = snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, FORMAT_TYPE); | 2946 | fmt = snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_FORMAT_TYPE); |
2946 | if (!fmt) { | 2947 | if (!fmt) { |
2947 | snd_printk(KERN_ERR "%d:%u:%d : no FORMAT_TYPE desc\n", | 2948 | snd_printk(KERN_ERR "%d:%u:%d : no UAC_FORMAT_TYPE desc\n", |
2948 | dev->devnum, iface_no, altno); | 2949 | dev->devnum, iface_no, altno); |
2949 | continue; | 2950 | continue; |
2950 | } | 2951 | } |
2951 | if (((protocol == UAC_VERSION_1) && (fmt[0] < 8)) || | 2952 | if (((protocol == UAC_VERSION_1) && (fmt[0] < 8)) || |
2952 | ((protocol == UAC_VERSION_2) && (fmt[0] != 6))) { | 2953 | ((protocol == UAC_VERSION_2) && (fmt[0] != 6))) { |
2953 | snd_printk(KERN_ERR "%d:%u:%d : invalid FORMAT_TYPE desc\n", | 2954 | snd_printk(KERN_ERR "%d:%u:%d : invalid UAC_FORMAT_TYPE desc\n", |
2954 | dev->devnum, iface_no, altno); | 2955 | dev->devnum, iface_no, altno); |
2955 | continue; | 2956 | continue; |
2956 | } | 2957 | } |
@@ -2972,7 +2973,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
2972 | /* Creamware Noah has this descriptor after the 2nd endpoint */ | 2973 | /* Creamware Noah has this descriptor after the 2nd endpoint */ |
2973 | if (!csep && altsd->bNumEndpoints >= 2) | 2974 | if (!csep && altsd->bNumEndpoints >= 2) |
2974 | csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT); | 2975 | csep = snd_usb_find_desc(alts->endpoint[1].extra, alts->endpoint[1].extralen, NULL, USB_DT_CS_ENDPOINT); |
2975 | if (!csep || csep[0] < 7 || csep[2] != EP_GENERAL) { | 2976 | if (!csep || csep[0] < 7 || csep[2] != UAC_EP_GENERAL) { |
2976 | snd_printk(KERN_WARNING "%d:%u:%d : no or invalid" | 2977 | snd_printk(KERN_WARNING "%d:%u:%d : no or invalid" |
2977 | " class specific endpoint descriptor\n", | 2978 | " class specific endpoint descriptor\n", |
2978 | dev->devnum, iface_no, altno); | 2979 | dev->devnum, iface_no, altno); |
@@ -3006,12 +3007,12 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
3006 | /* Optoplay sets the sample rate attribute although | 3007 | /* Optoplay sets the sample rate attribute although |
3007 | * it seems not supporting it in fact. | 3008 | * it seems not supporting it in fact. |
3008 | */ | 3009 | */ |
3009 | fp->attributes &= ~EP_CS_ATTR_SAMPLE_RATE; | 3010 | fp->attributes &= ~UAC_EP_CS_ATTR_SAMPLE_RATE; |
3010 | break; | 3011 | break; |
3011 | case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */ | 3012 | case USB_ID(0x041e, 0x3020): /* Creative SB Audigy 2 NX */ |
3012 | case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ | 3013 | case USB_ID(0x0763, 0x2003): /* M-Audio Audiophile USB */ |
3013 | /* doesn't set the sample rate attribute, but supports it */ | 3014 | /* doesn't set the sample rate attribute, but supports it */ |
3014 | fp->attributes |= EP_CS_ATTR_SAMPLE_RATE; | 3015 | fp->attributes |= UAC_EP_CS_ATTR_SAMPLE_RATE; |
3015 | break; | 3016 | break; |
3016 | case USB_ID(0x047f, 0x0ca1): /* plantronics headset */ | 3017 | case USB_ID(0x047f, 0x0ca1): /* plantronics headset */ |
3017 | case USB_ID(0x077d, 0x07af): /* Griffin iMic (note that there is | 3018 | case USB_ID(0x077d, 0x07af): /* Griffin iMic (note that there is |
@@ -3020,11 +3021,11 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
3020 | * plantronics headset and Griffin iMic have set adaptive-in | 3021 | * plantronics headset and Griffin iMic have set adaptive-in |
3021 | * although it's really not... | 3022 | * although it's really not... |
3022 | */ | 3023 | */ |
3023 | fp->ep_attr &= ~EP_ATTR_MASK; | 3024 | fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE; |
3024 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 3025 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) |
3025 | fp->ep_attr |= EP_ATTR_ADAPTIVE; | 3026 | fp->ep_attr |= USB_ENDPOINT_SYNC_ADAPTIVE; |
3026 | else | 3027 | else |
3027 | fp->ep_attr |= EP_ATTR_SYNC; | 3028 | fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC; |
3028 | break; | 3029 | break; |
3029 | } | 3030 | } |
3030 | 3031 | ||
@@ -3094,7 +3095,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
3094 | altsd = get_iface_desc(alts); | 3095 | altsd = get_iface_desc(alts); |
3095 | if ((altsd->bInterfaceClass == USB_CLASS_AUDIO || | 3096 | if ((altsd->bInterfaceClass == USB_CLASS_AUDIO || |
3096 | altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) && | 3097 | altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) && |
3097 | altsd->bInterfaceSubClass == USB_SUBCLASS_MIDI_STREAMING) { | 3098 | altsd->bInterfaceSubClass == USB_SUBCLASS_MIDISTREAMING) { |
3098 | int err = snd_usbmidi_create(chip->card, iface, | 3099 | int err = snd_usbmidi_create(chip->card, iface, |
3099 | &chip->midi_list, NULL); | 3100 | &chip->midi_list, NULL); |
3100 | if (err < 0) { | 3101 | if (err < 0) { |
@@ -3109,7 +3110,7 @@ static int snd_usb_create_stream(struct snd_usb_audio *chip, int ctrlif, int int | |||
3109 | 3110 | ||
3110 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && | 3111 | if ((altsd->bInterfaceClass != USB_CLASS_AUDIO && |
3111 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || | 3112 | altsd->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || |
3112 | altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIO_STREAMING) { | 3113 | altsd->bInterfaceSubClass != USB_SUBCLASS_AUDIOSTREAMING) { |
3113 | snd_printdd(KERN_ERR "%d:%u:%d: skipping non-supported interface %d\n", | 3114 | snd_printdd(KERN_ERR "%d:%u:%d: skipping non-supported interface %d\n", |
3114 | dev->devnum, ctrlif, interface, altsd->bInterfaceClass); | 3115 | dev->devnum, ctrlif, interface, altsd->bInterfaceClass); |
3115 | /* skip non-supported classes */ | 3116 | /* skip non-supported classes */ |
@@ -3145,12 +3146,12 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
3145 | host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0]; | 3146 | host_iface = &usb_ifnum_to_if(dev, ctrlif)->altsetting[0]; |
3146 | control_header = snd_usb_find_csint_desc(host_iface->extra, | 3147 | control_header = snd_usb_find_csint_desc(host_iface->extra, |
3147 | host_iface->extralen, | 3148 | host_iface->extralen, |
3148 | NULL, HEADER); | 3149 | NULL, UAC_HEADER); |
3149 | altsd = get_iface_desc(host_iface); | 3150 | altsd = get_iface_desc(host_iface); |
3150 | protocol = altsd->bInterfaceProtocol; | 3151 | protocol = altsd->bInterfaceProtocol; |
3151 | 3152 | ||
3152 | if (!control_header) { | 3153 | if (!control_header) { |
3153 | snd_printk(KERN_ERR "cannot find HEADER\n"); | 3154 | snd_printk(KERN_ERR "cannot find UAC_HEADER\n"); |
3154 | return -EINVAL; | 3155 | return -EINVAL; |
3155 | } | 3156 | } |
3156 | 3157 | ||
@@ -3164,7 +3165,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
3164 | } | 3165 | } |
3165 | 3166 | ||
3166 | if (h1->bLength < sizeof(*h1) + h1->bInCollection) { | 3167 | if (h1->bLength < sizeof(*h1) + h1->bInCollection) { |
3167 | snd_printk(KERN_ERR "invalid HEADER (v1)\n"); | 3168 | snd_printk(KERN_ERR "invalid UAC_HEADER (v1)\n"); |
3168 | return -EINVAL; | 3169 | return -EINVAL; |
3169 | } | 3170 | } |
3170 | 3171 | ||
@@ -3190,7 +3191,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
3190 | * clock selectors and sample rate conversion units. */ | 3191 | * clock selectors and sample rate conversion units. */ |
3191 | 3192 | ||
3192 | cs = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, | 3193 | cs = snd_usb_find_csint_desc(host_iface->extra, host_iface->extralen, |
3193 | NULL, CLOCK_SOURCE); | 3194 | NULL, UAC_CLOCK_SOURCE); |
3194 | 3195 | ||
3195 | if (!cs) { | 3196 | if (!cs) { |
3196 | snd_printk(KERN_ERR "CLOCK_SOURCE descriptor not found\n"); | 3197 | snd_printk(KERN_ERR "CLOCK_SOURCE descriptor not found\n"); |
@@ -3302,7 +3303,7 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip, | |||
3302 | static const struct audioformat ua_format = { | 3303 | static const struct audioformat ua_format = { |
3303 | .format = SNDRV_PCM_FORMAT_S24_3LE, | 3304 | .format = SNDRV_PCM_FORMAT_S24_3LE, |
3304 | .channels = 2, | 3305 | .channels = 2, |
3305 | .fmt_type = USB_FORMAT_TYPE_I, | 3306 | .fmt_type = UAC_FORMAT_TYPE_I, |
3306 | .altsetting = 1, | 3307 | .altsetting = 1, |
3307 | .altset_idx = 1, | 3308 | .altset_idx = 1, |
3308 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | 3309 | .rates = SNDRV_PCM_RATE_CONTINUOUS, |
@@ -3394,7 +3395,7 @@ static int create_ua1000_quirk(struct snd_usb_audio *chip, | |||
3394 | { | 3395 | { |
3395 | static const struct audioformat ua1000_format = { | 3396 | static const struct audioformat ua1000_format = { |
3396 | .format = SNDRV_PCM_FORMAT_S32_LE, | 3397 | .format = SNDRV_PCM_FORMAT_S32_LE, |
3397 | .fmt_type = USB_FORMAT_TYPE_I, | 3398 | .fmt_type = UAC_FORMAT_TYPE_I, |
3398 | .altsetting = 1, | 3399 | .altsetting = 1, |
3399 | .altset_idx = 1, | 3400 | .altset_idx = 1, |
3400 | .attributes = 0, | 3401 | .attributes = 0, |
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 26daf68631eb..6b016d4aac6b 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -21,106 +21,6 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | |||
25 | /* | ||
26 | */ | ||
27 | |||
28 | #define USB_SUBCLASS_AUDIO_CONTROL 0x01 | ||
29 | #define USB_SUBCLASS_AUDIO_STREAMING 0x02 | ||
30 | #define USB_SUBCLASS_MIDI_STREAMING 0x03 | ||
31 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
32 | |||
33 | #define HEADER 0x01 | ||
34 | #define INPUT_TERMINAL 0x02 | ||
35 | #define OUTPUT_TERMINAL 0x03 | ||
36 | #define MIXER_UNIT 0x04 | ||
37 | #define SELECTOR_UNIT 0x05 | ||
38 | #define FEATURE_UNIT 0x06 | ||
39 | #define PROCESSING_UNIT_V1 0x07 | ||
40 | #define EXTENSION_UNIT_V1 0x08 | ||
41 | |||
42 | /* audio class v2 */ | ||
43 | #define EFFECT_UNIT 0x07 | ||
44 | #define PROCESSING_UNIT_V2 0x08 | ||
45 | #define EXTENSION_UNIT_V2 0x09 | ||
46 | #define CLOCK_SOURCE 0x0a | ||
47 | #define CLOCK_SELECTOR 0x0b | ||
48 | #define CLOCK_MULTIPLIER 0x0c | ||
49 | #define SAMPLE_RATE_CONVERTER 0x0d | ||
50 | |||
51 | #define AS_GENERAL 0x01 | ||
52 | #define FORMAT_TYPE 0x02 | ||
53 | #define FORMAT_SPECIFIC 0x03 | ||
54 | |||
55 | #define EP_GENERAL 0x01 | ||
56 | |||
57 | #define MS_GENERAL 0x01 | ||
58 | #define MIDI_IN_JACK 0x02 | ||
59 | #define MIDI_OUT_JACK 0x03 | ||
60 | |||
61 | /* endpoint attributes */ | ||
62 | #define EP_ATTR_MASK 0x0c | ||
63 | #define EP_ATTR_ASYNC 0x04 | ||
64 | #define EP_ATTR_ADAPTIVE 0x08 | ||
65 | #define EP_ATTR_SYNC 0x0c | ||
66 | |||
67 | /* cs endpoint attributes */ | ||
68 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
69 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
70 | #define EP_CS_ATTR_FILL_MAX 0x80 | ||
71 | |||
72 | /* Audio Class specific Request Codes (v1) */ | ||
73 | |||
74 | #define SET_CUR 0x01 | ||
75 | #define GET_CUR 0x81 | ||
76 | #define SET_MIN 0x02 | ||
77 | #define GET_MIN 0x82 | ||
78 | #define SET_MAX 0x03 | ||
79 | #define GET_MAX 0x83 | ||
80 | #define SET_RES 0x04 | ||
81 | #define GET_RES 0x84 | ||
82 | #define SET_MEM 0x05 | ||
83 | #define GET_MEM 0x85 | ||
84 | #define GET_STAT 0xff | ||
85 | |||
86 | /* Audio Class specific Request Codes (v2) */ | ||
87 | #define CS_CUR 0x01 | ||
88 | #define CS_RANGE 0x02 | ||
89 | |||
90 | /* Terminal Control Selectors */ | ||
91 | |||
92 | #define COPY_PROTECT_CONTROL 0x01 | ||
93 | |||
94 | /* Endpoint Control Selectors */ | ||
95 | |||
96 | #define SAMPLING_FREQ_CONTROL 0x01 | ||
97 | #define PITCH_CONTROL 0x02 | ||
98 | |||
99 | /* Format Types */ | ||
100 | #define USB_FORMAT_TYPE_I 0x01 | ||
101 | #define USB_FORMAT_TYPE_II 0x02 | ||
102 | #define USB_FORMAT_TYPE_III 0x03 | ||
103 | |||
104 | /* type I */ | ||
105 | #define USB_AUDIO_FORMAT_PCM 0x01 | ||
106 | #define USB_AUDIO_FORMAT_PCM8 0x02 | ||
107 | #define USB_AUDIO_FORMAT_IEEE_FLOAT 0x03 | ||
108 | #define USB_AUDIO_FORMAT_ALAW 0x04 | ||
109 | #define USB_AUDIO_FORMAT_MU_LAW 0x05 | ||
110 | |||
111 | /* type II */ | ||
112 | #define USB_AUDIO_FORMAT_MPEG 0x1001 | ||
113 | #define USB_AUDIO_FORMAT_AC3 0x1002 | ||
114 | |||
115 | /* type III */ | ||
116 | #define USB_AUDIO_FORMAT_IEC1937_AC3 0x2001 | ||
117 | #define USB_AUDIO_FORMAT_IEC1937_MPEG1_LAYER1 0x2002 | ||
118 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_NOEXT 0x2003 | ||
119 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_EXT 0x2004 | ||
120 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
121 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
122 | |||
123 | |||
124 | /* maximum number of endpoints per interface */ | 24 | /* maximum number of endpoints per interface */ |
125 | #define MIDI_MAX_ENDPOINTS 2 | 25 | #define MIDI_MAX_ENDPOINTS 2 |
126 | 26 | ||
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index b2da478a0fae..2c59afd99611 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #include <linux/timer.h> | 46 | #include <linux/timer.h> |
47 | #include <linux/usb.h> | 47 | #include <linux/usb.h> |
48 | #include <linux/wait.h> | 48 | #include <linux/wait.h> |
49 | #include <linux/usb/audio.h> | ||
50 | |||
49 | #include <sound/core.h> | 51 | #include <sound/core.h> |
50 | #include <sound/control.h> | 52 | #include <sound/control.h> |
51 | #include <sound/rawmidi.h> | 53 | #include <sound/rawmidi.h> |
@@ -1540,7 +1542,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1540 | if (hostif->extralen >= 7 && | 1542 | if (hostif->extralen >= 7 && |
1541 | ms_header->bLength >= 7 && | 1543 | ms_header->bLength >= 7 && |
1542 | ms_header->bDescriptorType == USB_DT_CS_INTERFACE && | 1544 | ms_header->bDescriptorType == USB_DT_CS_INTERFACE && |
1543 | ms_header->bDescriptorSubtype == HEADER) | 1545 | ms_header->bDescriptorSubtype == UAC_HEADER) |
1544 | snd_printdd(KERN_INFO "MIDIStreaming version %02x.%02x\n", | 1546 | snd_printdd(KERN_INFO "MIDIStreaming version %02x.%02x\n", |
1545 | ms_header->bcdMSC[1], ms_header->bcdMSC[0]); | 1547 | ms_header->bcdMSC[1], ms_header->bcdMSC[0]); |
1546 | else | 1548 | else |
@@ -1556,7 +1558,7 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi* umidi, | |||
1556 | if (hostep->extralen < 4 || | 1558 | if (hostep->extralen < 4 || |
1557 | ms_ep->bLength < 4 || | 1559 | ms_ep->bLength < 4 || |
1558 | ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || | 1560 | ms_ep->bDescriptorType != USB_DT_CS_ENDPOINT || |
1559 | ms_ep->bDescriptorSubtype != MS_GENERAL) | 1561 | ms_ep->bDescriptorSubtype != UAC_MS_GENERAL) |
1560 | continue; | 1562 | continue; |
1561 | if (usb_endpoint_dir_out(ep)) { | 1563 | if (usb_endpoint_dir_out(ep)) { |
1562 | if (endpoints[epidx].out_ep) { | 1564 | if (endpoints[epidx].out_ep) { |
@@ -1768,9 +1770,9 @@ static int snd_usbmidi_detect_yamaha(struct snd_usb_midi* umidi, | |||
1768 | cs_desc < hostif->extra + hostif->extralen && cs_desc[0] >= 2; | 1770 | cs_desc < hostif->extra + hostif->extralen && cs_desc[0] >= 2; |
1769 | cs_desc += cs_desc[0]) { | 1771 | cs_desc += cs_desc[0]) { |
1770 | if (cs_desc[1] == USB_DT_CS_INTERFACE) { | 1772 | if (cs_desc[1] == USB_DT_CS_INTERFACE) { |
1771 | if (cs_desc[2] == MIDI_IN_JACK) | 1773 | if (cs_desc[2] == UAC_MIDI_IN_JACK) |
1772 | endpoint->in_cables = (endpoint->in_cables << 1) | 1; | 1774 | endpoint->in_cables = (endpoint->in_cables << 1) | 1; |
1773 | else if (cs_desc[2] == MIDI_OUT_JACK) | 1775 | else if (cs_desc[2] == UAC_MIDI_OUT_JACK) |
1774 | endpoint->out_cables = (endpoint->out_cables << 1) | 1; | 1776 | endpoint->out_cables = (endpoint->out_cables << 1) | 1; |
1775 | } | 1777 | } |
1776 | } | 1778 | } |
diff --git a/sound/usb/usbmixer.c b/sound/usb/usbmixer.c index 42bb95c739a8..8e8f871b74ca 100644 --- a/sound/usb/usbmixer.c +++ b/sound/usb/usbmixer.c | |||
@@ -286,7 +286,7 @@ static void *find_audio_control_unit(struct mixer_build *state, unsigned char un | |||
286 | p = NULL; | 286 | p = NULL; |
287 | while ((p = snd_usb_find_desc(state->buffer, state->buflen, p, | 287 | while ((p = snd_usb_find_desc(state->buffer, state->buflen, p, |
288 | USB_DT_CS_INTERFACE)) != NULL) { | 288 | USB_DT_CS_INTERFACE)) != NULL) { |
289 | if (p[0] >= 4 && p[2] >= INPUT_TERMINAL && p[2] <= EXTENSION_UNIT_V1 && p[3] == unit) | 289 | if (p[0] >= 4 && p[2] >= UAC_INPUT_TERMINAL && p[2] <= UAC_EXTENSION_UNIT_V1 && p[3] == unit) |
290 | return p; | 290 | return p; |
291 | } | 291 | } |
292 | return NULL; | 292 | return NULL; |
@@ -407,14 +407,14 @@ static int get_ctl_value(struct usb_mixer_elem_info *cval, int request, int vali | |||
407 | 407 | ||
408 | static int get_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int *value) | 408 | static int get_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int *value) |
409 | { | 409 | { |
410 | return get_ctl_value(cval, GET_CUR, validx, value); | 410 | return get_ctl_value(cval, UAC_GET_CUR, validx, value); |
411 | } | 411 | } |
412 | 412 | ||
413 | /* channel = 0: master, 1 = first channel */ | 413 | /* channel = 0: master, 1 = first channel */ |
414 | static inline int get_cur_mix_raw(struct usb_mixer_elem_info *cval, | 414 | static inline int get_cur_mix_raw(struct usb_mixer_elem_info *cval, |
415 | int channel, int *value) | 415 | int channel, int *value) |
416 | { | 416 | { |
417 | return get_ctl_value(cval, GET_CUR, (cval->control << 8) | channel, value); | 417 | return get_ctl_value(cval, UAC_GET_CUR, (cval->control << 8) | channel, value); |
418 | } | 418 | } |
419 | 419 | ||
420 | static int get_cur_mix_value(struct usb_mixer_elem_info *cval, | 420 | static int get_cur_mix_value(struct usb_mixer_elem_info *cval, |
@@ -468,14 +468,14 @@ static int set_ctl_value(struct usb_mixer_elem_info *cval, int request, int vali | |||
468 | 468 | ||
469 | static int set_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int value) | 469 | static int set_cur_ctl_value(struct usb_mixer_elem_info *cval, int validx, int value) |
470 | { | 470 | { |
471 | return set_ctl_value(cval, SET_CUR, validx, value); | 471 | return set_ctl_value(cval, UAC_SET_CUR, validx, value); |
472 | } | 472 | } |
473 | 473 | ||
474 | static int set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel, | 474 | static int set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel, |
475 | int index, int value) | 475 | int index, int value) |
476 | { | 476 | { |
477 | int err; | 477 | int err; |
478 | err = set_ctl_value(cval, SET_CUR, (cval->control << 8) | channel, | 478 | err = set_ctl_value(cval, UAC_SET_CUR, (cval->control << 8) | channel, |
479 | value); | 479 | value); |
480 | if (err < 0) | 480 | if (err < 0) |
481 | return err; | 481 | return err; |
@@ -605,13 +605,13 @@ static int get_term_name(struct mixer_build *state, struct usb_audio_term *iterm | |||
605 | if (term_only) | 605 | if (term_only) |
606 | return 0; | 606 | return 0; |
607 | switch (iterm->type >> 16) { | 607 | switch (iterm->type >> 16) { |
608 | case SELECTOR_UNIT: | 608 | case UAC_SELECTOR_UNIT: |
609 | strcpy(name, "Selector"); return 8; | 609 | strcpy(name, "Selector"); return 8; |
610 | case PROCESSING_UNIT_V1: | 610 | case UAC_PROCESSING_UNIT_V1: |
611 | strcpy(name, "Process Unit"); return 12; | 611 | strcpy(name, "Process Unit"); return 12; |
612 | case EXTENSION_UNIT_V1: | 612 | case UAC_EXTENSION_UNIT_V1: |
613 | strcpy(name, "Ext Unit"); return 8; | 613 | strcpy(name, "Ext Unit"); return 8; |
614 | case MIXER_UNIT: | 614 | case UAC_MIXER_UNIT: |
615 | strcpy(name, "Mixer"); return 5; | 615 | strcpy(name, "Mixer"); return 5; |
616 | default: | 616 | default: |
617 | return sprintf(name, "Unit %d", iterm->id); | 617 | return sprintf(name, "Unit %d", iterm->id); |
@@ -650,22 +650,22 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ | |||
650 | while ((p1 = find_audio_control_unit(state, id)) != NULL) { | 650 | while ((p1 = find_audio_control_unit(state, id)) != NULL) { |
651 | term->id = id; | 651 | term->id = id; |
652 | switch (p1[2]) { | 652 | switch (p1[2]) { |
653 | case INPUT_TERMINAL: | 653 | case UAC_INPUT_TERMINAL: |
654 | term->type = combine_word(p1 + 4); | 654 | term->type = combine_word(p1 + 4); |
655 | term->channels = p1[7]; | 655 | term->channels = p1[7]; |
656 | term->chconfig = combine_word(p1 + 8); | 656 | term->chconfig = combine_word(p1 + 8); |
657 | term->name = p1[11]; | 657 | term->name = p1[11]; |
658 | return 0; | 658 | return 0; |
659 | case FEATURE_UNIT: | 659 | case UAC_FEATURE_UNIT: |
660 | id = p1[4]; | 660 | id = p1[4]; |
661 | break; /* continue to parse */ | 661 | break; /* continue to parse */ |
662 | case MIXER_UNIT: | 662 | case UAC_MIXER_UNIT: |
663 | term->type = p1[2] << 16; /* virtual type */ | 663 | term->type = p1[2] << 16; /* virtual type */ |
664 | term->channels = p1[5 + p1[4]]; | 664 | term->channels = p1[5 + p1[4]]; |
665 | term->chconfig = combine_word(p1 + 6 + p1[4]); | 665 | term->chconfig = combine_word(p1 + 6 + p1[4]); |
666 | term->name = p1[p1[0] - 1]; | 666 | term->name = p1[p1[0] - 1]; |
667 | return 0; | 667 | return 0; |
668 | case SELECTOR_UNIT: | 668 | case UAC_SELECTOR_UNIT: |
669 | /* call recursively to retrieve the channel info */ | 669 | /* call recursively to retrieve the channel info */ |
670 | if (check_input_term(state, p1[5], term) < 0) | 670 | if (check_input_term(state, p1[5], term) < 0) |
671 | return -ENODEV; | 671 | return -ENODEV; |
@@ -673,8 +673,8 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ | |||
673 | term->id = id; | 673 | term->id = id; |
674 | term->name = p1[9 + p1[0] - 1]; | 674 | term->name = p1[9 + p1[0] - 1]; |
675 | return 0; | 675 | return 0; |
676 | case PROCESSING_UNIT_V1: | 676 | case UAC_PROCESSING_UNIT_V1: |
677 | case EXTENSION_UNIT_V1: | 677 | case UAC_EXTENSION_UNIT_V1: |
678 | if (p1[6] == 1) { | 678 | if (p1[6] == 1) { |
679 | id = p1[7]; | 679 | id = p1[7]; |
680 | break; /* continue to parse */ | 680 | break; /* continue to parse */ |
@@ -752,23 +752,23 @@ static int get_min_max(struct usb_mixer_elem_info *cval, int default_min) | |||
752 | break; | 752 | break; |
753 | } | 753 | } |
754 | } | 754 | } |
755 | if (get_ctl_value(cval, GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || | 755 | if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || |
756 | get_ctl_value(cval, GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { | 756 | get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { |
757 | snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", | 757 | snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", |
758 | cval->id, cval->mixer->ctrlif, cval->control, cval->id); | 758 | cval->id, cval->mixer->ctrlif, cval->control, cval->id); |
759 | return -EINVAL; | 759 | return -EINVAL; |
760 | } | 760 | } |
761 | if (get_ctl_value(cval, GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) { | 761 | if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) { |
762 | cval->res = 1; | 762 | cval->res = 1; |
763 | } else { | 763 | } else { |
764 | int last_valid_res = cval->res; | 764 | int last_valid_res = cval->res; |
765 | 765 | ||
766 | while (cval->res > 1) { | 766 | while (cval->res > 1) { |
767 | if (set_ctl_value(cval, SET_RES, (cval->control << 8) | minchn, cval->res / 2) < 0) | 767 | if (set_ctl_value(cval, UAC_SET_RES, (cval->control << 8) | minchn, cval->res / 2) < 0) |
768 | break; | 768 | break; |
769 | cval->res /= 2; | 769 | cval->res /= 2; |
770 | } | 770 | } |
771 | if (get_ctl_value(cval, GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) | 771 | if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) |
772 | cval->res = last_valid_res; | 772 | cval->res = last_valid_res; |
773 | } | 773 | } |
774 | if (cval->res == 0) | 774 | if (cval->res == 0) |
@@ -1097,7 +1097,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void | |||
1097 | struct uac_feature_unit_descriptor *ftr = _ftr; | 1097 | struct uac_feature_unit_descriptor *ftr = _ftr; |
1098 | 1098 | ||
1099 | if (ftr->bLength < 7 || ! (csize = ftr->bControlSize) || ftr->bLength < 7 + csize) { | 1099 | if (ftr->bLength < 7 || ! (csize = ftr->bControlSize) || ftr->bLength < 7 + csize) { |
1100 | snd_printk(KERN_ERR "usbaudio: unit %u: invalid FEATURE_UNIT descriptor\n", unitid); | 1100 | snd_printk(KERN_ERR "usbaudio: unit %u: invalid UAC_FEATURE_UNIT descriptor\n", unitid); |
1101 | return -EINVAL; | 1101 | return -EINVAL; |
1102 | } | 1102 | } |
1103 | 1103 | ||
@@ -1739,17 +1739,17 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) | |||
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | switch (p1[2]) { | 1741 | switch (p1[2]) { |
1742 | case INPUT_TERMINAL: | 1742 | case UAC_INPUT_TERMINAL: |
1743 | return 0; /* NOP */ | 1743 | return 0; /* NOP */ |
1744 | case MIXER_UNIT: | 1744 | case UAC_MIXER_UNIT: |
1745 | return parse_audio_mixer_unit(state, unitid, p1); | 1745 | return parse_audio_mixer_unit(state, unitid, p1); |
1746 | case SELECTOR_UNIT: | 1746 | case UAC_SELECTOR_UNIT: |
1747 | return parse_audio_selector_unit(state, unitid, p1); | 1747 | return parse_audio_selector_unit(state, unitid, p1); |
1748 | case FEATURE_UNIT: | 1748 | case UAC_FEATURE_UNIT: |
1749 | return parse_audio_feature_unit(state, unitid, p1); | 1749 | return parse_audio_feature_unit(state, unitid, p1); |
1750 | case PROCESSING_UNIT_V1: | 1750 | case UAC_PROCESSING_UNIT_V1: |
1751 | return parse_audio_processing_unit(state, unitid, p1); | 1751 | return parse_audio_processing_unit(state, unitid, p1); |
1752 | case EXTENSION_UNIT_V1: | 1752 | case UAC_EXTENSION_UNIT_V1: |
1753 | return parse_audio_extension_unit(state, unitid, p1); | 1753 | return parse_audio_extension_unit(state, unitid, p1); |
1754 | default: | 1754 | default: |
1755 | snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); | 1755 | snd_printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]); |
@@ -1779,7 +1779,7 @@ static int snd_usb_mixer_dev_free(struct snd_device *device) | |||
1779 | /* | 1779 | /* |
1780 | * create mixer controls | 1780 | * create mixer controls |
1781 | * | 1781 | * |
1782 | * walk through all OUTPUT_TERMINAL descriptors to search for mixers | 1782 | * walk through all UAC_OUTPUT_TERMINAL descriptors to search for mixers |
1783 | */ | 1783 | */ |
1784 | static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) | 1784 | static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) |
1785 | { | 1785 | { |
@@ -1807,7 +1807,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) | |||
1807 | } | 1807 | } |
1808 | 1808 | ||
1809 | desc = NULL; | 1809 | desc = NULL; |
1810 | while ((desc = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, desc, OUTPUT_TERMINAL)) != NULL) { | 1810 | while ((desc = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, desc, UAC_OUTPUT_TERMINAL)) != NULL) { |
1811 | if (desc->bLength < 9) | 1811 | if (desc->bLength < 9) |
1812 | continue; /* invalid descriptor? */ | 1812 | continue; /* invalid descriptor? */ |
1813 | set_bit(desc->bTerminalID, state.unitbitmap); /* mark terminal ID as visited */ | 1813 | set_bit(desc->bTerminalID, state.unitbitmap); /* mark terminal ID as visited */ |
@@ -2047,7 +2047,7 @@ static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) | |||
2047 | } | 2047 | } |
2048 | mixer->rc_setup_packet->bRequestType = | 2048 | mixer->rc_setup_packet->bRequestType = |
2049 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; | 2049 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE; |
2050 | mixer->rc_setup_packet->bRequest = GET_MEM; | 2050 | mixer->rc_setup_packet->bRequest = UAC_GET_MEM; |
2051 | mixer->rc_setup_packet->wValue = cpu_to_le16(0); | 2051 | mixer->rc_setup_packet->wValue = cpu_to_le16(0); |
2052 | mixer->rc_setup_packet->wIndex = cpu_to_le16(0); | 2052 | mixer->rc_setup_packet->wIndex = cpu_to_le16(0); |
2053 | mixer->rc_setup_packet->wLength = cpu_to_le16(len); | 2053 | mixer->rc_setup_packet->wLength = cpu_to_le16(len); |
@@ -2170,7 +2170,7 @@ static void snd_audigy2nx_proc_read(struct snd_info_entry *entry, | |||
2170 | snd_iprintf(buffer, "%s: ", jacks[i].name); | 2170 | snd_iprintf(buffer, "%s: ", jacks[i].name); |
2171 | err = snd_usb_ctl_msg(mixer->chip->dev, | 2171 | err = snd_usb_ctl_msg(mixer->chip->dev, |
2172 | usb_rcvctrlpipe(mixer->chip->dev, 0), | 2172 | usb_rcvctrlpipe(mixer->chip->dev, 0), |
2173 | GET_MEM, USB_DIR_IN | USB_TYPE_CLASS | | 2173 | UAC_GET_MEM, USB_DIR_IN | USB_TYPE_CLASS | |
2174 | USB_RECIP_INTERFACE, 0, | 2174 | USB_RECIP_INTERFACE, 0, |
2175 | jacks[i].unitid << 8, buf, 3, 100); | 2175 | jacks[i].unitid << 8, buf, 3, 100); |
2176 | if (err == 3 && (buf[0] == 3 || buf[0] == 6)) | 2176 | if (err == 3 && (buf[0] == 3 || buf[0] == 6)) |
diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h index fc1d2cd6ccc3..f06faf7917b9 100644 --- a/sound/usb/usbquirks.h +++ b/sound/usb/usbquirks.h | |||
@@ -91,7 +91,7 @@ | |||
91 | .idVendor = 0x046d, | 91 | .idVendor = 0x046d, |
92 | .idProduct = 0x0850, | 92 | .idProduct = 0x0850, |
93 | .bInterfaceClass = USB_CLASS_AUDIO, | 93 | .bInterfaceClass = USB_CLASS_AUDIO, |
94 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 94 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
95 | }, | 95 | }, |
96 | { | 96 | { |
97 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | 97 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
@@ -100,7 +100,7 @@ | |||
100 | .idVendor = 0x046d, | 100 | .idVendor = 0x046d, |
101 | .idProduct = 0x08ae, | 101 | .idProduct = 0x08ae, |
102 | .bInterfaceClass = USB_CLASS_AUDIO, | 102 | .bInterfaceClass = USB_CLASS_AUDIO, |
103 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 103 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
104 | }, | 104 | }, |
105 | { | 105 | { |
106 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | 106 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
@@ -109,7 +109,7 @@ | |||
109 | .idVendor = 0x046d, | 109 | .idVendor = 0x046d, |
110 | .idProduct = 0x08c6, | 110 | .idProduct = 0x08c6, |
111 | .bInterfaceClass = USB_CLASS_AUDIO, | 111 | .bInterfaceClass = USB_CLASS_AUDIO, |
112 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 112 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
113 | }, | 113 | }, |
114 | { | 114 | { |
115 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | 115 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
@@ -118,7 +118,7 @@ | |||
118 | .idVendor = 0x046d, | 118 | .idVendor = 0x046d, |
119 | .idProduct = 0x08f0, | 119 | .idProduct = 0x08f0, |
120 | .bInterfaceClass = USB_CLASS_AUDIO, | 120 | .bInterfaceClass = USB_CLASS_AUDIO, |
121 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 121 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
122 | }, | 122 | }, |
123 | { | 123 | { |
124 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | 124 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
@@ -127,7 +127,7 @@ | |||
127 | .idVendor = 0x046d, | 127 | .idVendor = 0x046d, |
128 | .idProduct = 0x08f5, | 128 | .idProduct = 0x08f5, |
129 | .bInterfaceClass = USB_CLASS_AUDIO, | 129 | .bInterfaceClass = USB_CLASS_AUDIO, |
130 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 130 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
131 | }, | 131 | }, |
132 | { | 132 | { |
133 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | | 133 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE | |
@@ -136,7 +136,7 @@ | |||
136 | .idVendor = 0x046d, | 136 | .idVendor = 0x046d, |
137 | .idProduct = 0x08f6, | 137 | .idProduct = 0x08f6, |
138 | .bInterfaceClass = USB_CLASS_AUDIO, | 138 | .bInterfaceClass = USB_CLASS_AUDIO, |
139 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL | 139 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL |
140 | }, | 140 | }, |
141 | { | 141 | { |
142 | USB_DEVICE(0x046d, 0x0990), | 142 | USB_DEVICE(0x046d, 0x0990), |
@@ -301,7 +301,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
301 | .iface = 1, | 301 | .iface = 1, |
302 | .altsetting = 1, | 302 | .altsetting = 1, |
303 | .altset_idx = 1, | 303 | .altset_idx = 1, |
304 | .attributes = EP_CS_ATTR_FILL_MAX, | 304 | .attributes = UAC_EP_CS_ATTR_FILL_MAX, |
305 | .endpoint = 0x81, | 305 | .endpoint = 0x81, |
306 | .ep_attr = 0x05, | 306 | .ep_attr = 0x05, |
307 | .rates = SNDRV_PCM_RATE_CONTINUOUS, | 307 | .rates = SNDRV_PCM_RATE_CONTINUOUS, |
@@ -2108,7 +2108,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2108 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2108 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2109 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2109 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2110 | .bInterfaceClass = USB_CLASS_AUDIO, | 2110 | .bInterfaceClass = USB_CLASS_AUDIO, |
2111 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2111 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2112 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2112 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2113 | .vendor_name = "Hauppauge", | 2113 | .vendor_name = "Hauppauge", |
2114 | .product_name = "HVR-950Q", | 2114 | .product_name = "HVR-950Q", |
@@ -2122,7 +2122,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2122 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2122 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2123 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2123 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2124 | .bInterfaceClass = USB_CLASS_AUDIO, | 2124 | .bInterfaceClass = USB_CLASS_AUDIO, |
2125 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2125 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2126 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2126 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2127 | .vendor_name = "Hauppauge", | 2127 | .vendor_name = "Hauppauge", |
2128 | .product_name = "HVR-950Q", | 2128 | .product_name = "HVR-950Q", |
@@ -2136,7 +2136,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2136 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2136 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2137 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2137 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2138 | .bInterfaceClass = USB_CLASS_AUDIO, | 2138 | .bInterfaceClass = USB_CLASS_AUDIO, |
2139 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2139 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2140 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2140 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2141 | .vendor_name = "Hauppauge", | 2141 | .vendor_name = "Hauppauge", |
2142 | .product_name = "HVR-950Q", | 2142 | .product_name = "HVR-950Q", |
@@ -2150,7 +2150,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2150 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2150 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2151 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2151 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2152 | .bInterfaceClass = USB_CLASS_AUDIO, | 2152 | .bInterfaceClass = USB_CLASS_AUDIO, |
2153 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2153 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2154 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2154 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2155 | .vendor_name = "Hauppauge", | 2155 | .vendor_name = "Hauppauge", |
2156 | .product_name = "HVR-950Q", | 2156 | .product_name = "HVR-950Q", |
@@ -2164,7 +2164,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2164 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2164 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2165 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2165 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2166 | .bInterfaceClass = USB_CLASS_AUDIO, | 2166 | .bInterfaceClass = USB_CLASS_AUDIO, |
2167 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2167 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2168 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2168 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2169 | .vendor_name = "Hauppauge", | 2169 | .vendor_name = "Hauppauge", |
2170 | .product_name = "HVR-950Q", | 2170 | .product_name = "HVR-950Q", |
@@ -2178,7 +2178,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2178 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2178 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2179 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2179 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2180 | .bInterfaceClass = USB_CLASS_AUDIO, | 2180 | .bInterfaceClass = USB_CLASS_AUDIO, |
2181 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2181 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2182 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2182 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2183 | .vendor_name = "Hauppauge", | 2183 | .vendor_name = "Hauppauge", |
2184 | .product_name = "HVR-950Q", | 2184 | .product_name = "HVR-950Q", |
@@ -2192,7 +2192,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2192 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2192 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2193 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2193 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2194 | .bInterfaceClass = USB_CLASS_AUDIO, | 2194 | .bInterfaceClass = USB_CLASS_AUDIO, |
2195 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2195 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2196 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2196 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2197 | .vendor_name = "Hauppauge", | 2197 | .vendor_name = "Hauppauge", |
2198 | .product_name = "HVR-950Q", | 2198 | .product_name = "HVR-950Q", |
@@ -2206,7 +2206,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2206 | USB_DEVICE_ID_MATCH_INT_CLASS | | 2206 | USB_DEVICE_ID_MATCH_INT_CLASS | |
2207 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2207 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2208 | .bInterfaceClass = USB_CLASS_AUDIO, | 2208 | .bInterfaceClass = USB_CLASS_AUDIO, |
2209 | .bInterfaceSubClass = USB_SUBCLASS_AUDIO_CONTROL, | 2209 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
2210 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | 2210 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2211 | .vendor_name = "Hauppauge", | 2211 | .vendor_name = "Hauppauge", |
2212 | .product_name = "HVR-850", | 2212 | .product_name = "HVR-850", |
@@ -2238,7 +2238,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2238 | .iface = 1, | 2238 | .iface = 1, |
2239 | .altsetting = 1, | 2239 | .altsetting = 1, |
2240 | .altset_idx = 1, | 2240 | .altset_idx = 1, |
2241 | .attributes = EP_CS_ATTR_SAMPLE_RATE, | 2241 | .attributes = UAC_EP_CS_ATTR_SAMPLE_RATE, |
2242 | .endpoint = 0x02, | 2242 | .endpoint = 0x02, |
2243 | .ep_attr = 0x01, | 2243 | .ep_attr = 0x01, |
2244 | .maxpacksize = 0x130, | 2244 | .maxpacksize = 0x130, |
@@ -2268,7 +2268,7 @@ YAMAHA_DEVICE(0x7010, "UB99"), | |||
2268 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS | | 2268 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS | |
2269 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, | 2269 | USB_DEVICE_ID_MATCH_INT_SUBCLASS, |
2270 | .bInterfaceClass = USB_CLASS_AUDIO, | 2270 | .bInterfaceClass = USB_CLASS_AUDIO, |
2271 | .bInterfaceSubClass = USB_SUBCLASS_MIDI_STREAMING, | 2271 | .bInterfaceSubClass = USB_SUBCLASS_MIDISTREAMING, |
2272 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | 2272 | .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { |
2273 | .ifnum = QUIRK_ANY_INTERFACE, | 2273 | .ifnum = QUIRK_ANY_INTERFACE, |
2274 | .type = QUIRK_MIDI_STANDARD_INTERFACE | 2274 | .type = QUIRK_MIDI_STANDARD_INTERFACE |
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 91bb29666d26..44deb21b1777 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 16 | * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/usb.h> | ||
20 | #include <linux/usb/audio.h> | ||
19 | #include <sound/core.h> | 21 | #include <sound/core.h> |
20 | #include <sound/hwdep.h> | 22 | #include <sound/hwdep.h> |
21 | #include <sound/pcm.h> | 23 | #include <sound/pcm.h> |
@@ -315,9 +317,9 @@ static int us122l_set_sample_rate(struct usb_device *dev, int rate) | |||
315 | data[0] = rate; | 317 | data[0] = rate; |
316 | data[1] = rate >> 8; | 318 | data[1] = rate >> 8; |
317 | data[2] = rate >> 16; | 319 | data[2] = rate >> 16; |
318 | err = us122l_ctl_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, | 320 | err = us122l_ctl_msg(dev, usb_sndctrlpipe(dev, 0), UAC_SET_CUR, |
319 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, | 321 | USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, |
320 | SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000); | 322 | UAC_EP_CS_ATTR_SAMPLE_RATE << 8, ep, data, 3, 1000); |
321 | if (err < 0) | 323 | if (err < 0) |
322 | snd_printk(KERN_ERR "%d: cannot set freq %d to ep 0x%x\n", | 324 | snd_printk(KERN_ERR "%d: cannot set freq %d to ep 0x%x\n", |
323 | dev->devnum, rate, ep); | 325 | dev->devnum, rate, ep); |