[PATCH 2/4] spi: stm32: support per-transfer bits per word switching

Philipp Zabel p.zabel at pengutronix.de
Thu Mar 30 07:53:09 PDT 2023


On Thu, Mar 30, 2023 at 12:33:57PM +0200, Philipp Zabel wrote:
> Allow dynamically switching data size between transfers.
> 
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> ---
>  drivers/spi/stm32_spi.c | 50 ++++++++++++++++++++++++++++++++---------
>  1 file changed, 39 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c
> index 0d7407c279a2..1ac86fbe11e6 100644
> --- a/drivers/spi/stm32_spi.c
> +++ b/drivers/spi/stm32_spi.c
[...]
> @@ -543,6 +570,7 @@ static int stm32_spi_probe(struct device *dev)
>  	master->transfer = stm32_spi_transfer;
>  	master->mem_ops = &stm32_spi_mem_ops;
>  
> +	master->bits_per_word_mask = stm32_spi_get_bpw_mask(priv);

This has to be moved down a few lines, after the clock is enabled and
the device is reset. I'll fix this in v2.

regards
Philipp



More information about the barebox mailing list