summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/function/u_uac2.h
diff options
context:
space:
mode:
authorJulian Scheel <julian@jusst.de>2022-01-21 18:53:03 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-26 16:06:08 +0300
commita7339e4f5788bd088bb0be1f96a6cce459676ed0 (patch)
tree18e6f798108563a7e475508e7bb2ba382f848712 /drivers/usb/gadget/function/u_uac2.h
parenteb3a1ce6f5ed2c047bcae4aad76b7ee711715c7d (diff)
downloadlinux-a7339e4f5788bd088bb0be1f96a6cce459676ed0.tar.xz
usb: gadget: f_uac2: Support multiple sampling rates
A list of sampling rates can be specified via configfs. All enabled sampling rates are sent to the USB host on request. When the host selects a sampling rate, the internal active rate (stored in struct f_uac2) is updated. The gadget no longer supports only one frequency. Therefore USB strings corresponding to the clock sources are renamed from specific Hz value to general names Input clock/Output clock. Config strings with single value stay compatible with the previous version. Multiple samplerates passed as configuration arrays to g_audio module when built for f_uac2. Signed-off-by: Julian Scheel <julian@jusst.de> Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Link: https://lore.kernel.org/r/20220121155308.48794-6-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/function/u_uac2.h')
-rw-r--r--drivers/usb/gadget/function/u_uac2.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/u_uac2.h b/drivers/usb/gadget/function/u_uac2.h
index e0c8e3513bfd..6bfcf6d0e863 100644
--- a/drivers/usb/gadget/function/u_uac2.h
+++ b/drivers/usb/gadget/function/u_uac2.h
@@ -14,6 +14,7 @@
#define U_UAC2_H
#include <linux/usb/composite.h>
+#include "uac_common.h"
#define UAC2_DEF_PCHMASK 0x3
#define UAC2_DEF_PSRATE 48000
@@ -35,10 +36,10 @@
struct f_uac2_opts {
struct usb_function_instance func_inst;
int p_chmask;
- int p_srate;
+ int p_srates[UAC_MAX_RATES];
int p_ssize;
int c_chmask;
- int c_srate;
+ int c_srates[UAC_MAX_RATES];
int c_ssize;
int c_sync;