usb: gadget: u_audio: Subdevice 0 for capture ctls
authorPavel Hofman <pavel.hofman@ivitera.com>
Wed, 5 Jan 2022 10:46:43 +0000 (11:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:54 +0000 (11:03 +0100)
[ Upstream commit 601a5bc1aeef772ab1f47582fd322957799f5ab5 ]

Both capture and playback alsa devices use subdevice 0. Yet capture-side
ctls are defined for subdevice 1. The patch sets subdevice 0 for them.

Fixes: 02de698ca812 ("usb: gadget: u_audio: add bi-directional volume and mute support")
Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Link: https://lore.kernel.org/r/20220105104643.90125-1-pavel.hofman@ivitera.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/function/u_audio.c

index ad16163..d22ac23 100644 (file)
@@ -1097,7 +1097,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name,
                        }
 
                        kctl->id.device = pcm->device;
-                       kctl->id.subdevice = i;
+                       kctl->id.subdevice = 0;
 
                        err = snd_ctl_add(card, kctl);
                        if (err < 0)
@@ -1120,7 +1120,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name,
                        }
 
                        kctl->id.device = pcm->device;
-                       kctl->id.subdevice = i;
+                       kctl->id.subdevice = 0;
 
 
                        kctl->tlv.c = u_audio_volume_tlv;