Lines Matching refs:pkt

122 int cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, size_t size)  in cmdq_pkt_create()  argument
127 pkt->va_base = kzalloc(size, GFP_KERNEL); in cmdq_pkt_create()
128 if (!pkt->va_base) in cmdq_pkt_create()
131 pkt->buf_size = size; in cmdq_pkt_create()
134 dma_addr = dma_map_single(dev, pkt->va_base, pkt->buf_size, in cmdq_pkt_create()
138 kfree(pkt->va_base); in cmdq_pkt_create()
142 pkt->pa_base = dma_addr; in cmdq_pkt_create()
148 void cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt) in cmdq_pkt_destroy() argument
150 dma_unmap_single(client->chan->mbox->dev, pkt->pa_base, pkt->buf_size, in cmdq_pkt_destroy()
152 kfree(pkt->va_base); in cmdq_pkt_destroy()
156 static int cmdq_pkt_append_command(struct cmdq_pkt *pkt, in cmdq_pkt_append_command() argument
161 if (unlikely(pkt->cmd_buf_size + CMDQ_INST_SIZE > pkt->buf_size)) { in cmdq_pkt_append_command()
170 pkt->cmd_buf_size += CMDQ_INST_SIZE; in cmdq_pkt_append_command()
172 __func__, (u32)pkt->buf_size); in cmdq_pkt_append_command()
176 cmd_ptr = pkt->va_base + pkt->cmd_buf_size; in cmdq_pkt_append_command()
178 pkt->cmd_buf_size += CMDQ_INST_SIZE; in cmdq_pkt_append_command()
183 int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value) in cmdq_pkt_write() argument
192 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write()
196 int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, in cmdq_pkt_write_mask() argument
206 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_mask()
212 err = cmdq_pkt_write(pkt, subsys, offset_mask, value); in cmdq_pkt_write_mask()
218 int cmdq_pkt_read_s(struct cmdq_pkt *pkt, u16 high_addr_reg_idx, u16 addr_low, in cmdq_pkt_read_s() argument
229 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_read_s()
233 int cmdq_pkt_write_s(struct cmdq_pkt *pkt, u16 high_addr_reg_idx, in cmdq_pkt_write_s() argument
244 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s()
248 int cmdq_pkt_write_s_mask(struct cmdq_pkt *pkt, u16 high_addr_reg_idx, in cmdq_pkt_write_s_mask() argument
256 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s_mask()
267 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s_mask()
271 int cmdq_pkt_write_s_value(struct cmdq_pkt *pkt, u8 high_addr_reg_idx, in cmdq_pkt_write_s_value() argument
281 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s_value()
285 int cmdq_pkt_write_s_mask_value(struct cmdq_pkt *pkt, u8 high_addr_reg_idx, in cmdq_pkt_write_s_mask_value() argument
293 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s_mask_value()
302 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_write_s_mask_value()
306 int cmdq_pkt_mem_move(struct cmdq_pkt *pkt, dma_addr_t src_addr, dma_addr_t dst_addr) in cmdq_pkt_mem_move() argument
313 ret = cmdq_pkt_assign(pkt, high_addr_reg_idx, CMDQ_ADDR_HIGH(src_addr)); in cmdq_pkt_mem_move()
316 ret = cmdq_pkt_read_s(pkt, high_addr_reg_idx, CMDQ_ADDR_LOW(src_addr), value_reg_idx); in cmdq_pkt_mem_move()
321 ret = cmdq_pkt_assign(pkt, high_addr_reg_idx, CMDQ_ADDR_HIGH(dst_addr)); in cmdq_pkt_mem_move()
324 ret = cmdq_pkt_write_s(pkt, high_addr_reg_idx, CMDQ_ADDR_LOW(dst_addr), value_reg_idx); in cmdq_pkt_mem_move()
332 int cmdq_pkt_wfe(struct cmdq_pkt *pkt, u16 event, bool clear) in cmdq_pkt_wfe() argument
344 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_wfe()
348 int cmdq_pkt_acquire_event(struct cmdq_pkt *pkt, u16 event) in cmdq_pkt_acquire_event() argument
359 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_acquire_event()
363 int cmdq_pkt_clear_event(struct cmdq_pkt *pkt, u16 event) in cmdq_pkt_clear_event() argument
374 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_clear_event()
378 int cmdq_pkt_set_event(struct cmdq_pkt *pkt, u16 event) in cmdq_pkt_set_event() argument
389 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_set_event()
393 int cmdq_pkt_poll(struct cmdq_pkt *pkt, u8 subsys, in cmdq_pkt_poll() argument
403 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_poll()
409 int cmdq_pkt_poll_mask(struct cmdq_pkt *pkt, u8 subsys, in cmdq_pkt_poll_mask() argument
417 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_poll_mask()
422 err = cmdq_pkt_poll(pkt, subsys, offset, value); in cmdq_pkt_poll_mask()
428 int cmdq_pkt_poll_addr(struct cmdq_pkt *pkt, dma_addr_t addr, u32 value, u32 mask) in cmdq_pkt_poll_addr() argument
441 ret = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_poll_addr()
457 ret = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_poll_addr()
467 ret = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_poll_addr()
475 int cmdq_pkt_logic_command(struct cmdq_pkt *pkt, u16 result_reg_idx, in cmdq_pkt_logic_command() argument
494 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_logic_command()
498 int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value) in cmdq_pkt_assign() argument
506 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_assign()
510 int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) in cmdq_pkt_jump_abs() argument
517 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_jump_abs()
521 int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa) in cmdq_pkt_jump_rel() argument
527 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_jump_rel()
531 int cmdq_pkt_eoc(struct cmdq_pkt *pkt) in cmdq_pkt_eoc() argument
537 return cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_eoc()
541 int cmdq_pkt_finalize(struct cmdq_pkt *pkt) in cmdq_pkt_finalize() argument
549 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_finalize()
556 cmdq_get_shift_pa(((struct cmdq_client *)pkt->cl)->chan); in cmdq_pkt_finalize()
557 err = cmdq_pkt_append_command(pkt, inst); in cmdq_pkt_finalize()