spi: txx9: Convert to use GPIO descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 30 Oct 2019 07:38:32 +0000 (08:38 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 30 Oct 2019 14:14:32 +0000 (14:14 +0000)
commitc8b348dd86091daa3496a6dc8c0777b78c9683a6
treee7f3143813da2faa1cc7887238c3dc71c92c07f3
parent76f0030f367c61d4d1f4b1393ff3d9dc43d20c6a
spi: txx9: Convert to use GPIO descriptors

This converts the TXX9 SPI driver to use GPIO descriptors
to control the GPIO chip selects.

As the driver was clearly (ab)using the device tree "reg"
property to offset into the global GPIO chip we have to
add a hack to counter the hack: add a 1-to-1 chip select
to GPIO offset mapping for all 16 lines on the TXX9 GPIO
chip. The details are described in a largeish comment
in the patch.

We do not need to set up the GPIO as output any more since
the core will take care of this, as well as it will handle
the polarity inversion semantics.

Cc: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191030073832.24038-1-linus.walleij@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-txx9.c