#include <linux/usb/audio.h>
#include <linux/usb/audio-v2.h>
#include <linux/module.h>
#include "u_audio.h"
#include "u_uac2.h"
#define UAC2_CHANNEL_MASK …
#define USB_OUT_CLK_ID …
#define USB_IN_CLK_ID …
#define USB_OUT_FU_ID …
#define USB_IN_FU_ID …
#define CONTROL_ABSENT …
#define CONTROL_RDONLY …
#define CONTROL_RDWR …
#define CLK_FREQ_CTRL …
#define CLK_VLD_CTRL …
#define FU_MUTE_CTRL …
#define FU_VOL_CTRL …
#define COPY_CTRL …
#define CONN_CTRL …
#define OVRLD_CTRL …
#define CLSTR_CTRL …
#define UNFLW_CTRL …
#define OVFLW_CTRL …
#define EPIN_EN(_opts) …
#define EPOUT_EN(_opts) …
#define FUIN_EN(_opts) …
#define FUOUT_EN(_opts) …
#define EPOUT_FBACK_IN_EN(_opts) …
struct f_uac2 { … };
static inline struct f_uac2 *func_to_uac2(struct usb_function *f)
{ … }
static inline
struct f_uac2_opts *g_audio_to_uac2_opts(struct g_audio *agdev)
{ … }
static int afunc_notify(struct g_audio *agdev, int unit_id, int cs);
enum { … };
static struct usb_string strings_fn[NUM_STR_DESCRIPTORS + 1] = …;
static const char *const speed_names[] = …;
static struct usb_gadget_strings str_fn = …;
static struct usb_gadget_strings *fn_strings[] = …;
static struct usb_interface_assoc_descriptor iad_desc = …;
static struct usb_interface_descriptor std_ac_if_desc = …;
static struct uac_clock_source_descriptor in_clk_src_desc = …;
static struct uac_clock_source_descriptor out_clk_src_desc = …;
static struct uac2_input_terminal_descriptor usb_out_it_desc = …;
static struct uac2_input_terminal_descriptor io_in_it_desc = …;
static struct uac2_output_terminal_descriptor usb_in_ot_desc = …;
static struct uac2_output_terminal_descriptor io_out_ot_desc = …;
static struct uac2_feature_unit_descriptor *in_feature_unit_desc;
static struct uac2_feature_unit_descriptor *out_feature_unit_desc;
static struct uac2_ac_header_descriptor ac_hdr_desc = …;
static struct usb_endpoint_descriptor fs_ep_int_desc = …;
static struct usb_endpoint_descriptor hs_ep_int_desc = …;
static struct usb_endpoint_descriptor ss_ep_int_desc = …;
static struct usb_ss_ep_comp_descriptor ss_ep_int_desc_comp = …;
static struct usb_interface_descriptor std_as_out_if0_desc = …;
static struct usb_interface_descriptor std_as_out_if1_desc = …;
static struct uac2_as_header_descriptor as_out_hdr_desc = …;
static struct uac2_format_type_i_descriptor as_out_fmt1_desc = …;
static struct usb_endpoint_descriptor fs_epout_desc = …;
static struct usb_endpoint_descriptor hs_epout_desc = …;
static struct usb_endpoint_descriptor ss_epout_desc = …;
static struct usb_ss_ep_comp_descriptor ss_epout_desc_comp = …;
static struct uac2_iso_endpoint_descriptor as_iso_out_desc = …;
static struct usb_endpoint_descriptor fs_epin_fback_desc = …;
static struct usb_endpoint_descriptor hs_epin_fback_desc = …;
static struct usb_endpoint_descriptor ss_epin_fback_desc = …;
static struct usb_ss_ep_comp_descriptor ss_epin_fback_desc_comp = …;
static struct usb_interface_descriptor std_as_in_if0_desc = …;
static struct usb_interface_descriptor std_as_in_if1_desc = …;
static struct uac2_as_header_descriptor as_in_hdr_desc = …;
static struct uac2_format_type_i_descriptor as_in_fmt1_desc = …;
static struct usb_endpoint_descriptor fs_epin_desc = …;
static struct usb_endpoint_descriptor hs_epin_desc = …;
static struct usb_endpoint_descriptor ss_epin_desc = …;
static struct usb_ss_ep_comp_descriptor ss_epin_desc_comp = …;
static struct uac2_iso_endpoint_descriptor as_iso_in_desc = …;
static struct usb_descriptor_header *fs_audio_desc[] = …;
static struct usb_descriptor_header *hs_audio_desc[] = …;
static struct usb_descriptor_header *ss_audio_desc[] = …;
struct cntrl_cur_lay2 { … };
struct cntrl_range_lay2 { … } __packed;
struct cntrl_cur_lay3 { … };
struct cntrl_subrange_lay3 { … } __packed;
#define ranges_lay3_size(c) …
#define DECLARE_UAC2_CNTRL_RANGES_LAY3(k, n) …
DECLARE_UAC2_CNTRL_RANGES_LAY3(srates, UAC_MAX_RATES);
static int get_max_srate(const int *srates)
{ … }
static int get_max_bw_for_bint(const struct f_uac2_opts *uac2_opts,
u8 bint, unsigned int factor, bool is_playback)
{ … }
static int set_ep_max_packet_size_bint(struct device *dev, const struct f_uac2_opts *uac2_opts,
struct usb_endpoint_descriptor *ep_desc,
enum usb_device_speed speed, bool is_playback)
{ … }
static struct uac2_feature_unit_descriptor *build_fu_desc(int chmask)
{ … }
#define USBDHDR(p) …
static void setup_headers(struct f_uac2_opts *opts,
struct usb_descriptor_header **headers,
enum usb_device_speed speed)
{ … }
static void setup_descriptor(struct f_uac2_opts *opts)
{ … }
static int afunc_validate_opts(struct g_audio *agdev, struct device *dev)
{ … }
static int
afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
{ … }
static void
afunc_notify_complete(struct usb_ep *_ep, struct usb_request *req)
{ … }
static int
afunc_notify(struct g_audio *agdev, int unit_id, int cs)
{ … }
static int
afunc_set_alt(struct usb_function *fn, unsigned intf, unsigned alt)
{ … }
static int
afunc_get_alt(struct usb_function *fn, unsigned intf)
{ … }
static void
afunc_disable(struct usb_function *fn)
{ … }
static void
afunc_suspend(struct usb_function *fn)
{ … }
static int
in_rq_cur(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static int
in_rq_range(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static int
ac_rq_in(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static void uac2_cs_control_sam_freq(struct usb_ep *ep, struct usb_request *req)
{ … }
static void
out_rq_cur_complete(struct usb_ep *ep, struct usb_request *req)
{ … }
static int
out_rq_cur(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static int
setup_rq_inf(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static int
afunc_setup(struct usb_function *fn, const struct usb_ctrlrequest *cr)
{ … }
static inline struct f_uac2_opts *to_f_uac2_opts(struct config_item *item)
{ … }
static void f_uac2_attr_release(struct config_item *item)
{ … }
static struct configfs_item_operations f_uac2_item_ops = …;
#define uac2_kstrtou8 …
#define uac2_kstrtou32 …
#define uac2_kstrtos16 …
#define uac2_kstrtobool(s, base, res) …
static const char *u8_fmt = …;
static const char *u32_fmt = …;
static const char *s16_fmt = …;
static const char *bool_fmt = …;
#define UAC2_ATTRIBUTE(type, name) …
#define UAC2_ATTRIBUTE_SYNC(name) …
#define UAC2_RATE_ATTRIBUTE(name) …
#define UAC2_ATTRIBUTE_STRING(name) …
UAC2_ATTRIBUTE(…);
UAC2_RATE_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_RATE_ATTRIBUTE(…);
UAC2_ATTRIBUTE_SYNC(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE_STRING(…);
UAC2_ATTRIBUTE(…);
UAC2_ATTRIBUTE(…);
static struct configfs_attribute *f_uac2_attrs[] = …;
static const struct config_item_type f_uac2_func_type = …;
static void afunc_free_inst(struct usb_function_instance *f)
{ … }
static struct usb_function_instance *afunc_alloc_inst(void)
{ … }
static void afunc_free(struct usb_function *f)
{ … }
static void afunc_unbind(struct usb_configuration *c, struct usb_function *f)
{ … }
static struct usb_function *afunc_alloc(struct usb_function_instance *fi)
{ … }
DECLARE_USB_FUNCTION_INIT(uac2, afunc_alloc_inst, afunc_alloc);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;