Lines Matching defs:subop

1953  * @subop: Sub-operation to be passed to the NAND controller
1961 struct nand_subop subop;
2028 * @ctx->subop is updated with the set of instructions to be passed to the
2035 unsigned int instr_offset = ctx->subop.first_instr_start_off;
2037 const struct nand_op_instr *instr = ctx->subop.instrs;
2061 * start of the next subop chunk).
2095 * We have a match: update the subop structure accordingly and return
2098 ctx->subop.ninstrs = ninstrs;
2099 ctx->subop.last_instr_end_off = instr_offset;
2111 pr_debug("executing subop (CS%d):\n", ctx->subop.cs);
2116 if (instr == &ctx->subop.instrs[0])
2121 if (instr == &ctx->subop.instrs[ctx->subop.ninstrs - 1])
2135 if (a->subop.ninstrs < b->subop.ninstrs)
2137 else if (a->subop.ninstrs > b->subop.ninstrs)
2140 if (a->subop.last_instr_end_off < b->subop.last_instr_end_off)
2142 else if (a->subop.last_instr_end_off > b->subop.last_instr_end_off)
2175 .subop.cs = op->cs,
2176 .subop.instrs = op->instrs,
2182 while (ctx.subop.instrs < op->instrs + op->ninstrs) {
2212 ret = pattern->exec(chip, &ctx.subop);
2219 * next subop.
2221 ctx.subop.instrs = ctx.subop.instrs + ctx.subop.ninstrs;
2222 if (ctx.subop.last_instr_end_off)
2223 ctx.subop.instrs -= 1;
2225 ctx.subop.first_instr_start_off = ctx.subop.last_instr_end_off;
2238 static bool nand_subop_instr_is_valid(const struct nand_subop *subop,
2241 return subop && instr_idx < subop->ninstrs;
2244 static unsigned int nand_subop_get_start_off(const struct nand_subop *subop,
2250 return subop->first_instr_start_off;
2255 * @subop: The entire sub-operation
2264 unsigned int nand_subop_get_addr_start_off(const struct nand_subop *subop,
2267 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2268 subop->instrs[instr_idx].type != NAND_OP_ADDR_INSTR))
2271 return nand_subop_get_start_off(subop, instr_idx);
2277 * @subop: The entire sub-operation
2286 unsigned int nand_subop_get_num_addr_cyc(const struct nand_subop *subop,
2291 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2292 subop->instrs[instr_idx].type != NAND_OP_ADDR_INSTR))
2295 start_off = nand_subop_get_addr_start_off(subop, instr_idx);
2297 if (instr_idx == subop->ninstrs - 1 &&
2298 subop->last_instr_end_off)
2299 end_off = subop->last_instr_end_off;
2301 end_off = subop->instrs[instr_idx].ctx.addr.naddrs;
2309 * @subop: The entire sub-operation
2318 unsigned int nand_subop_get_data_start_off(const struct nand_subop *subop,
2321 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2322 !nand_instr_is_data(&subop->instrs[instr_idx])))
2325 return nand_subop_get_start_off(subop, instr_idx);
2331 * @subop: The entire sub-operation
2340 unsigned int nand_subop_get_data_len(const struct nand_subop *subop,
2345 if (WARN_ON(!nand_subop_instr_is_valid(subop, instr_idx) ||
2346 !nand_instr_is_data(&subop->instrs[instr_idx])))
2349 start_off = nand_subop_get_data_start_off(subop, instr_idx);
2351 if (instr_idx == subop->ninstrs - 1 &&
2352 subop->last_instr_end_off)
2353 end_off = subop->last_instr_end_off;
2355 end_off = subop->instrs[instr_idx].ctx.data.len;