• Home
  • Raw
  • Download

Lines Matching refs:ctrlr

41 #define ctrlr_to_drv(ctrlr) container_of(ctrlr, struct rsc_drv, client)  argument
103 static struct cache_req *__find_req(struct rpmh_ctrlr *ctrlr, u32 addr) in __find_req() argument
107 list_for_each_entry(p, &ctrlr->cache, list) { in __find_req()
117 static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, in cache_rpm_request() argument
125 spin_lock_irqsave(&ctrlr->cache_lock, flags); in cache_rpm_request()
126 req = __find_req(ctrlr, cmd->addr); in cache_rpm_request()
138 list_add_tail(&req->list, &ctrlr->cache); in cache_rpm_request()
154 ctrlr->dirty |= (req->sleep_val != old_sleep_val || in cache_rpm_request()
160 spin_unlock_irqrestore(&ctrlr->cache_lock, flags); in cache_rpm_request()
179 struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev); in __rpmh_write() local
188 req = cache_rpm_request(ctrlr, state, &rpm_msg->msg.cmds[i]); in __rpmh_write()
197 ret = rpmh_rsc_send_data(ctrlr_to_drv(ctrlr), &rpm_msg->msg); in __rpmh_write()
287 static void cache_batch(struct rpmh_ctrlr *ctrlr, struct batch_cache_req *req) in cache_batch() argument
291 spin_lock_irqsave(&ctrlr->cache_lock, flags); in cache_batch()
292 list_add_tail(&req->list, &ctrlr->batch_cache); in cache_batch()
293 ctrlr->dirty = true; in cache_batch()
294 spin_unlock_irqrestore(&ctrlr->cache_lock, flags); in cache_batch()
297 static int flush_batch(struct rpmh_ctrlr *ctrlr) in flush_batch() argument
305 list_for_each_entry(req, &ctrlr->batch_cache, list) { in flush_batch()
308 ret = rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr), in flush_batch()
341 struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev); in rpmh_write_batch() local
373 cache_batch(ctrlr, req); in rpmh_write_batch()
382 ret = rpmh_rsc_send_data(ctrlr_to_drv(ctrlr), &rpm_msgs[i].msg); in rpmh_write_batch()
419 static int send_single(struct rpmh_ctrlr *ctrlr, enum rpmh_state state, in send_single() argument
430 return rpmh_rsc_write_ctrl_data(ctrlr_to_drv(ctrlr), &rpm_msg.msg); in send_single()
442 int rpmh_flush(struct rpmh_ctrlr *ctrlr) in rpmh_flush() argument
454 if (!spin_trylock(&ctrlr->cache_lock)) in rpmh_flush()
457 if (!ctrlr->dirty) { in rpmh_flush()
463 rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr)); in rpmh_flush()
466 ret = flush_batch(ctrlr); in rpmh_flush()
470 list_for_each_entry(p, &ctrlr->cache, list) { in rpmh_flush()
476 ret = send_single(ctrlr, RPMH_SLEEP_STATE, p->addr, in rpmh_flush()
480 ret = send_single(ctrlr, RPMH_WAKE_ONLY_STATE, p->addr, in rpmh_flush()
486 ctrlr->dirty = false; in rpmh_flush()
489 spin_unlock(&ctrlr->cache_lock); in rpmh_flush()
502 struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev); in rpmh_invalidate() local
506 spin_lock_irqsave(&ctrlr->cache_lock, flags); in rpmh_invalidate()
507 list_for_each_entry_safe(req, tmp, &ctrlr->batch_cache, list) in rpmh_invalidate()
509 INIT_LIST_HEAD(&ctrlr->batch_cache); in rpmh_invalidate()
510 ctrlr->dirty = true; in rpmh_invalidate()
511 spin_unlock_irqrestore(&ctrlr->cache_lock, flags); in rpmh_invalidate()