diff --git a/drivers/api/no_os_spi.c b/drivers/api/no_os_spi.c index ac2b53b71fb..f752e014b54 100644 --- a/drivers/api/no_os_spi.c +++ b/drivers/api/no_os_spi.c @@ -228,8 +228,8 @@ int32_t no_os_spi_transfer_dma(struct no_os_spi_desc *desc, if (!desc || !desc->platform_ops || !msgs || !len) return -EINVAL; - if (desc->platform_ops->dma_transfer_sync) - return desc->platform_ops->dma_transfer_sync(desc, msgs, len); + if (desc->platform_ops->transfer_dma) + return desc->platform_ops->transfer_dma(desc, msgs, len); return -ENOSYS; } @@ -254,8 +254,8 @@ int32_t no_os_spi_transfer_dma_async(struct no_os_spi_desc *desc, if (!desc || !desc->platform_ops || !msgs || !len) return -EINVAL; - if (desc->platform_ops->dma_transfer_async) - return desc->platform_ops->dma_transfer_async(desc, msgs, len, + if (desc->platform_ops->transfer_dma_async) + return desc->platform_ops->transfer_dma_async(desc, msgs, len, callback, ctx); return -ENOSYS; diff --git a/drivers/platform/maxim/max32650/maxim_spi.c b/drivers/platform/maxim/max32650/maxim_spi.c index a668dd64202..096e0c2ecde 100644 --- a/drivers/platform/maxim/max32650/maxim_spi.c +++ b/drivers/platform/maxim/max32650/maxim_spi.c @@ -630,9 +630,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -647,7 +647,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -789,7 +789,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/maxim/max32655/maxim_spi.c b/drivers/platform/maxim/max32655/maxim_spi.c index e94c36080fa..5ef0b307123 100644 --- a/drivers/platform/maxim/max32655/maxim_spi.c +++ b/drivers/platform/maxim/max32655/maxim_spi.c @@ -529,9 +529,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -546,7 +546,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -688,7 +688,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/maxim/max32660/maxim_spi.c b/drivers/platform/maxim/max32660/maxim_spi.c index d799a45659b..bcb8d619f21 100644 --- a/drivers/platform/maxim/max32660/maxim_spi.c +++ b/drivers/platform/maxim/max32660/maxim_spi.c @@ -523,9 +523,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -540,7 +540,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -682,7 +682,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/maxim/max32665/maxim_spi.c b/drivers/platform/maxim/max32665/maxim_spi.c index b80f47934df..e8acb918847 100644 --- a/drivers/platform/maxim/max32665/maxim_spi.c +++ b/drivers/platform/maxim/max32665/maxim_spi.c @@ -619,9 +619,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -636,7 +636,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -778,7 +778,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/maxim/max32690/maxim_spi.c b/drivers/platform/maxim/max32690/maxim_spi.c index bc945064901..36711d213f6 100644 --- a/drivers/platform/maxim/max32690/maxim_spi.c +++ b/drivers/platform/maxim/max32690/maxim_spi.c @@ -652,9 +652,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -669,7 +669,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -811,7 +811,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/maxim/max78000/maxim_spi.c b/drivers/platform/maxim/max78000/maxim_spi.c index 055e29aa280..fbcb6c923bf 100644 --- a/drivers/platform/maxim/max78000/maxim_spi.c +++ b/drivers/platform/maxim/max78000/maxim_spi.c @@ -529,9 +529,9 @@ static int32_t max_config_dma_and_start(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t max_spi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { return max_config_dma_and_start(desc, msgs, len, NULL, NULL, false); } @@ -546,7 +546,7 @@ static int32_t max_spi_dma_transfer_sync(struct no_os_spi_desc *desc, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -static int32_t max_spi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t max_spi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -688,7 +688,7 @@ const struct no_os_spi_platform_ops max_spi_ops = { .init = &max_spi_init, .write_and_read = &max_spi_write_and_read, .transfer = &max_spi_transfer, - .dma_transfer_sync = &max_spi_dma_transfer_sync, - .dma_transfer_async = &max_spi_dma_transfer_async, + .transfer_dma = &max_spi_transfer_dma, + .transfer_dma_async = &max_spi_transfer_dma_async, .remove = &max_spi_remove }; diff --git a/drivers/platform/stm32/stm32_spi.c b/drivers/platform/stm32/stm32_spi.c index ac13b0ab47d..db233644b2a 100644 --- a/drivers/platform/stm32/stm32_spi.c +++ b/drivers/platform/stm32/stm32_spi.c @@ -641,7 +641,7 @@ void stm32_spi_dma_callback(struct no_os_dma_xfer_desc *old_xfer, * @param ctx - User defined parameter for the callback function. * @return 0 in case of success, errno codes otherwise. */ -int32_t stm32_spi_dma_transfer_async(struct no_os_spi_desc* desc, +int32_t stm32_spi_transfer_dma_async(struct no_os_spi_desc* desc, struct no_os_spi_msg* msgs, uint32_t len, void (*callback)(void*), @@ -663,9 +663,9 @@ int32_t stm32_spi_dma_transfer_async(struct no_os_spi_desc* desc, * @param len - Number of messages. * @return 0 in case of success, errno codes otherwise. */ -int32_t stm32_spi_dma_transfer_sync(struct no_os_spi_desc* desc, - struct no_os_spi_msg* msgs, - uint32_t len) +int32_t stm32_spi_transfer_dma(struct no_os_spi_desc* desc, + struct no_os_spi_msg* msgs, + uint32_t len) { uint32_t timeout; struct stm32_spi_desc* sdesc = desc->extra; @@ -746,7 +746,7 @@ const struct no_os_spi_platform_ops stm32_spi_ops = { .write_and_read = &stm32_spi_write_and_read, .remove = &stm32_spi_remove, .transfer = &stm32_spi_transfer, - .dma_transfer_async = &stm32_spi_dma_transfer_async, - .dma_transfer_sync = &stm32_spi_dma_transfer_sync, + .transfer_dma_async = &stm32_spi_transfer_dma_async, + .transfer_dma = &stm32_spi_transfer_dma, .transfer_abort = &stm32_spi_transfer_abort }; diff --git a/drivers/platform/stm32/stm32_xspi.c b/drivers/platform/stm32/stm32_xspi.c index 9eeed8bf542..d56ba68623e 100644 --- a/drivers/platform/stm32/stm32_xspi.c +++ b/drivers/platform/stm32/stm32_xspi.c @@ -648,7 +648,7 @@ static int32_t stm32_xspi_config_dma_and_start(struct no_os_spi_desc* desc, * @param ctx - User specific data which should be passed to the callback function. * @return 0 in case of success, negative code otherwise. */ -static int32_t stm32_xspi_dma_transfer_async(struct no_os_spi_desc *desc, +static int32_t stm32_xspi_transfer_dma_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void (*callback)(void *), @@ -674,9 +674,9 @@ static int32_t stm32_xspi_dma_transfer_async(struct no_os_spi_desc *desc, * @param len - Number of messages. * @return 0 in case of success, negative code otherwise. */ -static int32_t stm32_xspi_dma_transfer_sync(struct no_os_spi_desc *desc, - struct no_os_spi_msg *msgs, - uint32_t len) +static int32_t stm32_xspi_transfer_dma(struct no_os_spi_desc *desc, + struct no_os_spi_msg *msgs, + uint32_t len) { int32_t ret; uint32_t timeout; @@ -716,6 +716,6 @@ const struct no_os_spi_platform_ops stm32_xspi_ops = { .remove = &stm32_xspi_remove, .transfer = &stm32_xspi_transfer, .write_and_read = &stm32_xspi_write_and_read, - .dma_transfer_sync = stm32_xspi_dma_transfer_sync, - .dma_transfer_async = stm32_xspi_dma_transfer_async, + .transfer_dma = stm32_xspi_transfer_dma, + .transfer_dma_async = stm32_xspi_transfer_dma_async, }; diff --git a/include/no_os_spi.h b/include/no_os_spi.h index 64d9aa0f1f8..9aa77cc75d1 100644 --- a/include/no_os_spi.h +++ b/include/no_os_spi.h @@ -217,13 +217,13 @@ struct no_os_spi_platform_ops { /** Iterate over the spi_msg array and send all messages using DMA. * Blocks until the transfer is completed. */ - int32_t (*dma_transfer_sync)(struct no_os_spi_desc *, struct no_os_spi_msg *, - uint32_t); + int32_t (*transfer_dma)(struct no_os_spi_desc *, struct no_os_spi_msg *, + uint32_t); /** Iterate over the spi_msg array and send all messages using DMA. * Returns immediately after the transfer is started and invokes a * callback once all the messages have been transfered. */ - int32_t (*dma_transfer_async)(struct no_os_spi_desc *, struct no_os_spi_msg *, + int32_t (*transfer_dma_async)(struct no_os_spi_desc *, struct no_os_spi_msg *, uint32_t, void (*)(void *), void *); /** SPI remove function pointer */ int32_t (*remove)(struct no_os_spi_desc *);