Lines Matching +full:hs +full:- +full:usb +full:- +full:if

1 // SPDX-License-Identifier: GPL-2.0+
3 * audio.c -- Audio gadget driver
13 #include <linux/usb/composite.h>
15 #define DRIVER_DESC "Linux USB Audio Gadget"
23 /* Playback(USB-IN) Default Stereo - Fl/Fr */
39 /* Playback bInterval for HS/SS (1-4: fixed, 0: auto) */
43 "Playback bInterval for HS/SS (1-4: fixed, 0: auto)");
45 /* Capture(USB-OUT) Default Stereo - Fl/Fr */
61 /* capture bInterval for HS/SS (1-4: fixed, 0: auto) */
65 "Capture bInterval for HS/SS (1-4: fixed, 0: auto)");
71 /* Playback(USB-IN) Default Stereo - Fl/Fr */
87 /* Capture(USB-OUT) Default Stereo - Fl/Fr */
141 .language = 0x0409, /* en-us */
158 /*-------------------------------------------------------------------------*/
160 /* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
161 * Instead: allocate your own, using normal USB-IF procedures.
166 #define AUDIO_PRODUCT_NUM 0x0101 /* Linux-USB Audio Gadget */
168 /*-------------------------------------------------------------------------*/
202 /*-------------------------------------------------------------------------*/
208 /* FIXME alloc iConfiguration string, set it in c->strings */ in audio_do_config()
210 if (gadget_is_otg(c->cdev->gadget)) { in audio_do_config()
211 c->descriptors = otg_desc; in audio_do_config()
212 c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; in audio_do_config()
217 if (IS_ERR(f_uac1)) { in audio_do_config()
223 if (status < 0) { in audio_do_config()
229 if (IS_ERR(f_uac2)) { in audio_do_config()
235 if (status < 0) { in audio_do_config()
251 /*-------------------------------------------------------------------------*/
270 if (IS_ERR(fi_uac2)) in audio_bind()
278 if (IS_ERR(fi_uac1)) in audio_bind()
284 uac2_opts->p_chmask = p_chmask; in audio_bind()
287 uac2_opts->p_srates[i] = p_srates[i]; in audio_bind()
289 uac2_opts->p_ssize = p_ssize; in audio_bind()
290 uac2_opts->p_hs_bint = p_hs_bint; in audio_bind()
291 uac2_opts->c_chmask = c_chmask; in audio_bind()
294 uac2_opts->c_srates[i] = c_srates[i]; in audio_bind()
296 uac2_opts->c_ssize = c_ssize; in audio_bind()
297 uac2_opts->c_hs_bint = c_hs_bint; in audio_bind()
298 uac2_opts->req_number = UAC2_DEF_REQ_NUM; in audio_bind()
302 uac1_opts->p_chmask = p_chmask; in audio_bind()
305 uac1_opts->p_srates[i] = p_srates[i]; in audio_bind()
307 uac1_opts->p_ssize = p_ssize; in audio_bind()
308 uac1_opts->c_chmask = c_chmask; in audio_bind()
311 uac1_opts->c_srates[i] = c_srates[i]; in audio_bind()
313 uac1_opts->c_ssize = c_ssize; in audio_bind()
314 uac1_opts->req_number = UAC1_DEF_REQ_NUM; in audio_bind()
317 uac1_opts->fn_play = fn_play; in audio_bind()
318 uac1_opts->fn_cap = fn_cap; in audio_bind()
319 uac1_opts->fn_cntl = fn_cntl; in audio_bind()
320 uac1_opts->req_buf_size = req_buf_size; in audio_bind()
321 uac1_opts->req_count = req_count; in audio_bind()
322 uac1_opts->audio_buf_size = audio_buf_size; in audio_bind()
327 if (status < 0) in audio_bind()
332 if (gadget_is_otg(cdev->gadget) && !otg_desc[0]) { in audio_bind()
335 usb_desc = usb_otg_descriptor_alloc(cdev->gadget); in audio_bind()
336 if (!usb_desc) { in audio_bind()
337 status = -ENOMEM; in audio_bind()
340 usb_otg_descriptor_init(cdev->gadget, usb_desc); in audio_bind()
346 if (status < 0) in audio_bind()
368 if (!IS_ERR_OR_NULL(f_uac1)) in audio_unbind()
370 if (!IS_ERR_OR_NULL(fi_uac1)) in audio_unbind()
373 if (!IS_ERR_OR_NULL(f_uac2)) in audio_unbind()
375 if (!IS_ERR_OR_NULL(fi_uac2)) in audio_unbind()