Lines Matching refs:amixer
29 rsc->idx = container_of(rsc, struct amixer, rsc)->idx[0]; in amixer_master()
39 return container_of(rsc, struct amixer, rsc)->idx[rsc->conj]; in amixer_index()
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()
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()
71 static int amixer_set_y(struct amixer *amixer, unsigned int y) in amixer_set_y() argument
75 hw = amixer->rsc.hw; in amixer_set_y()
76 hw->amixer_set_y(amixer->rsc.ctrl_blk, y); in amixer_set_y()
81 static int amixer_set_invalid_squash(struct amixer *amixer, unsigned int iv) in amixer_set_invalid_squash() argument
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()
91 static int amixer_set_sum(struct amixer *amixer, struct sum *sum) in amixer_set_sum() argument
95 hw = amixer->rsc.hw; in amixer_set_sum()
96 amixer->sum = sum; 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()
108 static int amixer_commit_write(struct amixer *amixer) in amixer_commit_write() argument
116 hw = amixer->rsc.hw; in amixer_commit_write()
117 input = amixer->input; in amixer_commit_write()
118 sum = amixer->sum; in amixer_commit_write()
121 amixer->rsc.ops->master(&amixer->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()
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()
154 static int amixer_commit_raw_write(struct amixer *amixer) in amixer_commit_raw_write() argument
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()
166 static int amixer_get_y(struct amixer *amixer) in amixer_get_y() argument
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() argument
177 amixer_set_input(amixer, input); in amixer_setup()
178 amixer_set_y(amixer, scale); in amixer_setup()
179 amixer_set_sum(amixer, sum); in amixer_setup()
180 amixer_commit_write(amixer); in amixer_setup()
195 static int amixer_rsc_init(struct amixer *amixer, in amixer_rsc_init() argument
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()
208 amixer->ops = &amixer_ops; in amixer_rsc_init()
209 amixer->input = NULL; in amixer_rsc_init()
210 amixer->sum = NULL; in amixer_rsc_init()
212 amixer_setup(amixer, NULL, 0, NULL); in amixer_rsc_init()
217 static int amixer_rsc_uninit(struct amixer *amixer) in amixer_rsc_uninit() argument
219 amixer_setup(amixer, NULL, 0, NULL); in amixer_rsc_uninit()
220 rsc_uninit(&amixer->rsc); in amixer_rsc_uninit()
221 amixer->ops = NULL; in amixer_rsc_uninit()
222 amixer->input = NULL; in amixer_rsc_uninit()
223 amixer->sum = NULL; in amixer_rsc_uninit()
229 struct amixer **ramixer) in get_amixer_rsc()
233 struct amixer *amixer; in get_amixer_rsc() local
239 amixer = kzalloc(sizeof(*amixer), GFP_KERNEL); in get_amixer_rsc()
240 if (!amixer) in get_amixer_rsc()
252 amixer->idx[i] = idx; in get_amixer_rsc()
261 err = amixer_rsc_init(amixer, desc, mgr); in get_amixer_rsc()
265 *ramixer = amixer; in get_amixer_rsc()
272 mgr_put_resource(&mgr->mgr, 1, amixer->idx[i]); in get_amixer_rsc()
275 kfree(amixer); in get_amixer_rsc()
279 static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer) in put_amixer_rsc() argument
285 for (i = 0; i < amixer->rsc.msr; i++) in put_amixer_rsc()
286 mgr_put_resource(&mgr->mgr, 1, amixer->idx[i]); in put_amixer_rsc()
289 amixer_rsc_uninit(amixer); in put_amixer_rsc()
290 kfree(amixer); in put_amixer_rsc()