Lines Matching +full:burst +full:- +full:length
10 * SPDX-License-Identifier: Apache-2.0
137 * - 0b00 increment
138 * - 0b01 decrement
139 * - 0b10 no change
145 * - 0b00 increment
146 * - 0b01 decrement
147 * - 0b10 no change
159 * - 0b0 source request service upon data availability
160 * - 0b1 source request postponed until destination request happens
185 * - DMA_STATUS_COMPLETE buffer fully consumed
186 * - DMA_STATUS_BLOCK buffer consumption reached a configured block
188 * - A negative errno otherwise
203 * - 0b000 memory to memory,
204 * - 0b001 memory to peripheral,
205 * - 0b010 peripheral to memory,
206 * - 0b011 peripheral to peripheral,
207 * - 0b100 host to memory
208 * - 0b101 memory to host
209 * - others hardware specific
215 * - 0b0 callback invoked at transfer list completion only
216 * - 0b1 callback invoked at completion of each block
222 * - 0b0 error callback enabled
223 * - 0b1 error callback disabled
229 * - 0b0 HW
230 * - 0b1 SW
236 * - 0b0 HW
237 * - 0b1 SW
258 /** Source burst length in bytes */
260 /** Destination burst length in bytes */
280 /** Pending length to be transferred in bytes, HW specific */
295 * of DMA client driver Data, got by dev->data
400 (const struct dma_driver_api *)dev->api;
402 return api->config(dev, channel, config);
427 (const struct dma_driver_api *)dev->api;
429 if (api->reload) {
430 return api->reload(dev, channel, src, dst, size);
433 return -ENOSYS;
441 * return -EINVAL if it is invalid.
460 (const struct dma_driver_api *)dev->api;
462 return api->start(dev, channel);
469 * return -EINVAL if it is invalid.
488 (const struct dma_driver_api *)dev->api;
490 return api->stop(dev, channel);
498 * in and return -EINVAL if either are invalid.
506 * @retval -ENOSYS If not implemented.
507 * @retval -EINVAL If invalid channel id or state.
508 * @retval -errno Other negative errno code failure.
514 const struct dma_driver_api *api = (const struct dma_driver_api *)dev->api;
516 if (api->suspend == NULL) {
517 return -ENOSYS;
519 return api->suspend(dev, channel);
526 * in and return -EINVAL if either are invalid.
534 * @retval -ENOSYS If not implemented
535 * @retval -EINVAL If invalid channel id or state.
536 * @retval -errno Other negative errno code failure.
542 const struct dma_driver_api *api = (const struct dma_driver_api *)dev->api;
544 if (api->resume == NULL) {
545 return -ENOSYS;
547 return api->resume(dev, channel);
554 * return -EINVAL if there is no valid channel available.
573 int channel = -EINVAL;
575 (const struct dma_driver_api *)dev->api;
577 struct dma_context *dma_ctx = (struct dma_context *)dev->data;
579 if (dma_ctx->magic != DMA_MAGIC) {
583 for (i = 0; i < dma_ctx->dma_channels; i++) {
584 if (!atomic_test_and_set_bit(dma_ctx->atomic, i)) {
585 if (api->chan_filter &&
586 !api->chan_filter(dev, i, filter_param)) {
587 atomic_clear_bit(dma_ctx->atomic, i);
618 (const struct dma_driver_api *)dev->api;
619 struct dma_context *dma_ctx = (struct dma_context *)dev->data;
621 if (dma_ctx->magic != DMA_MAGIC) {
625 if ((int)channel < dma_ctx->dma_channels) {
626 if (api->chan_release) {
627 api->chan_release(dev, channel);
630 atomic_clear_bit(dma_ctx->atomic, channel);
654 (const struct dma_driver_api *)dev->api;
656 if (api->chan_filter) {
657 return api->chan_filter(dev, channel, filter_param);
660 return -ENOSYS;
667 * return -EINVAL if it is invalid or -ENOSYS if not supported.
674 * @param stat a non-NULL dma_status object for storing DMA status
676 * @retval non-negative if successful.
683 (const struct dma_driver_api *)dev->api;
685 if (api->get_status) {
686 return api->get_status(dev, channel, stat);
689 return -ENOSYS;
698 * return -EINVAL if it is invalid or -ENOSYS if not supported.
704 * @param value A non-NULL pointer to the variable where the read value is to be placed
706 * @retval non-negative if successful.
711 const struct dma_driver_api *api = (const struct dma_driver_api *)dev->api;
713 if (api->get_attribute) {
714 return api->get_attribute(dev, type, value);
717 return -ENOSYS;
721 * @brief Look-up generic width index to be used in registers
723 * @warning This look-up works for most controllers, but *may* not work for
727 * your own look-up inside the controller driver.
750 * @brief Look-up generic burst index to be used in registers
752 * @warning This look-up works for most controllers, but *may* not work for
756 * your own look-up inside the controller driver.
758 * @param burst: number of bytes to be sent in a single burst
762 static inline uint32_t dma_burst_index(uint32_t burst)
764 /* Check boundaries (max supported burst length is 256) */
765 if (burst < 1 || burst > 256) {
766 return 0; /* Zero is the default (1 burst length) */
769 /* Ensure burst is a power of 2 */
770 if (!(burst & (burst - 1))) {
771 return 0; /* Zero is the default (1 burst length) */
775 return find_msb_set(burst);