diff options
| author | saturneric <[email protected]> | 2025-01-12 15:50:28 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-01-12 15:50:28 +0000 |
| commit | b7c94eb866dd341a28367bdfabd7c2d1b14d688e (patch) | |
| tree | b6df897425af99dbfef5ad4d91a969f1e58fdae6 /drivers/spi/spi.c | |
| parent | Merge tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
| download | kernel-b7c94eb866dd341a28367bdfabd7c2d1b14d688e.tar.gz kernel-b7c94eb866dd341a28367bdfabd7c2d1b14d688e.zip | |
fix: drivers patch make raspberry pi 5 work properly
Diffstat (limited to 'drivers/spi/spi.c')
| -rw-r--r-- | drivers/spi/spi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index ff1add2ecb91..fef99483bb4b 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3894,6 +3894,7 @@ static int spi_set_cs_timing(struct spi_device *spi) */ int spi_setup(struct spi_device *spi) { + struct spi_controller *ctlr = spi->controller; unsigned bad_bits, ugly_bits; int status; @@ -3920,6 +3921,14 @@ int spi_setup(struct spi_device *spi) "setup: MOSI configured to idle low and high at the same time.\n"); return -EINVAL; } + + if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods && + ctlr->cs_gpiods[spi->chip_select[0]] && !(spi->mode & SPI_CS_HIGH)) { + dev_dbg(&spi->dev, + "setup: forcing CS_HIGH (use_gpio_descriptors)\n"); + spi->mode |= SPI_CS_HIGH; + } + /* * Help drivers fail *cleanly* when they need options * that aren't supported with their current controller. |
