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()
781 struct f_uac1_opts *opts = to_f_uac1_opts(item); in f_uac1_attr_release() local
783 usb_put_function_instance(&opts->func_inst); in f_uac1_attr_release()
793 static ssize_t f_uac1_opts_##name##_show(struct f_uac1_opts *opts, \
798 mutex_lock(&opts->lock); \
799 result = sprintf(page, "%u\n", opts->name); \
800 mutex_unlock(&opts->lock); \
805 static ssize_t f_uac1_opts_##name##_store(struct f_uac1_opts *opts, \
811 mutex_lock(&opts->lock); \
812 if (opts->refcnt) { \
821 opts->name = num; \
825 mutex_unlock(&opts->lock); \
839 static ssize_t f_uac1_opts_##name##_show(struct f_uac1_opts *opts, \
844 mutex_lock(&opts->lock); \
845 result = sprintf(page, "%s\n", opts->name); \
846 mutex_unlock(&opts->lock); \
851 static ssize_t f_uac1_opts_##name##_store(struct f_uac1_opts *opts, \
857 mutex_lock(&opts->lock); \
858 if (opts->refcnt) \
866 if (opts->name##_alloc) \
867 kfree(opts->name); \
868 opts->name##_alloc = true; \
869 opts->name = tmp; \
873 mutex_unlock(&opts->lock); \
904 struct f_uac1_opts *opts; in f_audio_free_inst() local
906 opts = container_of(f, struct f_uac1_opts, func_inst); in f_audio_free_inst()
907 if (opts->fn_play_alloc) in f_audio_free_inst()
908 kfree(opts->fn_play); in f_audio_free_inst()
909 if (opts->fn_cap_alloc) in f_audio_free_inst()
910 kfree(opts->fn_cap); in f_audio_free_inst()
911 if (opts->fn_cntl_alloc) in f_audio_free_inst()
912 kfree(opts->fn_cntl); in f_audio_free_inst()
913 kfree(opts); in f_audio_free_inst()
918 struct f_uac1_opts *opts; in f_audio_alloc_inst() local
920 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in f_audio_alloc_inst()
921 if (!opts) in f_audio_alloc_inst()
924 mutex_init(&opts->lock); in f_audio_alloc_inst()
925 opts->func_inst.free_func_inst = f_audio_free_inst; in f_audio_alloc_inst()
927 config_group_init_type_name(&opts->func_inst.group, "", in f_audio_alloc_inst()
930 opts->req_buf_size = UAC1_OUT_EP_MAX_PACKET_SIZE; in f_audio_alloc_inst()
931 opts->req_count = UAC1_REQ_COUNT; in f_audio_alloc_inst()
932 opts->audio_buf_size = UAC1_AUDIO_BUF_SIZE; in f_audio_alloc_inst()
933 opts->fn_play = FILE_PCM_PLAYBACK; in f_audio_alloc_inst()
934 opts->fn_cap = FILE_PCM_CAPTURE; in f_audio_alloc_inst()
935 opts->fn_cntl = FILE_CONTROL; in f_audio_alloc_inst()
936 return &opts->func_inst; in f_audio_alloc_inst()
942 struct f_uac1_opts *opts; in f_audio_free() local
945 opts = container_of(f->fi, struct f_uac1_opts, func_inst); in f_audio_free()
947 mutex_lock(&opts->lock); in f_audio_free()
948 --opts->refcnt; in f_audio_free()
949 mutex_unlock(&opts->lock); in f_audio_free()
960 struct f_uac1_opts *opts; in f_audio_alloc() local
969 opts = container_of(fi, struct f_uac1_opts, func_inst); in f_audio_alloc()
970 mutex_lock(&opts->lock); in f_audio_alloc()
971 ++opts->refcnt; in f_audio_alloc()
972 mutex_unlock(&opts->lock); in f_audio_alloc()