Lines Matching refs:tcs_id

195 tcs_reg_addr(const struct rsc_drv *drv, int reg, int tcs_id)  in tcs_reg_addr()  argument
197 return drv->tcs_base + drv->regs[RSC_DRV_TCS_OFFSET] * tcs_id + reg; in tcs_reg_addr()
201 tcs_cmd_addr(const struct rsc_drv *drv, int reg, int tcs_id, int cmd_id) in tcs_cmd_addr() argument
203 return tcs_reg_addr(drv, reg, tcs_id) + drv->regs[RSC_DRV_CMD_OFFSET] * cmd_id; in tcs_cmd_addr()
206 static u32 read_tcs_cmd(const struct rsc_drv *drv, int reg, int tcs_id, in read_tcs_cmd() argument
209 return readl_relaxed(tcs_cmd_addr(drv, reg, tcs_id, cmd_id)); in read_tcs_cmd()
212 static u32 read_tcs_reg(const struct rsc_drv *drv, int reg, int tcs_id) in read_tcs_reg() argument
214 return readl_relaxed(tcs_reg_addr(drv, reg, tcs_id)); in read_tcs_reg()
217 static void write_tcs_cmd(const struct rsc_drv *drv, int reg, int tcs_id, in write_tcs_cmd() argument
220 writel_relaxed(data, tcs_cmd_addr(drv, reg, tcs_id, cmd_id)); in write_tcs_cmd()
223 static void write_tcs_reg(const struct rsc_drv *drv, int reg, int tcs_id, in write_tcs_reg() argument
226 writel_relaxed(data, tcs_reg_addr(drv, reg, tcs_id)); in write_tcs_reg()
229 static void write_tcs_reg_sync(const struct rsc_drv *drv, int reg, int tcs_id, in write_tcs_reg_sync() argument
234 writel(data, tcs_reg_addr(drv, reg, tcs_id)); in write_tcs_reg_sync()
241 if (readl(tcs_reg_addr(drv, reg, tcs_id)) == data) in write_tcs_reg_sync()
246 data, tcs_id, reg); in write_tcs_reg_sync()
351 int tcs_id) in get_req_from_tcs() argument
358 if (tcs->mask & BIT(tcs_id)) in get_req_from_tcs()
359 return tcs->req[tcs_id - tcs->offset]; in get_req_from_tcs()
382 static void __tcs_set_trigger(struct rsc_drv *drv, int tcs_id, bool trigger) in __tcs_set_trigger() argument
392 enable = read_tcs_reg(drv, reg, tcs_id); in __tcs_set_trigger()
394 write_tcs_reg_sync(drv, reg, tcs_id, enable); in __tcs_set_trigger()
396 write_tcs_reg_sync(drv, reg, tcs_id, enable); in __tcs_set_trigger()
401 write_tcs_reg_sync(drv, reg, tcs_id, enable); in __tcs_set_trigger()
403 write_tcs_reg(drv, reg, tcs_id, enable); in __tcs_set_trigger()
416 static void enable_tcs_irq(struct rsc_drv *drv, int tcs_id, bool enable) in enable_tcs_irq() argument
423 data |= BIT(tcs_id); in enable_tcs_irq()
425 data &= ~BIT(tcs_id); in enable_tcs_irq()
494 static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id, in __tcs_buffer_write() argument
516 write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_MSGID], tcs_id, j, msgid); in __tcs_buffer_write()
517 write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], tcs_id, j, cmd->addr); in __tcs_buffer_write()
518 write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_DATA], tcs_id, j, cmd->data); in __tcs_buffer_write()
519 trace_rpmh_send_msg(drv, tcs_id, msg->state, j, msgid, cmd); in __tcs_buffer_write()
522 cmd_enable |= read_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id); in __tcs_buffer_write()
523 write_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id, cmd_enable); in __tcs_buffer_write()
647 int tcs_id; in rpmh_rsc_send_data() local
658 (tcs_id = claim_tcs_for_req(drv, tcs, msg)) >= 0, in rpmh_rsc_send_data()
661 tcs->req[tcs_id - tcs->offset] = msg; in rpmh_rsc_send_data()
662 set_bit(tcs_id, drv->tcs_in_use); in rpmh_rsc_send_data()
669 write_tcs_reg_sync(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id, 0); in rpmh_rsc_send_data()
670 enable_tcs_irq(drv, tcs_id, true); in rpmh_rsc_send_data()
682 __tcs_buffer_write(drv, tcs_id, 0, msg); in rpmh_rsc_send_data()
683 __tcs_set_trigger(drv, tcs_id, true); in rpmh_rsc_send_data()
704 int *tcs_id, int *cmd_id) in find_slots() argument
721 *tcs_id = offset + tcs->offset; in find_slots()
743 int tcs_id = 0, cmd_id = 0; in rpmh_rsc_write_ctrl_data() local
751 ret = find_slots(tcs, msg, &tcs_id, &cmd_id); in rpmh_rsc_write_ctrl_data()
753 __tcs_buffer_write(drv, tcs_id, cmd_id, msg); in rpmh_rsc_write_ctrl_data()