• G
    spi: sh-msiof: Implement cs-gpios configuration · b8761434
    Geert Uytterhoeven 提交于
    The current support for GPIO chip selects assumes the GPIOs have been
    configured by platform code or the boot loader.  This includes pinmux
    setup and GPIO direction.  Hence it does not work as expected when just
    described in DT using the "cs-gpios" property.
    
    Fix this by:
      1. using devm_gpiod_get_index() to request the GPIO, and thus
         configure pinmux, if needed,
      2. configuring the GPIO direction is the spi_master.setup() callback.
    
    Use gpio_is_valid() instead of a check on positive numbers.
    
    Note that when using GPIO chip selects, at least one native chip select
    must be left unused, as that native chip select will be driven anyway,
    and (global) native chip select polarity must be taken into account.
    Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: NMark Brown <broonie@kernel.org>
    b8761434
spi-sh-msiof.c 37.8 KB