• Linus Walleij's avatar
    spi: orion: Convert to use GPIO descriptors · 66eb2289
    Linus Walleij authored
    This converts the Orion SPI master to use GPIO descriptors.
    The SPI core will obtain and manage the CS GPIOs, if any
    are defined.
    
    I make one sematic change: when a certain chip select is using
    a GPIO line instead of the native CS I simply just enable the
    1:1 mapped native CS that would have been used if the GPIO
    was not there. As we set the SPI_MASTER_GPIO_SS the .set_cs()
    callback will be called for all chip selects whether native
    or not, and the important thing for the driver is that the
    previous native chip select (if any) is deasserted, which
    other chip select is asserted instead does not really matter.
    
    The previous code went to great lengths to ascertain that the
    first hw CS which was hiding behind a GPIO line was used for
    all cases when the line is not using native chip select but
    this should not matter at all, just use the one "underneath"
    the GPIO at all times.
    
    When a GPIO is used for CS, the SPI_CS_HIGH flag is enforced,
    so the native chip select is also inverted. But that should
    not matter since we are not using it anyways.
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
    Cc: Tomas Paukrt <tomaspaukrt@email.cz>
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Link: https://lore.kernel.org/r/20200415175613.220767-1-linus.walleij@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    66eb2289
spi-orion.c 20.3 KB