summaryrefslogtreecommitdiffstats
path: root/sound/usb/helper.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-11-23 09:53:22 +0100
committerTakashi Iwai <tiwai@suse.de>2020-11-23 15:13:47 +0100
commite42a09bc520e94375501a8f8e769b867d8063d9d (patch)
treeea21c41927922dbf767558e1dfb8a2a6883aa787 /sound/usb/helper.h
parentALSA: usb-audio: Drop keep_interface flag again (diff)
downloadlinux-e42a09bc520e94375501a8f8e769b867d8063d9d.tar.xz
linux-e42a09bc520e94375501a8f8e769b867d8063d9d.zip
ALSA: usb-audio: Add snd_usb_get_host_interface() helper
Add a helper function to retrieve the usb_host_interface object from the given interface and altsetting number pair, which is a commonly used procedure in the driver code. No functional changes, just minor code refactoring. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-17-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/helper.h')
-rw-r--r--sound/usb/helper.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/usb/helper.h b/sound/usb/helper.h
index f5b4c6647e4d..e2b51ec96ec6 100644
--- a/sound/usb/helper.h
+++ b/sound/usb/helper.h
@@ -14,6 +14,9 @@ int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe,
unsigned char snd_usb_parse_datainterval(struct snd_usb_audio *chip,
struct usb_host_interface *alts);
+struct usb_host_interface *
+snd_usb_get_host_interface(struct snd_usb_audio *chip, int ifnum, int altsetting);
+
/*
* retrieve usb_interface descriptor from the host interface
* (conditional for compatibility with the older API)