Lines Matching refs:mgr
357 const struct src_desc *desc, struct src_mgr *mgr) in src_rsc_init() argument
365 err = rsc_init(&p->rsc, idx + i, SRC, desc->msr, mgr->mgr.hw); in src_rsc_init()
374 mgr->src_enable(mgr, p); in src_rsc_init()
379 mgr->commit_write(mgr); in src_rsc_init()
385 mgr->src_disable(mgr, p); in src_rsc_init()
388 mgr->commit_write(mgr); in src_rsc_init()
392 static int src_rsc_uninit(struct src *src, struct src_mgr *mgr) in src_rsc_uninit() argument
399 mgr->src_disable(mgr, p); in src_rsc_uninit()
406 mgr->commit_write(mgr); in src_rsc_uninit()
412 get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc) in get_src_rsc() argument
422 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_src_rsc()
424 err = mgr_get_resource(&mgr->mgr, desc->multi, &idx); in get_src_rsc()
426 err = mgr_get_resource(&mgr->mgr, 1, &idx); in get_src_rsc()
428 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_src_rsc()
430 dev_err(mgr->card->dev, in get_src_rsc()
446 err = src_rsc_init(src, idx, desc, mgr); in get_src_rsc()
457 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_src_rsc()
459 mgr_put_resource(&mgr->mgr, desc->multi, idx); in get_src_rsc()
461 mgr_put_resource(&mgr->mgr, 1, idx); in get_src_rsc()
463 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_src_rsc()
467 static int put_src_rsc(struct src_mgr *mgr, struct src *src) in put_src_rsc() argument
471 spin_lock_irqsave(&mgr->mgr_lock, flags); in put_src_rsc()
474 mgr_put_resource(&mgr->mgr, src->multi, in put_src_rsc()
477 mgr_put_resource(&mgr->mgr, 1, src->rsc.ops->index(&src->rsc)); in put_src_rsc()
479 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in put_src_rsc()
480 src_rsc_uninit(src, mgr); in put_src_rsc()
486 static int src_enable_s(struct src_mgr *mgr, struct src *src) in src_enable_s() argument
488 struct hw *hw = mgr->mgr.hw; in src_enable_s()
493 hw->src_mgr_enbs_src(mgr->mgr.ctrl_blk, in src_enable_s()
502 static int src_enable(struct src_mgr *mgr, struct src *src) in src_enable() argument
504 struct hw *hw = mgr->mgr.hw; in src_enable()
509 hw->src_mgr_enb_src(mgr->mgr.ctrl_blk, in src_enable()
518 static int src_disable(struct src_mgr *mgr, struct src *src) in src_disable() argument
520 struct hw *hw = mgr->mgr.hw; in src_disable()
525 hw->src_mgr_dsb_src(mgr->mgr.ctrl_blk, in src_disable()
534 static int src_mgr_commit_write(struct src_mgr *mgr) in src_mgr_commit_write() argument
536 struct hw *hw = mgr->mgr.hw; in src_mgr_commit_write()
538 hw->src_mgr_commit_write(hw, mgr->mgr.ctrl_blk); in src_mgr_commit_write()
553 err = rsc_mgr_init(&src_mgr->mgr, SRC, SRC_RESOURCE_NUM, hw); in src_mgr_create()
570 hw->src_mgr_dsb_src(src_mgr->mgr.ctrl_blk, i); in src_mgr_create()
572 hw->src_mgr_commit_write(hw, src_mgr->mgr.ctrl_blk); in src_mgr_create()
586 rsc_mgr_uninit(&src_mgr->mgr); in src_mgr_destroy()
632 srcimp->mgr->imap_add(srcimp->mgr, entry); in srcimp_map()
652 srcimp->mgr->imap_delete(srcimp->mgr, in srcimp_unmap()
668 struct srcimp_mgr *mgr) in srcimp_rsc_init() argument
673 SRCIMP, desc->msr, mgr->mgr.hw); in srcimp_rsc_init()
688 srcimp->mgr = mgr; in srcimp_rsc_init()
704 srcimp->mgr = NULL; in srcimp_rsc_uninit()
710 static int get_srcimp_rsc(struct srcimp_mgr *mgr, in get_srcimp_rsc() argument
728 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_srcimp_rsc()
730 err = mgr_get_resource(&mgr->mgr, 1, &idx); in get_srcimp_rsc()
736 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_srcimp_rsc()
738 dev_err(mgr->card->dev, in get_srcimp_rsc()
743 err = srcimp_rsc_init(srcimp, desc, mgr); in get_srcimp_rsc()
752 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_srcimp_rsc()
754 mgr_put_resource(&mgr->mgr, 1, srcimp->idx[i]); in get_srcimp_rsc()
756 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_srcimp_rsc()
761 static int put_srcimp_rsc(struct srcimp_mgr *mgr, struct srcimp *srcimp) in put_srcimp_rsc() argument
766 spin_lock_irqsave(&mgr->mgr_lock, flags); in put_srcimp_rsc()
768 mgr_put_resource(&mgr->mgr, 1, srcimp->idx[i]); in put_srcimp_rsc()
770 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in put_srcimp_rsc()
779 struct rsc_mgr *mgr = &((struct srcimp_mgr *)data)->mgr; in srcimp_map_op() local
780 struct hw *hw = mgr->hw; in srcimp_map_op()
782 hw->srcimp_mgr_set_imaparc(mgr->ctrl_blk, entry->slot); in srcimp_map_op()
783 hw->srcimp_mgr_set_imapuser(mgr->ctrl_blk, entry->user); in srcimp_map_op()
784 hw->srcimp_mgr_set_imapnxt(mgr->ctrl_blk, entry->next); in srcimp_map_op()
785 hw->srcimp_mgr_set_imapaddr(mgr->ctrl_blk, entry->addr); in srcimp_map_op()
786 hw->srcimp_mgr_commit_write(mgr->hw, mgr->ctrl_blk); in srcimp_map_op()
791 static int srcimp_imap_add(struct srcimp_mgr *mgr, struct imapper *entry) in srcimp_imap_add() argument
796 spin_lock_irqsave(&mgr->imap_lock, flags); in srcimp_imap_add()
797 if ((0 == entry->addr) && (mgr->init_imap_added)) { in srcimp_imap_add()
798 input_mapper_delete(&mgr->imappers, in srcimp_imap_add()
799 mgr->init_imap, srcimp_map_op, mgr); in srcimp_imap_add()
800 mgr->init_imap_added = 0; in srcimp_imap_add()
802 err = input_mapper_add(&mgr->imappers, entry, srcimp_map_op, mgr); in srcimp_imap_add()
803 spin_unlock_irqrestore(&mgr->imap_lock, flags); in srcimp_imap_add()
808 static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) in srcimp_imap_delete() argument
813 spin_lock_irqsave(&mgr->imap_lock, flags); in srcimp_imap_delete()
814 err = input_mapper_delete(&mgr->imappers, entry, srcimp_map_op, mgr); in srcimp_imap_delete()
815 if (list_empty(&mgr->imappers)) { in srcimp_imap_delete()
816 input_mapper_add(&mgr->imappers, mgr->init_imap, in srcimp_imap_delete()
817 srcimp_map_op, mgr); in srcimp_imap_delete()
818 mgr->init_imap_added = 1; in srcimp_imap_delete()
820 spin_unlock_irqrestore(&mgr->imap_lock, flags); in srcimp_imap_delete()
836 err = rsc_mgr_init(&srcimp_mgr->mgr, SRCIMP, SRCIMP_RESOURCE_NUM, hw); in srcimp_mgr_create()
864 rsc_mgr_uninit(&srcimp_mgr->mgr); in srcimp_mgr_create()
880 rsc_mgr_uninit(&srcimp_mgr->mgr); in srcimp_mgr_destroy()