summaryrefslogtreecommitdiff
path: root/sound/usb/format.c
diff options
context:
space:
mode:
authorJussi Laako <jussi@sonarnerd.net>2019-02-18 00:17:21 +0200
committerTakashi Iwai <tiwai@suse.de>2019-02-18 09:36:09 +0100
commitc7a13264918b9796f80c634f20fea56e1612572d (patch)
treed0d8757c02033712f513904f827962e0b0c3fded /sound/usb/format.c
parenta06702ca023feccb7c1a5171987f5cac959427ed (diff)
ALSA: usb-audio: Expose sample resolution through proc interface
At least some USB devices use (MSB-aligned) audio format larger than the actual resolution of the device. In order to expose the actual device resolution (bBitResolution), add extra field to the procfs stream info interface. Signed-off-by: Jussi Laako <jussi@sonarnerd.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/format.c')
-rw-r--r--sound/usb/format.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/usb/format.c b/sound/usb/format.c
index fd13ac11b136..3ee7d6f853b7 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -87,6 +87,8 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
}
}
+ fp->fmt_bits = sample_width;
+
if ((pcm_formats == 0) &&
(format == 0 || format == (1 << UAC_FORMAT_TYPE_I_UNDEFINED))) {
/* some devices don't define this correctly... */