]> asedeno.scripts.mit.edu Git - linux.git/commit
spi: pxa2xx: Only claim CS GPIOs when the slave device is created
authorJan Kiszka <jan.kiszka@siemens.com>
Sat, 8 Jul 2017 08:41:18 +0000 (10:41 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2017 11:09:52 +0000 (12:09 +0100)
commit676a4e3bab445d53fca4756865e2c0e2a87c38d6
treed0852607196169bbd483ec63564fd8e73cea496a
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877
spi: pxa2xx: Only claim CS GPIOs when the slave device is created

Avoid hogging chip select GPIOs just because they are listed for the
master. They might be mulitplexed and, if no slave device is attached,
used for different purposes. Moreover, this strategy avoids having to
allocate a cs_gpiods structure.

Tested on the IOT2000 where the second SPI bus is connected to an
Arduino-compatible connector and multiplexed between SPI, GPIO and PWM
usage.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c