• Linus Walleij's avatar
    gpio: of: Handle SPI chipselect legacy bindings · 6953c57a
    Linus Walleij authored
    The SPI chipselects are assumed to be active low in the current
    binding, so when we want to use GPIO descriptors and handle
    the active low/high semantics in gpiolib, we need a special
    parsing quirk to deal with this.
    
    We check for the property "spi-cs-high" and if that is
    NOT present we assume the CS line is active low.
    
    If the line is tagged as active low in the device tree and
    has no "spi-cs-high" property all is fine, the device
    tree and the SPI bindings are in agreement.
    
    If the line is tagged as active high in the device tree with
    the second cell flag and has no "spi-cs-high" property we
    enforce active low semantics (as this is the exception we can
    just tag on the flag).
    
    If the line is tagged as active low with the second cell flag
    AND tagged with "spi-cs-high" the SPI active high property
    takes precedence and we print a warning.
    
    Cc: Mark Brown <broonie@kernel.org>
    Cc: linux-spi@vger.kernel.org
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    6953c57a
gpiolib-of.c 17.7 KB