Lines Matching refs:instr
851 meson_nand_op_get_dma_safe_input_buf(const struct nand_op_instr *instr) in meson_nand_op_get_dma_safe_input_buf() argument
853 if (WARN_ON(instr->type != NAND_OP_DATA_IN_INSTR)) in meson_nand_op_get_dma_safe_input_buf()
856 if (meson_nfc_is_buffer_dma_safe(instr->ctx.data.buf.in)) in meson_nand_op_get_dma_safe_input_buf()
857 return instr->ctx.data.buf.in; in meson_nand_op_get_dma_safe_input_buf()
859 return kzalloc(instr->ctx.data.len, GFP_KERNEL); in meson_nand_op_get_dma_safe_input_buf()
863 meson_nand_op_put_dma_safe_input_buf(const struct nand_op_instr *instr, in meson_nand_op_put_dma_safe_input_buf() argument
866 if (WARN_ON(instr->type != NAND_OP_DATA_IN_INSTR) || in meson_nand_op_put_dma_safe_input_buf()
870 if (buf == instr->ctx.data.buf.in) in meson_nand_op_put_dma_safe_input_buf()
873 memcpy(instr->ctx.data.buf.in, buf, instr->ctx.data.len); in meson_nand_op_put_dma_safe_input_buf()
878 meson_nand_op_get_dma_safe_output_buf(const struct nand_op_instr *instr) in meson_nand_op_get_dma_safe_output_buf() argument
880 if (WARN_ON(instr->type != NAND_OP_DATA_OUT_INSTR)) in meson_nand_op_get_dma_safe_output_buf()
883 if (meson_nfc_is_buffer_dma_safe(instr->ctx.data.buf.out)) in meson_nand_op_get_dma_safe_output_buf()
884 return (void *)instr->ctx.data.buf.out; in meson_nand_op_get_dma_safe_output_buf()
886 return kmemdup(instr->ctx.data.buf.out, in meson_nand_op_get_dma_safe_output_buf()
887 instr->ctx.data.len, GFP_KERNEL); in meson_nand_op_get_dma_safe_output_buf()
891 meson_nand_op_put_dma_safe_output_buf(const struct nand_op_instr *instr, in meson_nand_op_put_dma_safe_output_buf() argument
894 if (WARN_ON(instr->type != NAND_OP_DATA_OUT_INSTR) || in meson_nand_op_put_dma_safe_output_buf()
898 if (buf != instr->ctx.data.buf.out) in meson_nand_op_put_dma_safe_output_buf()
907 const struct nand_op_instr *instr = NULL; in meson_nfc_exec_op() local
917 instr = &op->instrs[op_id]; in meson_nfc_exec_op()
918 delay_idle = DIV_ROUND_UP(PSEC_TO_NSEC(instr->delay_ns), in meson_nfc_exec_op()
921 switch (instr->type) { in meson_nfc_exec_op()
924 cmd |= instr->ctx.cmd.opcode & 0xff; in meson_nfc_exec_op()
930 for (i = 0; i < instr->ctx.addr.naddrs; i++) { in meson_nfc_exec_op()
932 cmd |= instr->ctx.addr.addrs[i] & 0xff; in meson_nfc_exec_op()
939 buf = meson_nand_op_get_dma_safe_input_buf(instr); in meson_nfc_exec_op()
942 meson_nfc_read_buf(nand, buf, instr->ctx.data.len); in meson_nfc_exec_op()
943 meson_nand_op_put_dma_safe_input_buf(instr, buf); in meson_nfc_exec_op()
947 buf = meson_nand_op_get_dma_safe_output_buf(instr); in meson_nfc_exec_op()
950 meson_nfc_write_buf(nand, buf, instr->ctx.data.len); in meson_nfc_exec_op()
951 meson_nand_op_put_dma_safe_output_buf(instr, buf); in meson_nfc_exec_op()
955 meson_nfc_queue_rb(nfc, instr->ctx.waitrdy.timeout_ms); in meson_nfc_exec_op()
956 if (instr->delay_ns) in meson_nfc_exec_op()