Lines Matching refs:dao
135 static int dao_rsc_reinit(struct dao *dao, const struct dao_desc *desc);
137 static int dao_spdif_get_spos(struct dao *dao, unsigned int *spos) in dao_spdif_get_spos() argument
139 dao->hw->dao_get_spos(dao->ctrl_blk, spos); in dao_spdif_get_spos()
143 static int dao_spdif_set_spos(struct dao *dao, unsigned int spos) in dao_spdif_set_spos() argument
145 dao->hw->dao_set_spos(dao->ctrl_blk, spos); in dao_spdif_set_spos()
149 static int dao_commit_write(struct dao *dao) in dao_commit_write() argument
151 dao->hw->dao_commit_write(dao->hw, in dao_commit_write()
152 daio_device_index(dao->daio.type, dao->hw), dao->ctrl_blk); in dao_commit_write()
156 static int dao_set_left_input(struct dao *dao, struct rsc *input) in dao_set_left_input() argument
159 struct daio *daio = &dao->daio; in dao_set_left_input()
166 dao->ops->clear_left_input(dao); in dao_set_left_input()
173 dao->mgr->imap_add(dao->mgr, entry); in dao_set_left_input()
174 dao->imappers[i] = entry; in dao_set_left_input()
185 static int dao_set_right_input(struct dao *dao, struct rsc *input) in dao_set_right_input() argument
188 struct daio *daio = &dao->daio; in dao_set_right_input()
195 dao->ops->clear_right_input(dao); in dao_set_right_input()
202 dao->mgr->imap_add(dao->mgr, entry); in dao_set_right_input()
203 dao->imappers[daio->rscl.msr + i] = entry; in dao_set_right_input()
214 static int dao_clear_left_input(struct dao *dao) in dao_clear_left_input() argument
217 struct daio *daio = &dao->daio; in dao_clear_left_input()
220 if (!dao->imappers[0]) in dao_clear_left_input()
223 entry = dao->imappers[0]; in dao_clear_left_input()
224 dao->mgr->imap_delete(dao->mgr, entry); in dao_clear_left_input()
227 entry = dao->imappers[i]; in dao_clear_left_input()
228 dao->mgr->imap_delete(dao->mgr, entry); in dao_clear_left_input()
229 dao->imappers[i] = NULL; in dao_clear_left_input()
232 kfree(dao->imappers[0]); in dao_clear_left_input()
233 dao->imappers[0] = NULL; in dao_clear_left_input()
238 static int dao_clear_right_input(struct dao *dao) in dao_clear_right_input() argument
241 struct daio *daio = &dao->daio; in dao_clear_right_input()
244 if (!dao->imappers[daio->rscl.msr]) in dao_clear_right_input()
247 entry = dao->imappers[daio->rscl.msr]; in dao_clear_right_input()
248 dao->mgr->imap_delete(dao->mgr, entry); in dao_clear_right_input()
251 entry = dao->imappers[daio->rscl.msr + i]; in dao_clear_right_input()
252 dao->mgr->imap_delete(dao->mgr, entry); in dao_clear_right_input()
253 dao->imappers[daio->rscl.msr + i] = NULL; in dao_clear_right_input()
256 kfree(dao->imappers[daio->rscl.msr]); in dao_clear_right_input()
257 dao->imappers[daio->rscl.msr] = NULL; in dao_clear_right_input()
385 static int dao_rsc_init(struct dao *dao, in dao_rsc_init() argument
393 err = daio_rsc_init(&dao->daio, desc, mgr->mgr.hw); in dao_rsc_init()
397 dao->imappers = kzalloc(array3_size(sizeof(void *), desc->msr, 2), in dao_rsc_init()
399 if (!dao->imappers) { in dao_rsc_init()
403 dao->ops = &dao_ops; in dao_rsc_init()
404 dao->mgr = mgr; in dao_rsc_init()
405 dao->hw = hw; in dao_rsc_init()
406 err = hw->dao_get_ctrl_blk(&dao->ctrl_blk); in dao_rsc_init()
411 daio_device_index(dao->daio.type, hw)); in dao_rsc_init()
416 daio_device_index(dao->daio.type, hw), conf); in dao_rsc_init()
418 daio_device_index(dao->daio.type, hw)); in dao_rsc_init()
424 kfree(dao->imappers); in dao_rsc_init()
425 dao->imappers = NULL; in dao_rsc_init()
427 daio_rsc_uninit(&dao->daio); in dao_rsc_init()
431 static int dao_rsc_uninit(struct dao *dao) in dao_rsc_uninit() argument
433 if (dao->imappers) { in dao_rsc_uninit()
434 if (dao->imappers[0]) in dao_rsc_uninit()
435 dao_clear_left_input(dao); in dao_rsc_uninit()
437 if (dao->imappers[dao->daio.rscl.msr]) in dao_rsc_uninit()
438 dao_clear_right_input(dao); in dao_rsc_uninit()
440 kfree(dao->imappers); in dao_rsc_uninit()
441 dao->imappers = NULL; in dao_rsc_uninit()
443 dao->hw->dao_put_ctrl_blk(dao->ctrl_blk); in dao_rsc_uninit()
444 dao->hw = dao->ctrl_blk = NULL; in dao_rsc_uninit()
445 daio_rsc_uninit(&dao->daio); in dao_rsc_uninit()
450 static int dao_rsc_reinit(struct dao *dao, const struct dao_desc *desc) in dao_rsc_reinit() argument
452 struct daio_mgr *mgr = dao->mgr; in dao_rsc_reinit()
455 dsc.type = dao->daio.type; in dao_rsc_reinit()
458 dao_rsc_uninit(dao); in dao_rsc_reinit()
459 return dao_rsc_init(dao, &dsc, mgr); in dao_rsc_reinit()
545 struct dao *dao = kzalloc(sizeof(*dao), GFP_KERNEL); in get_daio_rsc() local
546 if (!dao) in get_daio_rsc()
549 err = dao_rsc_init(dao, desc, mgr); in get_daio_rsc()
551 kfree(dao); in get_daio_rsc()
555 *rdaio = &dao->daio; in get_daio_rsc()
594 dao_rsc_uninit(container_of(daio, struct dao, daio)); in put_daio_rsc()
595 kfree(container_of(daio, struct dao, daio)); in put_daio_rsc()