Lines Matching refs:ctx

1042 void mec_hal_qspi_context_init(struct mec_qspi_context *ctx)  in mec_hal_qspi_context_init()  argument
1044 ctx->ndescrs = 0; in mec_hal_qspi_context_init()
1045 ctx->ntxdma = 0; in mec_hal_qspi_context_init()
1046 ctx->nrxdma = 0; in mec_hal_qspi_context_init()
1047 ctx->xflags = 0; in mec_hal_qspi_context_init()
1049 ctx->descrs[n] = 0; in mec_hal_qspi_context_init()
1053 uint8_t mec_hal_qspi_ctx_alloc_ldma_chan(struct mec_qspi_context *ctx, uint8_t is_tx) in mec_hal_qspi_ctx_alloc_ldma_chan() argument
1055 if (!ctx) { in mec_hal_qspi_ctx_alloc_ldma_chan()
1060 if (ctx->ntxdma < MEC5_QSPI_LDMA_CHANNELS) { in mec_hal_qspi_ctx_alloc_ldma_chan()
1061 return ++ctx->ntxdma; in mec_hal_qspi_ctx_alloc_ldma_chan()
1064 if (ctx->nrxdma < MEC5_QSPI_LDMA_CHANNELS) { in mec_hal_qspi_ctx_alloc_ldma_chan()
1065 return ++ctx->nrxdma; in mec_hal_qspi_ctx_alloc_ldma_chan()
1087 int mec_hal_qspi_cfg_gen_ts_clocks(struct mec_qspi_context *ctx, uint32_t nclocks, in mec_hal_qspi_cfg_gen_ts_clocks() argument
1100 didx = ctx->ndescrs; in mec_hal_qspi_cfg_gen_ts_clocks()
1114 ctx->descrs[didx] = descr; in mec_hal_qspi_cfg_gen_ts_clocks()
1115 ctx->ndescrs++; in mec_hal_qspi_cfg_gen_ts_clocks()
1192 uint32_t mec_hal_qspi_descrs_cfg1(struct mec_qspi_context *ctx, uint32_t nbytes, uint32_t flags) in mec_hal_qspi_descrs_cfg1() argument
1199 if (!ctx) { in mec_hal_qspi_descrs_cfg1()
1218 didx = ctx->ndescrs; in mec_hal_qspi_descrs_cfg1()
1234 ctx->descrs[didx] = (((nu << MEC_QSPI_DESCR_QNUNITS_Pos) & MEC_QSPI_DESCR_QNUNITS_Msk) in mec_hal_qspi_descrs_cfg1()
1239 ctx->descrs[didx] = (((nb << MEC_QSPI_DESCR_QNUNITS_Pos) & MEC_QSPI_DESCR_QNUNITS_Msk) in mec_hal_qspi_descrs_cfg1()
1247 ctx->ndescrs = didx; in mec_hal_qspi_descrs_cfg1()
1252 int mec_hal_qspi_load_descrs(struct mec_qspi_regs *regs, struct mec_qspi_context *ctx, in mec_hal_qspi_load_descrs() argument
1258 if (!regs || !ctx) { in mec_hal_qspi_load_descrs()
1262 if (!ctx->ndescrs) { in mec_hal_qspi_load_descrs()
1267 max_ndescr = (size_t)ctx->ndescrs; in mec_hal_qspi_load_descrs()
1274 descr = ctx->descrs[didx]; in mec_hal_qspi_load_descrs()