Skip to content

Commit

Permalink
drivers: spi: Rename SPI transfers as per semantics
Browse files Browse the repository at this point in the history
Signed-off-by: Naga Himanshu Indraganti <[email protected]>
  • Loading branch information
NagaHimanshu authored and buha committed Feb 26, 2025
1 parent a6f6c0f commit 9e25d2c
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 55 deletions.
8 changes: 4 additions & 4 deletions drivers/api/no_os_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max32650/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max32655/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max32660/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max32665/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max32690/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/maxim/max78000/maxim_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 *),
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/stm32/stm32_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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*),
Expand All @@ -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;
Expand Down Expand Up @@ -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
};
12 changes: 6 additions & 6 deletions drivers/platform/stm32/stm32_xspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *),
Expand All @@ -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;
Expand Down Expand Up @@ -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,
};
6 changes: 3 additions & 3 deletions include/no_os_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down

0 comments on commit 9e25d2c

Please sign in to comment.