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()
337 rsc->idx = container_of(rsc, struct sum, rsc)->idx[0]; in sum_master()
347 return container_of(rsc, struct sum, rsc)->idx[rsc->conj]; in sum_index()
362 static int sum_rsc_init(struct sum *sum, in sum_rsc_init() argument
368 err = rsc_init(&sum->rsc, sum->idx[0], SUM, desc->msr, mgr->mgr.hw); in sum_rsc_init()
372 sum->rsc.ops = &sum_basic_rsc_ops; in sum_rsc_init()
377 static int sum_rsc_uninit(struct sum *sum) in sum_rsc_uninit() argument
379 rsc_uninit(&sum->rsc); in sum_rsc_uninit()
385 struct sum **rsum) in get_sum_rsc()
389 struct sum *sum; in get_sum_rsc() local
395 sum = kzalloc(sizeof(*sum), GFP_KERNEL); in get_sum_rsc()
396 if (!sum) in get_sum_rsc()
407 sum->idx[i] = idx; in get_sum_rsc()
416 err = sum_rsc_init(sum, desc, mgr); in get_sum_rsc()
420 *rsum = sum; in get_sum_rsc()
427 mgr_put_resource(&mgr->mgr, 1, sum->idx[i]); in get_sum_rsc()
430 kfree(sum); in get_sum_rsc()
434 static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) in put_sum_rsc() argument
440 for (i = 0; i < sum->rsc.msr; i++) in put_sum_rsc()
441 mgr_put_resource(&mgr->mgr, 1, sum->idx[i]); in put_sum_rsc()
444 sum_rsc_uninit(sum); in put_sum_rsc()
445 kfree(sum); in put_sum_rsc()