linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fpga: ice40-spi: Use new structure for SPI transfer delays
@ 2020-02-27 12:09 Sergiu Cuciurean
  2020-03-01 16:22 ` Moritz Fischer
  0 siblings, 1 reply; 2+ messages in thread
From: Sergiu Cuciurean @ 2020-02-27 12:09 UTC (permalink / raw)
  To: linux-kernel, linux-fpga; +Cc: mdf, 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/fpga/ice40-spi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/ice40-spi.c b/drivers/fpga/ice40-spi.c
index 56e112e14a10..8d689fea0dab 100644
--- a/drivers/fpga/ice40-spi.c
+++ b/drivers/fpga/ice40-spi.c
@@ -46,10 +46,16 @@ static int ice40_fpga_ops_write_init(struct fpga_manager *mgr,
 	struct spi_message message;
 	struct spi_transfer assert_cs_then_reset_delay = {
 		.cs_change   = 1,
-		.delay_usecs = ICE40_SPI_RESET_DELAY
+		.delay = {
+			.value = ICE40_SPI_RESET_DELAY,
+			.unit = SPI_DELAY_UNIT_USECS
+		}
 	};
 	struct spi_transfer housekeeping_delay_then_release_cs = {
-		.delay_usecs = ICE40_SPI_HOUSEKEEPING_DELAY
+		.delay = {
+			.value = ICE40_SPI_HOUSEKEEPING_DELAY,
+			.unit = SPI_DELAY_UNIT_USECS
+		}
 	};
 	int ret;
 
-- 
2.17.1

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

* Re: [PATCH] fpga: ice40-spi: Use new structure for SPI transfer delays
  2020-02-27 12:09 [PATCH] fpga: ice40-spi: Use new structure for SPI transfer delays Sergiu Cuciurean
@ 2020-03-01 16:22 ` Moritz Fischer
  0 siblings, 0 replies; 2+ messages in thread
From: Moritz Fischer @ 2020-03-01 16:22 UTC (permalink / raw)
  To: Sergiu Cuciurean; +Cc: linux-kernel, linux-fpga, mdf

On Thu, Feb 27, 2020 at 02:09:32PM +0200, 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/fpga/ice40-spi.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/fpga/ice40-spi.c b/drivers/fpga/ice40-spi.c
> index 56e112e14a10..8d689fea0dab 100644
> --- a/drivers/fpga/ice40-spi.c
> +++ b/drivers/fpga/ice40-spi.c
> @@ -46,10 +46,16 @@ static int ice40_fpga_ops_write_init(struct fpga_manager *mgr,
>  	struct spi_message message;
>  	struct spi_transfer assert_cs_then_reset_delay = {
>  		.cs_change   = 1,
> -		.delay_usecs = ICE40_SPI_RESET_DELAY
> +		.delay = {
> +			.value = ICE40_SPI_RESET_DELAY,
> +			.unit = SPI_DELAY_UNIT_USECS
> +		}
>  	};
>  	struct spi_transfer housekeeping_delay_then_release_cs = {
> -		.delay_usecs = ICE40_SPI_HOUSEKEEPING_DELAY
> +		.delay = {
> +			.value = ICE40_SPI_HOUSEKEEPING_DELAY,
> +			.unit = SPI_DELAY_UNIT_USECS
> +		}
>  	};
>  	int ret;
>  
> -- 
> 2.17.1
> 
Applied to for-next,

Thanks

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

end of thread, other threads:[~2020-03-01 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-27 12:09 [PATCH] fpga: ice40-spi: Use new structure for SPI transfer delays Sergiu Cuciurean
2020-03-01 16:22 ` Moritz Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).