Skip to content
  • Robert Jarzmik's avatar
    backlight: tdo24m: Fix the SPI CS between transfers · 2023b052
    Robert Jarzmik authored
    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 commit f64dcac0 ("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 commit
    a52db659 ("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: a52db659
    
     ("spi: pxa2xx: Fix cs_change management")
    Reported-by: default avatarAndrea Adami <andrea.adami@gmail.com>
    Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
    Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    2023b052