summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-03 10:52:08 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-08-03 10:52:08 +0100
commitb71fdd65cad331c0d10fe1b529bbb830a4dd8eb0 (patch)
tree6ac1d6169528a7623048c1849fb5f5d370d36bf2 /drivers/spi/spi.c
parent6140a92cd086e53e9a6cd7fcea644fd3f9b8fe25 (diff)
parent96472f18a4affdaff5013a836c48375f1eddb4a4 (diff)
Merge tag 'spi-mosi-config' into togreg
spi: Support MOSI idle configuration Add support for configuring the idle state of the MOSI signal in controllers.
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 6ebe5dd9bbb1..60a2b5a0c85d 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3921,6 +3921,12 @@ int spi_setup(struct spi_device *spi)
(SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL |
SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL)))
return -EINVAL;
+ /* Check against conflicting MOSI idle configuration */
+ if ((spi->mode & SPI_MOSI_IDLE_LOW) && (spi->mode & SPI_MOSI_IDLE_HIGH)) {
+ dev_err(&spi->dev,
+ "setup: MOSI configured to idle low and high at the same time.\n");
+ return -EINVAL;
+ }
/*
* Help drivers fail *cleanly* when they need options
* that aren't supported with their current controller.