From: David Henningsson Date: Tue, 5 Nov 2013 03:41:07 +0000 (+0100) Subject: ALSA: usb - For class 2 devices, use channel map from altsettings X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e3e35f750fff74e701c8913fd7dd714e37a848cd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: usb - For class 2 devices, use channel map from altsettings The channel config from the streaming descriptor is probably a better indicator of the channel map than the input terminal. Use the input terminal's channel map as fallback only. Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/stream.c b/sound/usb/stream.c index b43b6eec3227..badd1d6d175d 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -587,6 +587,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) num_channels = as->bNrChannels; format = le32_to_cpu(as->bmFormats); + chconfig = le32_to_cpu(as->bmChannelConfig); /* lookup the terminal associated to this interface * to extract the clock */ @@ -594,7 +595,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no) as->bTerminalLink); if (input_term) { clock = input_term->bCSourceID; - chconfig = le32_to_cpu(input_term->bmChannelConfig); + if (!chconfig && (num_channels == input_term->bNrChannels)) + chconfig = le32_to_cpu(input_term->bmChannelConfig); break; }