mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
backlight: tdo24m: Fix the SPI CS between transfers
[ Upstream commit2023b0524a] Currently the LCD display (TD035S) on the cm-x300 platform is broken and remains blank. The TD0245S specification requires that the chipselect is toggled between commands sent to the panel. This was also the purpose of the former patch of commitf64dcac0b1("backlight: tdo24m: ensure chip select changes between transfers"). Unfortunately, the "cs_change" field of a SPI transfer is misleading. Its true meaning is that for a SPI message holding multiple transfers, the chip select is toggled between each transfer, but for the last transfer it remains asserted. In this driver, all the SPI messages contain exactly one transfer, which means that each transfer is the last of its message, and as a consequence the chip select is never toggled. Actually, there was a second bug hidding the first one, hence the problem was not seen until v4.6. This problem was fixed by commita52db659c7("spi: pxa2xx: Fix cs_change management") for PXA based boards. This fix makes the TD035S work again on a cm-x300 board. The same applies to other PXA boards, ie. corgi and tosa. Fixes:a52db659c7("spi: pxa2xx: Fix cs_change management") Reported-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3bab65f29e
commit
8612220ec4
@@ -177,7 +177,7 @@ static int corgi_ssp_lcdtg_send(struct corgi_lcd *lcd, int adrs, uint8_t data)
|
||||
struct spi_message msg;
|
||||
struct spi_transfer xfer = {
|
||||
.len = 1,
|
||||
.cs_change = 1,
|
||||
.cs_change = 0,
|
||||
.tx_buf = lcd->buf,
|
||||
};
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ static int tdo24m_probe(struct spi_device *spi)
|
||||
|
||||
spi_message_init(m);
|
||||
|
||||
x->cs_change = 1;
|
||||
x->cs_change = 0;
|
||||
x->tx_buf = &lcd->buf[0];
|
||||
spi_message_add_tail(x, m);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ static int tosa_tg_send(struct spi_device *spi, int adrs, uint8_t data)
|
||||
struct spi_message msg;
|
||||
struct spi_transfer xfer = {
|
||||
.len = 1,
|
||||
.cs_change = 1,
|
||||
.cs_change = 0,
|
||||
.tx_buf = buf,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user