Lines Matching refs:sum

91 static int amixer_set_sum(struct amixer *amixer, struct sum *sum)  in amixer_set_sum()  argument
96 amixer->sum = sum; in amixer_set_sum()
97 if (!sum) { in amixer_set_sum()
102 sum->rsc.ops->index(&sum->rsc)); in amixer_set_sum()
114 struct sum *sum; in amixer_commit_write() local
118 sum = amixer->sum; in amixer_commit_write()
125 if (sum) in amixer_commit_write()
126 sum->rsc.ops->master(&sum->rsc); in amixer_commit_write()
135 if (sum) { in amixer_commit_write()
137 sum->rsc.ops->index(&sum->rsc)); in amixer_commit_write()
138 sum->rsc.ops->next_conj(&sum->rsc); in amixer_commit_write()
148 if (sum) in amixer_commit_write()
149 sum->rsc.ops->master(&sum->rsc); in amixer_commit_write()
175 unsigned int scale, struct sum *sum) in amixer_setup() argument
179 amixer_set_sum(amixer, sum); in amixer_setup()
210 amixer->sum = NULL; in amixer_rsc_init()
223 amixer->sum = NULL; in amixer_rsc_uninit()
336 rsc->idx = container_of(rsc, struct sum, rsc)->idx[0]; in sum_master()
346 return container_of(rsc, struct sum, rsc)->idx[rsc->conj]; in sum_index()
361 static int sum_rsc_init(struct sum *sum, in sum_rsc_init() argument
367 err = rsc_init(&sum->rsc, sum->idx[0], SUM, desc->msr, mgr->mgr.hw); in sum_rsc_init()
371 sum->rsc.ops = &sum_basic_rsc_ops; in sum_rsc_init()
376 static int sum_rsc_uninit(struct sum *sum) in sum_rsc_uninit() argument
378 rsc_uninit(&sum->rsc); in sum_rsc_uninit()
384 struct sum **rsum) in get_sum_rsc()
388 struct sum *sum; in get_sum_rsc() local
394 sum = kzalloc(sizeof(*sum), GFP_KERNEL); in get_sum_rsc()
395 if (!sum) in get_sum_rsc()
406 sum->idx[i] = idx; in get_sum_rsc()
415 err = sum_rsc_init(sum, desc, mgr); in get_sum_rsc()
419 *rsum = sum; in get_sum_rsc()
426 mgr_put_resource(&mgr->mgr, 1, sum->idx[i]); in get_sum_rsc()
429 kfree(sum); in get_sum_rsc()
433 static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) in put_sum_rsc() argument
439 for (i = 0; i < sum->rsc.msr; i++) in put_sum_rsc()
440 mgr_put_resource(&mgr->mgr, 1, sum->idx[i]); in put_sum_rsc()
443 sum_rsc_uninit(sum); in put_sum_rsc()
444 kfree(sum); in put_sum_rsc()