aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/usb/audio-v2.h2
-rw-r--r--sound/usb/format.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
index ed13053153f4..c5f2158ab00e 100644
--- a/include/linux/usb/audio-v2.h
+++ b/include/linux/usb/audio-v2.h
@@ -170,6 +170,8 @@ struct uac2_as_header_descriptor {
170 __u8 iChannelNames; 170 __u8 iChannelNames;
171} __attribute__((packed)); 171} __attribute__((packed));
172 172
173#define UAC2_FORMAT_TYPE_I_RAW_DATA (1 << 31)
174
173/* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */ 175/* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */
174 176
175struct uac2_iso_endpoint_descriptor { 177struct uac2_iso_endpoint_descriptor {
diff --git a/sound/usb/format.c b/sound/usb/format.c
index b30d6fb89b40..a695cafc0599 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -47,7 +47,7 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
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);