Lines Matching +full:validity +full:- +full:control

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
157 * Transfer flow control mode
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
295 * of DMA client driver Data, got by dev->data
400 (const struct dma_driver_api *)dev->api; in dma_config()
402 return api->config(dev, channel, config); in dma_config()
427 (const struct dma_driver_api *)dev->api; in dma_reload()
429 if (api->reload) { in dma_reload()
430 return api->reload(dev, channel, src, dst, size); in dma_reload()
433 return -ENOSYS; in dma_reload()
440 * Implementations must check the validity of the channel ID passed in and
441 * return -EINVAL if it is invalid.
460 (const struct dma_driver_api *)dev->api; in z_impl_dma_start()
462 return api->start(dev, channel); in z_impl_dma_start()
468 * Implementations must check the validity of the channel ID passed in and
469 * return -EINVAL if it is invalid.
488 (const struct dma_driver_api *)dev->api; in z_impl_dma_stop()
490 return api->stop(dev, channel); in z_impl_dma_stop()
497 * Implementations must check the validity of the channel state and ID passed
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; in z_impl_dma_suspend()
516 if (api->suspend == NULL) { in z_impl_dma_suspend()
517 return -ENOSYS; in z_impl_dma_suspend()
519 return api->suspend(dev, channel); in z_impl_dma_suspend()
525 * Implementations must check the validity of the channel state and ID passed
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; in z_impl_dma_resume()
544 if (api->resume == NULL) { in z_impl_dma_resume()
545 return -ENOSYS; in z_impl_dma_resume()
547 return api->resume(dev, channel); in z_impl_dma_resume()
554 * return -EINVAL if there is no valid channel available.
573 int channel = -EINVAL; in z_impl_dma_request_channel()
575 (const struct dma_driver_api *)dev->api; in z_impl_dma_request_channel()
577 struct dma_context *dma_ctx = (struct dma_context *)dev->data; in z_impl_dma_request_channel()
579 if (dma_ctx->magic != DMA_MAGIC) { in z_impl_dma_request_channel()
583 for (i = 0; i < dma_ctx->dma_channels; i++) { in z_impl_dma_request_channel()
584 if (!atomic_test_and_set_bit(dma_ctx->atomic, i)) { in z_impl_dma_request_channel()
585 if (api->chan_filter && in z_impl_dma_request_channel()
586 !api->chan_filter(dev, i, filter_param)) { in z_impl_dma_request_channel()
587 atomic_clear_bit(dma_ctx->atomic, i); in z_impl_dma_request_channel()
618 (const struct dma_driver_api *)dev->api; in z_impl_dma_release_channel()
619 struct dma_context *dma_ctx = (struct dma_context *)dev->data; in z_impl_dma_release_channel()
621 if (dma_ctx->magic != DMA_MAGIC) { in z_impl_dma_release_channel()
625 if ((int)channel < dma_ctx->dma_channels) { in z_impl_dma_release_channel()
626 if (api->chan_release) { in z_impl_dma_release_channel()
627 api->chan_release(dev, channel); in z_impl_dma_release_channel()
630 atomic_clear_bit(dma_ctx->atomic, channel); in z_impl_dma_release_channel()
654 (const struct dma_driver_api *)dev->api; in z_impl_dma_chan_filter()
656 if (api->chan_filter) { in z_impl_dma_chan_filter()
657 return api->chan_filter(dev, channel, filter_param); in z_impl_dma_chan_filter()
660 return -ENOSYS; in z_impl_dma_chan_filter()
666 * Implementations must check the validity of the channel ID passed in and
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; in dma_get_status()
685 if (api->get_status) { in dma_get_status()
686 return api->get_status(dev, channel, stat); in dma_get_status()
689 return -ENOSYS; in dma_get_status()
697 * Implementations must check the validity of the type passed in and
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; in dma_get_attribute()
713 if (api->get_attribute) { in dma_get_attribute()
714 return api->get_attribute(dev, type, value); in dma_get_attribute()
717 return -ENOSYS; in dma_get_attribute()
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.
770 if (!(burst & (burst - 1))) { in dma_burst_index()