Lines Matching refs:rsc
26 static void amixer_master(struct rsc *rsc) in amixer_master() argument
28 rsc->conj = 0; in amixer_master()
29 rsc->idx = container_of(rsc, struct amixer, rsc)->idx[0]; in amixer_master()
32 static void amixer_next_conj(struct rsc *rsc) in amixer_next_conj() argument
34 rsc->conj++; in amixer_next_conj()
37 static int amixer_index(const struct rsc *rsc) in amixer_index() argument
39 return container_of(rsc, struct amixer, rsc)->idx[rsc->conj]; in amixer_index()
42 static int amixer_output_slot(const struct rsc *rsc) in amixer_output_slot() argument
44 return (amixer_index(rsc) << 4) + 0x4; in amixer_output_slot()
54 static int amixer_set_input(struct amixer *amixer, struct rsc *rsc) in amixer_set_input() argument
58 hw = amixer->rsc.hw; in amixer_set_input()
59 hw->amixer_set_mode(amixer->rsc.ctrl_blk, AMIXER_Y_IMMEDIATE); in amixer_set_input()
60 amixer->input = rsc; in amixer_set_input()
61 if (!rsc) in amixer_set_input()
62 hw->amixer_set_x(amixer->rsc.ctrl_blk, BLANK_SLOT); in amixer_set_input()
64 hw->amixer_set_x(amixer->rsc.ctrl_blk, in amixer_set_input()
65 rsc->ops->output_slot(rsc)); in amixer_set_input()
75 hw = amixer->rsc.hw; in amixer_set_y()
76 hw->amixer_set_y(amixer->rsc.ctrl_blk, y); in amixer_set_y()
85 hw = amixer->rsc.hw; in amixer_set_invalid_squash()
86 hw->amixer_set_iv(amixer->rsc.ctrl_blk, iv); in amixer_set_invalid_squash()
95 hw = amixer->rsc.hw; in amixer_set_sum()
98 hw->amixer_set_se(amixer->rsc.ctrl_blk, 0); in amixer_set_sum()
100 hw->amixer_set_se(amixer->rsc.ctrl_blk, 1); in amixer_set_sum()
101 hw->amixer_set_sadr(amixer->rsc.ctrl_blk, in amixer_set_sum()
102 sum->rsc.ops->index(&sum->rsc)); in amixer_set_sum()
113 struct rsc *input; in amixer_commit_write()
116 hw = amixer->rsc.hw; in amixer_commit_write()
121 amixer->rsc.ops->master(&amixer->rsc); in amixer_commit_write()
126 sum->rsc.ops->master(&sum->rsc); in amixer_commit_write()
128 for (i = 0; i < amixer->rsc.msr; i++) { in amixer_commit_write()
129 hw->amixer_set_dirty_all(amixer->rsc.ctrl_blk); in amixer_commit_write()
131 hw->amixer_set_x(amixer->rsc.ctrl_blk, in amixer_commit_write()
136 hw->amixer_set_sadr(amixer->rsc.ctrl_blk, 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()
140 index = amixer->rsc.ops->output_slot(&amixer->rsc); in amixer_commit_write()
141 hw->amixer_commit_write(hw, index, amixer->rsc.ctrl_blk); in amixer_commit_write()
142 amixer->rsc.ops->next_conj(&amixer->rsc); in amixer_commit_write()
144 amixer->rsc.ops->master(&amixer->rsc); in amixer_commit_write()
149 sum->rsc.ops->master(&sum->rsc); in amixer_commit_write()
159 hw = amixer->rsc.hw; in amixer_commit_raw_write()
160 index = amixer->rsc.ops->output_slot(&amixer->rsc); in amixer_commit_raw_write()
161 hw->amixer_commit_write(hw, index, amixer->rsc.ctrl_blk); in amixer_commit_raw_write()
170 hw = amixer->rsc.hw; in amixer_get_y()
171 return hw->amixer_get_y(amixer->rsc.ctrl_blk); in amixer_get_y()
174 static int amixer_setup(struct amixer *amixer, struct rsc *input, in amixer_setup()
201 err = rsc_init(&amixer->rsc, amixer->idx[0], in amixer_rsc_init()
207 amixer->rsc.ops = &amixer_basic_rsc_ops; in amixer_rsc_init()
220 rsc_uninit(&amixer->rsc); in amixer_rsc_uninit()
285 for (i = 0; i < amixer->rsc.msr; i++) in put_amixer_rsc()
333 static void sum_master(struct rsc *rsc) in sum_master() argument
335 rsc->conj = 0; in sum_master()
336 rsc->idx = container_of(rsc, struct sum, rsc)->idx[0]; in sum_master()
339 static void sum_next_conj(struct rsc *rsc) in sum_next_conj() argument
341 rsc->conj++; in sum_next_conj()
344 static int sum_index(const struct rsc *rsc) in sum_index() argument
346 return container_of(rsc, struct sum, rsc)->idx[rsc->conj]; in sum_index()
349 static int sum_output_slot(const struct rsc *rsc) in sum_output_slot() argument
351 return (sum_index(rsc) << 4) + 0xc; in sum_output_slot()
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()
378 rsc_uninit(&sum->rsc); in sum_rsc_uninit()
439 for (i = 0; i < sum->rsc.msr; i++) in put_sum_rsc()