lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
    On Fri, Nov 6, 2020 at 5:08 PM Sven Van Asbroeck <thesven73@gmail.com> wrote:
    >
    > From: Sven Van Asbroeck <thesven73@gmail.com>
    >
    > Commit f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
    > introduced the optional use of GPIO descriptors for chip selects.
    >
    > A side-effect of this change: when a SPI bus uses GPIO descriptors,
    > all its client devices have SPI_CS_HIGH set in spi->mode. This flag is
    > required for the SPI bus to operate correctly.
    >
    > This unfortunately breaks many client drivers, which use the following
    > pattern to configure their underlying SPI bus:
    >
    > static int client_device_probe(struct spi_device *spi)
    > {
    > ...
    > spi->mode = SPI_MODE_0;
    > spi->bits_per_word = 8;
    > err = spi_setup(spi);
    > ..
    > }
    >
    > In short, many client drivers overwrite the SPI_CS_HIGH bit in
    > spi->mode, and break the underlying SPI bus driver.

    Sounds like "many SPI drivers have to be fixed".



    --
    With Best Regards,
    Andy Shevchenko

    \
     
     \ /
      Last update: 2020-11-09 15:25    [W:4.116 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site