Lines Matching defs:promise
325 * pchan and, if successful, will configure it to fulfill a promise
333 struct sun4i_dma_promise *promise = NULL;
378 promise = list_first_entry(&contract->demands,
380 vchan->processing = promise;
383 if (promise) {
387 configure_pchan(pchan, promise);
434 * Generate a promise, to be used in a normal DMA contract.
436 * A NDMA promise contains all the information required to program the
438 * promise will live in the demands list on a contract. Once it has been
447 struct sun4i_dma_promise *promise;
454 promise = kzalloc(sizeof(*promise), GFP_NOWAIT);
455 if (!promise)
458 promise->src = src;
459 promise->dst = dest;
460 promise->len = len;
461 promise->cfg = SUN4I_DMA_CFG_LOADING |
473 promise->cfg |= SUN4I_DMA_CFG_SRC_BURST_LENGTH(ret);
479 promise->cfg |= SUN4I_DMA_CFG_DST_BURST_LENGTH(ret);
485 promise->cfg |= SUN4I_DMA_CFG_SRC_DATA_WIDTH(ret);
491 promise->cfg |= SUN4I_DMA_CFG_DST_DATA_WIDTH(ret);
493 return promise;
496 kfree(promise);
501 * Generate a promise, to be used in a dedicated DMA contract.
503 * A DDMA promise contains all the information required to program the
505 * promise will live in the demands list on a contract. Once it has been
513 struct sun4i_dma_promise *promise;
516 promise = kzalloc(sizeof(*promise), GFP_NOWAIT);
517 if (!promise)
520 promise->src = src;
521 promise->dst = dest;
522 promise->len = len;
523 promise->cfg = SUN4I_DMA_CFG_LOADING |
530 promise->cfg |= SUN4I_DMA_CFG_SRC_BURST_LENGTH(ret);
536 promise->cfg |= SUN4I_DMA_CFG_DST_BURST_LENGTH(ret);
542 promise->cfg |= SUN4I_DMA_CFG_SRC_DATA_WIDTH(ret);
548 promise->cfg |= SUN4I_DMA_CFG_DST_DATA_WIDTH(ret);
550 return promise;
553 kfree(promise);
563 * after another. Each piece is represented as a promise.
580 * Get next promise on a cyclic transfer
583 * loop. This function returns the next promise from a cyclic contract,
589 struct sun4i_dma_promise *promise;
591 promise = list_first_entry_or_null(&contract->demands,
593 if (!promise) {
596 promise = list_first_entry(&contract->demands,
600 return promise;
609 struct sun4i_dma_promise *promise, *tmp;
612 list_for_each_entry_safe(promise, tmp, &contract->demands, list)
613 kfree(promise);
615 list_for_each_entry_safe(promise, tmp, &contract->completed_demands, list)
616 kfree(promise);
627 struct sun4i_dma_promise *promise;
645 promise = generate_ddma_promise(chan, src, dest, len, sconfig);
647 promise = generate_ndma_promise(chan, src, dest, len, sconfig,
650 if (!promise) {
657 promise->cfg |= SUN4I_DMA_CFG_SRC_DRQ_TYPE(SUN4I_DDMA_DRQ_TYPE_SDRAM) |
660 promise->cfg |= SUN4I_DMA_CFG_SRC_DRQ_TYPE(SUN4I_NDMA_DRQ_TYPE_SDRAM) |
664 /* Fill the contract with our only promise */
665 list_add_tail(&promise->list, &contract->demands);
678 struct sun4i_dma_promise *promise;
724 * out of a promise, so we need to program the DMA engine less
750 * This only works if two periods fit in a single promise. That will
769 /* Make the promise */
771 promise = generate_ddma_promise(chan, src, dest,
774 promise = generate_ndma_promise(chan, src, dest,
777 if (!promise) {
781 promise->cfg |= endpoints;
784 list_add_tail(&promise->list, &contract->demands);
798 struct sun4i_dma_promise *promise;
860 /* And make a suitable promise */
862 promise = generate_ddma_promise(chan, srcaddr, dstaddr,
866 promise = generate_ndma_promise(chan, srcaddr, dstaddr,
870 if (!promise)
873 promise->cfg |= endpoints;
874 promise->para = para;
877 list_add_tail(&promise->list, &contract->demands);
970 struct sun4i_dma_promise *promise;
986 list_for_each_entry(promise, &contract->demands, list)
987 bytes += promise->len;
994 promise = list_first_entry_or_null(&contract->demands,
996 if (promise && pchan) {
997 bytes -= promise->len;
1036 struct sun4i_dma_promise *promise;
1062 * Move the promise into the completed list now that
1082 promise = get_next_cyclic_promise(contract);
1083 vchan->processing = promise;
1084 configure_pchan(pchan, promise);