spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Wed, 28 Oct 2015 13:13:41 +0000 (15:13 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 30 Oct 2015 02:18:05 +0000 (11:18 +0900)
commit8b136baa5892f25bba0373d6eb0f5f84efc93986
treedb604a7b69c70e6d6be3029c4611e698cefe62d4
parentd0283eb2dbc11ec08375fdf6a436e96d25b3a593
spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals

SPI capabilities register located in private registers space of newer
Intel LPSS SPI host controllers tell in register bits 12:9 which chip
select signals are enabled.

Use that information for detecting the number of chip selects. For
simplicity we assume chip selects are enabled one after another without
disabled chip selects between. For instance CS0 | CS1 | CS2 but not
CS0 | CS1 | CS3.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c