Lines Matching +full:instance +full:- +full:specific
10 * SPDX-License-Identifier: Apache-2.0
56 * This and higher values are dma controller or soc specific.
137 * - 0b00 increment
138 * - 0b01 decrement
139 * - 0b10 no change
145 * - 0b00 increment
146 * - 0b01 decrement
147 * - 0b10 no change
154 /** FIFO fill before starting transfer, HW specific meaning */
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
198 /** Which peripheral and direction, HW specific */
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
227 * Source handshake, HW specific
229 * - 0b0 HW
230 * - 0b1 SW
234 * Destination handshake, HW specific
236 * - 0b0 HW
237 * - 0b1 SW
241 * Channel priority for arbitration, HW specific
244 /** Source chaining enable, HW specific */
246 /** Destination chaining enable, HW specific */
248 /** Linked channel, HW specific */
250 /** Cyclic transfer list, HW specific */
280 /** Pending length to be transferred in bytes, HW specific */
282 /** Available buffers space, HW specific */
284 /** Write position in circular DMA buffer, HW specific */
286 /** Read position in circular DMA buffer, HW specific */
288 /** Total copied, HW specific */
295 * of DMA client driver Data, got by dev->data
346 * @param dev Pointer to the DMA device instance
363 * @param dev Pointer to the DMA device instance
388 * @param dev Pointer to the device structure for the driver instance.
400 (const struct dma_driver_api *)dev->api; in dma_config()
402 return api->config(dev, channel, config); in dma_config()
408 * @param dev Pointer to the device structure for the driver instance.
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()
441 * return -EINVAL if it is invalid.
448 * @param dev Pointer to the device structure for the driver instance.
460 (const struct dma_driver_api *)dev->api; in z_impl_dma_start()
462 return api->start(dev, channel); in z_impl_dma_start()
469 * return -EINVAL if it is invalid.
476 * @param dev Pointer to the device structure for the driver instance.
488 (const struct dma_driver_api *)dev->api; in z_impl_dma_stop()
490 return api->stop(dev, channel); in z_impl_dma_stop()
498 * in and return -EINVAL if either are invalid.
502 * @param dev Pointer to the device structure for the driver instance.
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()
526 * in and return -EINVAL if either are invalid.
530 * @param dev Pointer to the device structure for the driver instance.
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.
560 * @param dev Pointer to the device structure for the driver instance.
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()
607 * @param dev Pointer to the device structure for the driver instance.
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()
640 * @param dev Pointer to the device structure for the driver instance.
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()
667 * return -EINVAL if it is invalid or -ENOSYS if not supported.
671 * @param dev Pointer to the device structure for the driver instance.
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()
695 * This function allows to get a device specific static or runtime attribute like required address
698 * return -EINVAL if it is invalid or -ENOSYS if not supported.
702 * @param dev Pointer to the device structure for the driver instance.
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()