Lines Matching refs:opts

326 	struct f_uac1_legacy_opts *opts;  in f_audio_out_ep_complete()  local
330 opts = container_of(audio->card.func.fi, struct f_uac1_legacy_opts, in f_audio_out_ep_complete()
332 audio_buf_size = opts->audio_buf_size; in f_audio_out_ep_complete()
580 struct f_uac1_legacy_opts *opts; in f_audio_set_alt() local
586 opts = container_of(f->fi, struct f_uac1_legacy_opts, func_inst); in f_audio_set_alt()
587 req_buf_size = opts->req_buf_size; in f_audio_set_alt()
588 req_count = opts->req_count; in f_audio_set_alt()
589 audio_buf_size = opts->audio_buf_size; in f_audio_set_alt()
810 struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); in f_uac1_attr_release() local
812 usb_put_function_instance(&opts->func_inst); in f_uac1_attr_release()
823 struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
826 mutex_lock(&opts->lock); \
827 result = sprintf(page, "%u\n", opts->name); \
828 mutex_unlock(&opts->lock); \
836 struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
840 mutex_lock(&opts->lock); \
841 if (opts->refcnt) { \
850 opts->name = num; \
854 mutex_unlock(&opts->lock); \
868 struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
871 mutex_lock(&opts->lock); \
872 result = sprintf(page, "%s\n", opts->name); \
873 mutex_unlock(&opts->lock); \
881 struct f_uac1_legacy_opts *opts = to_f_uac1_opts(item); \
885 mutex_lock(&opts->lock); \
886 if (opts->refcnt) \
894 if (opts->name##_alloc) \
895 kfree(opts->name); \
896 opts->name##_alloc = true; \
897 opts->name = tmp; \
901 mutex_unlock(&opts->lock); \
929 struct f_uac1_legacy_opts *opts; in f_audio_free_inst() local
931 opts = container_of(f, struct f_uac1_legacy_opts, func_inst); in f_audio_free_inst()
932 if (opts->fn_play_alloc) in f_audio_free_inst()
933 kfree(opts->fn_play); in f_audio_free_inst()
934 if (opts->fn_cap_alloc) in f_audio_free_inst()
935 kfree(opts->fn_cap); in f_audio_free_inst()
936 if (opts->fn_cntl_alloc) in f_audio_free_inst()
937 kfree(opts->fn_cntl); in f_audio_free_inst()
938 kfree(opts); in f_audio_free_inst()
943 struct f_uac1_legacy_opts *opts; in f_audio_alloc_inst() local
945 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in f_audio_alloc_inst()
946 if (!opts) in f_audio_alloc_inst()
949 mutex_init(&opts->lock); in f_audio_alloc_inst()
950 opts->func_inst.free_func_inst = f_audio_free_inst; in f_audio_alloc_inst()
952 config_group_init_type_name(&opts->func_inst.group, "", in f_audio_alloc_inst()
955 opts->req_buf_size = UAC1_OUT_EP_MAX_PACKET_SIZE; in f_audio_alloc_inst()
956 opts->req_count = UAC1_REQ_COUNT; in f_audio_alloc_inst()
957 opts->audio_buf_size = UAC1_AUDIO_BUF_SIZE; in f_audio_alloc_inst()
958 opts->fn_play = FILE_PCM_PLAYBACK; in f_audio_alloc_inst()
959 opts->fn_cap = FILE_PCM_CAPTURE; in f_audio_alloc_inst()
960 opts->fn_cntl = FILE_CONTROL; in f_audio_alloc_inst()
961 return &opts->func_inst; in f_audio_alloc_inst()
967 struct f_uac1_legacy_opts *opts; in f_audio_free() local
970 opts = container_of(f->fi, struct f_uac1_legacy_opts, func_inst); in f_audio_free()
972 mutex_lock(&opts->lock); in f_audio_free()
973 --opts->refcnt; in f_audio_free()
974 mutex_unlock(&opts->lock); in f_audio_free()
985 struct f_uac1_legacy_opts *opts; in f_audio_alloc() local
994 opts = container_of(fi, struct f_uac1_legacy_opts, func_inst); in f_audio_alloc()
995 mutex_lock(&opts->lock); in f_audio_alloc()
996 ++opts->refcnt; in f_audio_alloc()
997 mutex_unlock(&opts->lock); in f_audio_alloc()