]> git.baikalelectronics.ru Git - kernel.git/commit
spi: sc18is602: Support multiple devices on a single I2C bus if DT is configured
authorGuenter Roeck <linux@roeck-us.net>
Fri, 6 Feb 2015 20:27:54 +0000 (12:27 -0800)
committerMark Brown <broonie@kernel.org>
Wed, 11 Feb 2015 05:42:29 +0000 (13:42 +0800)
commit331b52470684545943489d61ce0aab44b7ee0930
tree78e57380c0e68d535b05fc5d5548db986b6e608e
parente716639644c99cea0dd635682be67de26d48dbf6
spi: sc18is602: Support multiple devices on a single I2C bus if DT is configured

The driver currently only supports a single device per I2C bus since it uses
the I2C bus number to set the SPI bus number. This makes it impossible to
connect more than one chip to a single I2C bus.

We don't want to use dynamic bus numbers unconditionally since this would
result in every instantiation getting a different bus number starting with
65,535 counting down unless devicetree is configured. If devicetree is
configured, however, the SPI bus number is obtained from devicetree
data. So we can use dynamic SPI bus numbers in this case.

Reported-and-Tested-by: Marco Menchise <marco.menchise@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sc18is602.c