Lines Matching refs:mgr

73 int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx)  in mgr_get_resource()  argument
77 if (n > mgr->avail) in mgr_get_resource()
80 err = get_resource(mgr->rscs, mgr->amount, n, ridx); in mgr_get_resource()
82 mgr->avail -= n; in mgr_get_resource()
87 int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx) in mgr_put_resource() argument
89 put_resource(mgr->rscs, n, idx); in mgr_put_resource()
90 mgr->avail += n; in mgr_put_resource()
204 int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, in rsc_mgr_init() argument
209 mgr->type = NUM_RSCTYP; in rsc_mgr_init()
211 mgr->rscs = kzalloc(DIV_ROUND_UP(amount, 8), GFP_KERNEL); in rsc_mgr_init()
212 if (!mgr->rscs) in rsc_mgr_init()
217 err = hw->src_mgr_get_ctrl_blk(&mgr->ctrl_blk); in rsc_mgr_init()
220 err = hw->srcimp_mgr_get_ctrl_blk(&mgr->ctrl_blk); in rsc_mgr_init()
223 err = hw->amixer_mgr_get_ctrl_blk(&mgr->ctrl_blk); in rsc_mgr_init()
226 err = hw->daio_mgr_get_ctrl_blk(hw, &mgr->ctrl_blk); in rsc_mgr_init()
243 mgr->type = type; in rsc_mgr_init()
244 mgr->avail = mgr->amount = amount; in rsc_mgr_init()
245 mgr->hw = hw; in rsc_mgr_init()
250 kfree(mgr->rscs); in rsc_mgr_init()
254 int rsc_mgr_uninit(struct rsc_mgr *mgr) in rsc_mgr_uninit() argument
256 kfree(mgr->rscs); in rsc_mgr_uninit()
257 mgr->rscs = NULL; in rsc_mgr_uninit()
259 if ((NULL != mgr->hw) && (NULL != mgr->ctrl_blk)) { in rsc_mgr_uninit()
260 switch (mgr->type) { in rsc_mgr_uninit()
262 mgr->hw->src_mgr_put_ctrl_blk(mgr->ctrl_blk); in rsc_mgr_uninit()
265 mgr->hw->srcimp_mgr_put_ctrl_blk(mgr->ctrl_blk); in rsc_mgr_uninit()
268 mgr->hw->amixer_mgr_put_ctrl_blk(mgr->ctrl_blk); in rsc_mgr_uninit()
271 mgr->hw->daio_mgr_put_ctrl_blk(mgr->ctrl_blk); in rsc_mgr_uninit()
276 dev_err(((struct hw *)mgr->hw)->card->dev, in rsc_mgr_uninit()
278 mgr->type); in rsc_mgr_uninit()
282 mgr->hw = mgr->ctrl_blk = NULL; in rsc_mgr_uninit()
285 mgr->type = NUM_RSCTYP; in rsc_mgr_uninit()
286 mgr->avail = mgr->amount = 0; in rsc_mgr_uninit()