summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/Kconfig
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-06-30 04:48:51 +0300
committerJonathan Cameron <jic23@kernel.org>2016-07-03 13:27:15 +0300
commitb26b4e91700ff45d033eeaac91597d6d479378a4 (patch)
tree3d71bd25de6154b155409b5b7637293e564769b2 /drivers/iio/pressure/Kconfig
parent17118843a563c681aaafb29621befba02f28c592 (diff)
downloadlinux-b26b4e91700ff45d033eeaac91597d6d479378a4.tar.xz
iio: pressure: bmp280: add SPI interface driver
This patch mimics the SPI functionality found in the misc driver in drivers/misc/bh085-spi.c to make it possible to reuse the existing BMP280/BMP180/BMP085 driver with all clients of the other driver. The adoption is straight-forward since like the other driver, it is a simple matter of using regmap. This driver is also so obviously inspired/copied from the old misc driver in drivers/misc/bmp085.c that I just took the liberty to add in the authors of the other drivers + self in the core driver file. The MISC driver also supports a variant named "BMP181" so include that here to be complete in comparison to the old driver. The bus mapping code for SPI was written by Akinobu Mita. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/pressure/Kconfig')
-rw-r--r--drivers/iio/pressure/Kconfig15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
index 3d0d311acb1d..d130cdc78f43 100644
--- a/drivers/iio/pressure/Kconfig
+++ b/drivers/iio/pressure/Kconfig
@@ -7,17 +7,20 @@ menu "Pressure sensors"
config BMP280
tristate "Bosch Sensortec BMP180/BMP280 pressure sensor I2C driver"
- depends on I2C
+ depends on (I2C || SPI_MASTER)
depends on !(BMP085_I2C=y || BMP085_I2C=m)
+ depends on !(BMP085_SPI=y || BMP085_SPI=m)
select REGMAP
select BMP280_I2C if (I2C)
+ select BMP280_SPI if (SPI_MASTER)
help
Say yes here to build support for Bosch Sensortec BMP180 and BMP280
pressure and temperature sensors. Also supports the BE280 with
an additional humidity sensor channel.
- To compile this driver as a module, choose M here: the modules
- will be called bmp280-i2c and bmp280.
+ To compile this driver as a module, choose M here: the core module
+ will be called bmp280 and you will also get bmp280-i2c for I2C
+ and/or bmp280-spi for SPI support.
config BMP280_I2C
tristate
@@ -25,6 +28,12 @@ config BMP280_I2C
depends on I2C
select REGMAP_I2C
+config BMP280_SPI
+ tristate
+ depends on BMP280
+ depends on SPI_MASTER
+ select REGMAP
+
config HID_SENSOR_PRESS
depends on HID_SENSOR_HUB
select IIO_BUFFER