Lines Matching refs:opts

326 	struct f_uac1_opts *opts;  in f_audio_out_ep_complete()  local
330 opts = container_of(audio->card.func.fi, struct f_uac1_opts, in f_audio_out_ep_complete()
332 audio_buf_size = opts->audio_buf_size; in f_audio_out_ep_complete()
578 struct f_uac1_opts *opts; in f_audio_set_alt() local
584 opts = container_of(f->fi, struct f_uac1_opts, func_inst); in f_audio_set_alt()
585 req_buf_size = opts->req_buf_size; in f_audio_set_alt()
586 req_count = opts->req_count; in f_audio_set_alt()
587 audio_buf_size = opts->audio_buf_size; in f_audio_set_alt()
774 struct f_uac1_opts *opts = to_f_uac1_opts(item); in f_uac1_attr_release() local
776 usb_put_function_instance(&opts->func_inst); in f_uac1_attr_release()
787 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
790 mutex_lock(&opts->lock); \
791 result = sprintf(page, "%u\n", opts->name); \
792 mutex_unlock(&opts->lock); \
800 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
804 mutex_lock(&opts->lock); \
805 if (opts->refcnt) { \
814 opts->name = num; \
818 mutex_unlock(&opts->lock); \
832 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
835 mutex_lock(&opts->lock); \
836 result = sprintf(page, "%s\n", opts->name); \
837 mutex_unlock(&opts->lock); \
845 struct f_uac1_opts *opts = to_f_uac1_opts(item); \
849 mutex_lock(&opts->lock); \
850 if (opts->refcnt) \
858 if (opts->name##_alloc) \
859 kfree(opts->name); \
860 opts->name##_alloc = true; \
861 opts->name = tmp; \
865 mutex_unlock(&opts->lock); \
893 struct f_uac1_opts *opts; in f_audio_free_inst() local
895 opts = container_of(f, struct f_uac1_opts, func_inst); in f_audio_free_inst()
896 if (opts->fn_play_alloc) in f_audio_free_inst()
897 kfree(opts->fn_play); in f_audio_free_inst()
898 if (opts->fn_cap_alloc) in f_audio_free_inst()
899 kfree(opts->fn_cap); in f_audio_free_inst()
900 if (opts->fn_cntl_alloc) in f_audio_free_inst()
901 kfree(opts->fn_cntl); in f_audio_free_inst()
902 kfree(opts); in f_audio_free_inst()
907 struct f_uac1_opts *opts; in f_audio_alloc_inst() local
909 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in f_audio_alloc_inst()
910 if (!opts) in f_audio_alloc_inst()
913 mutex_init(&opts->lock); in f_audio_alloc_inst()
914 opts->func_inst.free_func_inst = f_audio_free_inst; in f_audio_alloc_inst()
916 config_group_init_type_name(&opts->func_inst.group, "", in f_audio_alloc_inst()
919 opts->req_buf_size = UAC1_OUT_EP_MAX_PACKET_SIZE; in f_audio_alloc_inst()
920 opts->req_count = UAC1_REQ_COUNT; in f_audio_alloc_inst()
921 opts->audio_buf_size = UAC1_AUDIO_BUF_SIZE; in f_audio_alloc_inst()
922 opts->fn_play = FILE_PCM_PLAYBACK; in f_audio_alloc_inst()
923 opts->fn_cap = FILE_PCM_CAPTURE; in f_audio_alloc_inst()
924 opts->fn_cntl = FILE_CONTROL; in f_audio_alloc_inst()
925 return &opts->func_inst; in f_audio_alloc_inst()
931 struct f_uac1_opts *opts; in f_audio_free() local
934 opts = container_of(f->fi, struct f_uac1_opts, func_inst); in f_audio_free()
936 mutex_lock(&opts->lock); in f_audio_free()
937 --opts->refcnt; in f_audio_free()
938 mutex_unlock(&opts->lock); in f_audio_free()
949 struct f_uac1_opts *opts; in f_audio_alloc() local
958 opts = container_of(fi, struct f_uac1_opts, func_inst); in f_audio_alloc()
959 mutex_lock(&opts->lock); in f_audio_alloc()
960 ++opts->refcnt; in f_audio_alloc()
961 mutex_unlock(&opts->lock); in f_audio_alloc()