diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-08-03 10:52:08 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-08-03 10:52:08 +0100 |
commit | b71fdd65cad331c0d10fe1b529bbb830a4dd8eb0 (patch) | |
tree | 6ac1d6169528a7623048c1849fb5f5d370d36bf2 /drivers/spi/spi.c | |
parent | 6140a92cd086e53e9a6cd7fcea644fd3f9b8fe25 (diff) | |
parent | 96472f18a4affdaff5013a836c48375f1eddb4a4 (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.c | 6 |
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. |