Linux-WPAN Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] net: ieee802154: ca8210: Use new structure for SPI transfer delays
@ 2020-02-27 13:12 Sergiu Cuciurean
  2020-02-28  8:41 ` Stefan Schmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Sergiu Cuciurean @ 2020-02-27 13:12 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-wpan, davem, stefan, alex.aring, h.morris
  Cc: Sergiu Cuciurean

In a recent change to the SPI subsystem [1], a new `delay` struct was added
to replace the `delay_usecs`. This change replaces the current
`delay_usecs` with `delay` for this driver.

The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
that both `delay_usecs` & `delay` are used (in this order to preserve
backwards compatibility).

[1] commit bebcfd272df6 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()")

Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
---
 drivers/net/ieee802154/ca8210.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 430c93786153..e04c3b60cae7 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -946,7 +946,8 @@ static int ca8210_spi_transfer(
 	cas_ctl->transfer.bits_per_word = 0; /* Use device setting */
 	cas_ctl->transfer.tx_buf = cas_ctl->tx_buf;
 	cas_ctl->transfer.rx_buf = cas_ctl->tx_in_buf;
-	cas_ctl->transfer.delay_usecs = 0;
+	cas_ctl->transfer.delay.value = 0;
+	cas_ctl->transfer.delay.unit = SPI_DELAY_UNIT_USECS;
 	cas_ctl->transfer.cs_change = 0;
 	cas_ctl->transfer.len = sizeof(struct mac_message);
 	cas_ctl->msg.complete = ca8210_spi_transfer_complete;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: ieee802154: ca8210: Use new structure for SPI transfer delays
  2020-02-27 13:12 [PATCH] net: ieee802154: ca8210: Use new structure for SPI transfer delays Sergiu Cuciurean
@ 2020-02-28  8:41 ` Stefan Schmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Schmidt @ 2020-02-28  8:41 UTC (permalink / raw)
  To: Sergiu Cuciurean, linux-kernel, netdev, linux-wpan, davem,
	alex.aring, h.morris

Hello.

On 27.02.20 14:12, Sergiu Cuciurean wrote:
> In a recent change to the SPI subsystem [1], a new `delay` struct was added
> to replace the `delay_usecs`. This change replaces the current
> `delay_usecs` with `delay` for this driver.
> 
> The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
> that both `delay_usecs` & `delay` are used (in this order to preserve
> backwards compatibility).
> 
> [1] commit bebcfd272df6 ("spi: introduce `delay` field for
> `spi_transfer` + spi_transfer_delay_exec()")
> 
> Signed-off-by: Sergiu Cuciurean <sergiu.cuciurean@analog.com>
> ---
>   drivers/net/ieee802154/ca8210.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 430c93786153..e04c3b60cae7 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -946,7 +946,8 @@ static int ca8210_spi_transfer(
>   	cas_ctl->transfer.bits_per_word = 0; /* Use device setting */
>   	cas_ctl->transfer.tx_buf = cas_ctl->tx_buf;
>   	cas_ctl->transfer.rx_buf = cas_ctl->tx_in_buf;
> -	cas_ctl->transfer.delay_usecs = 0;
> +	cas_ctl->transfer.delay.value = 0;
> +	cas_ctl->transfer.delay.unit = SPI_DELAY_UNIT_USECS;
>   	cas_ctl->transfer.cs_change = 0;
>   	cas_ctl->transfer.len = sizeof(struct mac_message);
>   	cas_ctl->msg.complete = ca8210_spi_transfer_complete;
> 


This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 13:12 [PATCH] net: ieee802154: ca8210: Use new structure for SPI transfer delays Sergiu Cuciurean
2020-02-28  8:41 ` Stefan Schmidt

Linux-WPAN Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wpan/0 linux-wpan/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wpan linux-wpan/ https://lore.kernel.org/linux-wpan \
		linux-wpan@vger.kernel.org
	public-inbox-index linux-wpan

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wpan


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git