lkml.org 
[lkml]   [2020]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [BUG] SPI broken for SPI based panel drivers
Hi Nikolaus, thank you for reaching out !

On Mon, Nov 30, 2020 at 2:06 PM H. Nikolaus Schaller <hns@goldelico.com> wrote:
>
> But reverting your patch brings back the display. So it appears as if it does not
> fix a breakage, rather breaks a previously working setup.

The patch in question fixes an important breakage: before the patch, literally
hundreds of SPI drivers no longer worked - only if the SPI bus master
driver was using gpio descriptors.

We knew that there was a chance that our fix would break something else.
But hopefully "it fixes more than it breaks"

>
> What should we do?
>

Can you try the following patch ?

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 7ceb0ba27b75..c173d7de73b3 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -208,8 +208,8 @@ static void spi_gpio_chipselect(struct spi_device
*spi, int is_active)
if (spi_gpio->cs_gpios) {
struct gpio_desc *cs = spi_gpio->cs_gpios[spi->chip_select];

- /* SPI chip selects are normally active-low */
- gpiod_set_value_cansleep(cs, (spi->mode & SPI_CS_HIGH)
? is_active : !is_active);
+ /* SPI chip select polarity handled by gpiolib*/
+ gpiod_set_value_cansleep(cs, is_active);
}
}
\
 
 \ /
  Last update: 2020-11-30 21:14    [W:0.246 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site