spi: ath79: Convert to use CS GPIO descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 7 Jan 2019 15:51:51 +0000 (16:51 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 9 Jan 2019 12:41:24 +0000 (12:41 +0000)
commit8db79547e79f6606b6d2d3b2bf6f36ec311195be
treeee819eaf6735def31c81c8d78e74cd5fd9fcfe5d
parentf3186dd876697e696d07136623d5cf0a6fb0bc0f
spi: ath79: Convert to use CS GPIO descriptors

This converts the ATH79 SPI master driver to use GPIO descriptors
for chip select handling.

The ATH79 driver was requesting the GPIO and driving it from the
bitbang .chipselect callback. Do not request it anymore as the SPI
core will request it, remove the line inversion semantics for the
GPIO case (handled by gpiolib) and let the SPI core deal with
requesting the GPIO line from the device tree node of the controller.

This driver can be instantiated from a board file (no device tree)
but the board files only use native CS (no GPIO lines) so we should
be fine just letting the SPI core grab the GPIO from the device.

The fact that the driver is actively driving the GPIO in the
ath79_spi_chipselect() callback is confusing since the host does
not set SPI_MASTER_GPIO_SS so this should not ever get called when
using GPIO CS. I put in a comment about this.

Cc: Felix Fietkau <nbd@nbd.name>
Cc: Alban Bedel <albeu@free.fr>
Cc: Linuxarm <linuxarm@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ath79.c