• Home
  • Raw
  • Download

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()
585 rsc_mgr_uninit(&src_mgr->mgr); in src_mgr_destroy()
631 srcimp->mgr->imap_add(srcimp->mgr, entry); in srcimp_map()
651 srcimp->mgr->imap_delete(srcimp->mgr, in srcimp_unmap()
667 struct srcimp_mgr *mgr) in srcimp_rsc_init() argument
672 SRCIMP, desc->msr, mgr->mgr.hw); in srcimp_rsc_init()
687 srcimp->mgr = mgr; in srcimp_rsc_init()
703 srcimp->mgr = NULL; in srcimp_rsc_uninit()
709 static int get_srcimp_rsc(struct srcimp_mgr *mgr, in get_srcimp_rsc() argument
727 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_srcimp_rsc()
729 err = mgr_get_resource(&mgr->mgr, 1, &idx); in get_srcimp_rsc()
735 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_srcimp_rsc()
737 dev_err(mgr->card->dev, in get_srcimp_rsc()
742 err = srcimp_rsc_init(srcimp, desc, mgr); in get_srcimp_rsc()
751 spin_lock_irqsave(&mgr->mgr_lock, flags); in get_srcimp_rsc()
753 mgr_put_resource(&mgr->mgr, 1, srcimp->idx[i]); in get_srcimp_rsc()
755 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in get_srcimp_rsc()
760 static int put_srcimp_rsc(struct srcimp_mgr *mgr, struct srcimp *srcimp) in put_srcimp_rsc() argument
765 spin_lock_irqsave(&mgr->mgr_lock, flags); in put_srcimp_rsc()
767 mgr_put_resource(&mgr->mgr, 1, srcimp->idx[i]); in put_srcimp_rsc()
769 spin_unlock_irqrestore(&mgr->mgr_lock, flags); in put_srcimp_rsc()
778 struct rsc_mgr *mgr = &((struct srcimp_mgr *)data)->mgr; in srcimp_map_op() local
779 struct hw *hw = mgr->hw; in srcimp_map_op()
781 hw->srcimp_mgr_set_imaparc(mgr->ctrl_blk, entry->slot); in srcimp_map_op()
782 hw->srcimp_mgr_set_imapuser(mgr->ctrl_blk, entry->user); in srcimp_map_op()
783 hw->srcimp_mgr_set_imapnxt(mgr->ctrl_blk, entry->next); in srcimp_map_op()
784 hw->srcimp_mgr_set_imapaddr(mgr->ctrl_blk, entry->addr); in srcimp_map_op()
785 hw->srcimp_mgr_commit_write(mgr->hw, mgr->ctrl_blk); in srcimp_map_op()
790 static int srcimp_imap_add(struct srcimp_mgr *mgr, struct imapper *entry) in srcimp_imap_add() argument
795 spin_lock_irqsave(&mgr->imap_lock, flags); in srcimp_imap_add()
796 if ((0 == entry->addr) && (mgr->init_imap_added)) { in srcimp_imap_add()
797 input_mapper_delete(&mgr->imappers, in srcimp_imap_add()
798 mgr->init_imap, srcimp_map_op, mgr); in srcimp_imap_add()
799 mgr->init_imap_added = 0; in srcimp_imap_add()
801 err = input_mapper_add(&mgr->imappers, entry, srcimp_map_op, mgr); in srcimp_imap_add()
802 spin_unlock_irqrestore(&mgr->imap_lock, flags); in srcimp_imap_add()
807 static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) in srcimp_imap_delete() argument
812 spin_lock_irqsave(&mgr->imap_lock, flags); in srcimp_imap_delete()
813 err = input_mapper_delete(&mgr->imappers, entry, srcimp_map_op, mgr); in srcimp_imap_delete()
814 if (list_empty(&mgr->imappers)) { in srcimp_imap_delete()
815 input_mapper_add(&mgr->imappers, mgr->init_imap, in srcimp_imap_delete()
816 srcimp_map_op, mgr); in srcimp_imap_delete()
817 mgr->init_imap_added = 1; in srcimp_imap_delete()
819 spin_unlock_irqrestore(&mgr->imap_lock, flags); in srcimp_imap_delete()
835 err = rsc_mgr_init(&srcimp_mgr->mgr, SRCIMP, SRCIMP_RESOURCE_NUM, hw); in srcimp_mgr_create()
863 rsc_mgr_uninit(&srcimp_mgr->mgr); in srcimp_mgr_create()
878 rsc_mgr_uninit(&srcimp_mgr->mgr); in srcimp_mgr_destroy()