diff mbox series

[l4m-2022.04,u-boot-at91] spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller

Message ID 20220408083704.733723-1-tudor.ambarus@microchip.com
State Superseded
Delegated to: Eugen Hristev
Headers show
Series [l4m-2022.04,u-boot-at91] spi: atmel-quadspi.c: Fix the buswidth adjustment between spi-mem and controller | expand

Commit Message

Tudor Ambarus April 8, 2022, 8:37 a.m. UTC
Use the spi_mem_default_supports_op() core helper in order to take into
account the buswidth specified by the user in device tree.

Fixes: 24c8ff4684 ("spi: Add Atmel QuadSPI driver")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/spi/atmel-quadspi.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Tudor Ambarus April 8, 2022, 8:38 a.m. UTC | #1
oops, wrong subject, let me resend.

On 4/8/22 11:37, Tudor Ambarus wrote:
> Use the spi_mem_default_supports_op() core helper in order to take into
> account the buswidth specified by the user in device tree.
> 
> Fixes: 24c8ff4684 ("spi: Add Atmel QuadSPI driver")
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> ---
>  drivers/spi/atmel-quadspi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
> index 098298336d..cb64119f97 100644
> --- a/drivers/spi/atmel-quadspi.c
> +++ b/drivers/spi/atmel-quadspi.c
> @@ -438,6 +438,9 @@ static bool atmel_qspi_supports_op(struct spi_slave *slave,
>  {
>  	struct atmel_qspi *aq = dev_get_priv(slave->dev->parent);
>  
> +	if (!spi_mem_default_supports_op(slave, op))
> +		return false;
> +
>  	if (aq->caps->octal) {
>  		if (atmel_qspi_sama7g5_find_mode(op) < 0)
>  			return false;
diff mbox series

Patch

diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
index 098298336d..cb64119f97 100644
--- a/drivers/spi/atmel-quadspi.c
+++ b/drivers/spi/atmel-quadspi.c
@@ -438,6 +438,9 @@  static bool atmel_qspi_supports_op(struct spi_slave *slave,
 {
 	struct atmel_qspi *aq = dev_get_priv(slave->dev->parent);
 
+	if (!spi_mem_default_supports_op(slave, op))
+		return false;
+
 	if (aq->caps->octal) {
 		if (atmel_qspi_sama7g5_find_mode(op) < 0)
 			return false;