diff options
Diffstat (limited to 'sound/usb/format.c')
-rw-r--r-- | sound/usb/format.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c index e831ee4238bb..a695cafc0599 100644 --- a/sound/usb/format.c +++ b/sound/usb/format.c | |||
@@ -43,11 +43,11 @@ | |||
43 | */ | 43 | */ |
44 | static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | 44 | static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, |
45 | struct audioformat *fp, | 45 | struct audioformat *fp, |
46 | int format, void *_fmt, | 46 | unsigned int format, void *_fmt, |
47 | int protocol) | 47 | int protocol) |
48 | { | 48 | { |
49 | int sample_width, sample_bytes; | 49 | int sample_width, sample_bytes; |
50 | u64 pcm_formats; | 50 | u64 pcm_formats = 0; |
51 | 51 | ||
52 | switch (protocol) { | 52 | switch (protocol) { |
53 | case UAC_VERSION_1: | 53 | case UAC_VERSION_1: |
@@ -63,14 +63,17 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip, | |||
63 | struct uac_format_type_i_ext_descriptor *fmt = _fmt; | 63 | struct uac_format_type_i_ext_descriptor *fmt = _fmt; |
64 | sample_width = fmt->bBitResolution; | 64 | sample_width = fmt->bBitResolution; |
65 | sample_bytes = fmt->bSubslotSize; | 65 | sample_bytes = fmt->bSubslotSize; |
66 | |||
67 | if (format & UAC2_FORMAT_TYPE_I_RAW_DATA) | ||
68 | pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL; | ||
69 | |||
66 | format <<= 1; | 70 | format <<= 1; |
67 | break; | 71 | break; |
68 | } | 72 | } |
69 | } | 73 | } |
70 | 74 | ||
71 | pcm_formats = 0; | 75 | if ((pcm_formats == 0) && |
72 | 76 | (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED))) { | |
73 | if (format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED)) { | ||
74 | /* some devices don't define this correctly... */ | 77 | /* some devices don't define this correctly... */ |
75 | snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n", | 78 | snd_printdd(KERN_INFO "%d:%u:%d : format type 0 is detected, processed as PCM\n", |
76 | chip->dev->devnum, fp->iface, fp->altsetting); | 79 | chip->dev->devnum, fp->iface, fp->altsetting); |
@@ -353,7 +356,7 @@ err: | |||
353 | * parse the format type I and III descriptors | 356 | * parse the format type I and III descriptors |
354 | */ | 357 | */ |
355 | static int parse_audio_format_i(struct snd_usb_audio *chip, | 358 | static int parse_audio_format_i(struct snd_usb_audio *chip, |
356 | struct audioformat *fp, int format, | 359 | struct audioformat *fp, unsigned int format, |
357 | struct uac_format_type_i_continuous_descriptor *fmt, | 360 | struct uac_format_type_i_continuous_descriptor *fmt, |
358 | struct usb_host_interface *iface) | 361 | struct usb_host_interface *iface) |
359 | { | 362 | { |
@@ -473,8 +476,9 @@ static int parse_audio_format_ii(struct snd_usb_audio *chip, | |||
473 | return ret; | 476 | return ret; |
474 | } | 477 | } |
475 | 478 | ||
476 | int snd_usb_parse_audio_format(struct snd_usb_audio *chip, struct audioformat *fp, | 479 | int snd_usb_parse_audio_format(struct snd_usb_audio *chip, |
477 | int format, struct uac_format_type_i_continuous_descriptor *fmt, | 480 | struct audioformat *fp, unsigned int format, |
481 | struct uac_format_type_i_continuous_descriptor *fmt, | ||
478 | int stream, struct usb_host_interface *iface) | 482 | int stream, struct usb_host_interface *iface) |
479 | { | 483 | { |
480 | int err; | 484 | int err; |