Lines Matching refs:subop
2272 * @subop: Sub-operation to be passed to the NAND controller
2280 struct nand_subop subop;
2347 * @ctx->subop is updated with the set of instructions to be passed to the
2354 unsigned int instr_offset = ctx->subop.first_instr_start_off;
2356 const struct nand_op_instr *instr = ctx->subop.instrs;
2380 * start of the next subop chunk).
2414 * We have a match: update the subop structure accordingly and return
2417 ctx->subop.ninstrs = ninstrs;
2418 ctx->subop.last_instr_end_off = instr_offset;
2430 pr_debug("executing subop (CS%d):\n", ctx->subop.cs);
2435 if (instr == &ctx->subop.instrs[0])
2440 if (instr == &ctx->subop.instrs[ctx->subop.ninstrs - 1])
2454 if (a->subop.ninstrs < b->subop.ninstrs)
2456 else if (a->subop.ninstrs > b->subop.ninstrs)
2459 if (a->subop.last_instr_end_off < b->subop.last_instr_end_off)
2461 else if (a->subop.last_instr_end_off > b->subop.last_instr_end_off)
2494 .subop.cs = op->cs,
2495 .subop.instrs = op->instrs,
2501 while (ctx.subop.instrs < op->instrs + op->ninstrs) {
2531 ret = pattern->exec(chip, &ctx.subop);
2538 * next subop.
2540 ctx.subop.instrs = ctx.subop.instrs + ctx.subop.ninstrs;
2541 if (ctx.subop.last_instr_end_off)
2542 ctx.subop.instrs -= 1;
2544 ctx.subop.first_instr_start_off = ctx.subop.last_instr_end_off;
2557 static bool nand_subop_instr_is_valid(const struct nand_subop *subop,
2560 return subop && instr_idx < subop->ninstrs;
2563 static unsigned int nand_subop_get_start_off(const struct nand_subop *subop,
2569 return subop->first_instr_start_off;
2574 * @subop: The entire sub-operation
2583 unsigned int nand_subop_get_addr_start_off(const struct nand_subop *subop,
2586 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2587 subop->instrs[instr_idx].type != NAND_OP_ADDR_INSTR))
2590 return nand_subop_get_start_off(subop, instr_idx);
2596 * @subop: The entire sub-operation
2605 unsigned int nand_subop_get_num_addr_cyc(const struct nand_subop *subop,
2610 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2611 subop->instrs[instr_idx].type != NAND_OP_ADDR_INSTR))
2614 start_off = nand_subop_get_addr_start_off(subop, instr_idx);
2616 if (instr_idx == subop->ninstrs - 1 &&
2617 subop->last_instr_end_off)
2618 end_off = subop->last_instr_end_off;
2620 end_off = subop->instrs[instr_idx].ctx.addr.naddrs;
2628 * @subop: The entire sub-operation
2637 unsigned int nand_subop_get_data_start_off(const struct nand_subop *subop,
2640 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2641 !nand_instr_is_data(&subop->instrs[instr_idx])))
2644 return nand_subop_get_start_off(subop, instr_idx);
2650 * @subop: The entire sub-operation
2659 unsigned int nand_subop_get_data_len(const struct nand_subop *subop,
2664 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2665 !nand_instr_is_data(&subop->instrs[instr_idx])))
2668 start_off = nand_subop_get_data_start_off(subop, instr_idx);
2670 if (instr_idx == subop->ninstrs - 1 &&
2671 subop->last_instr_end_off)
2672 end_off = subop->last_instr_end_off;
2674 end_off = subop->instrs[instr_idx].ctx.data.len;