Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77c4ad2d authored by Daniel Baluta's avatar Daniel Baluta Committed by Jonathan Cameron
Browse files

iio: imu: Add initial support for Bosch BMI160

BMI160 is an Inertial Measurement Unit (IMU) which provides acceleration
and angular rate measurement. It also offers a secondary I2C interface
for connecting a magnetometer sensor (usually BMM160).

Current driver offers support for accelerometer and gyroscope readings
via sysfs or via buffer interface using an external trigger (e.g.
hrtimer). Data is retrieved from IMU via I2C or SPI interface.

Datasheet is at:
	http://www.mouser.com/ds/2/783/BST-BMI160-DS000-07-786474.pdf



Signed-off-by: default avatarDaniel Baluta <daniel.baluta@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent ab4b6496
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ config ADIS16480
	  Say yes here to build support for Analog Devices ADIS16375, ADIS16480,
	  ADIS16485, ADIS16488 inertial sensors.

source "drivers/iio/imu/bmi160/Kconfig"

config KMX61
	tristate "Kionix KMX61 6-axis accelerometer and magnetometer"
	depends on I2C
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ adis_lib-$(CONFIG_IIO_ADIS_LIB_BUFFER) += adis_trigger.o
adis_lib-$(CONFIG_IIO_ADIS_LIB_BUFFER) += adis_buffer.o
obj-$(CONFIG_IIO_ADIS_LIB) += adis_lib.o

obj-y += bmi160/
obj-y += inv_mpu6050/

obj-$(CONFIG_KMX61) += kmx61.o
+32 −0
Original line number Diff line number Diff line
#
# BMI160 IMU driver
#

config BMI160
	tristate
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER

config BMI160_I2C
	tristate "Bosch BMI160 I2C driver"
	depends on I2C
	select BMI160
	select REGMAP_I2C
	help
	  If you say yes here you get support for BMI160 IMU on I2C with
	  accelerometer, gyroscope and external BMG160 magnetometer.

	  This driver can also be built as a module. If so, the module will be
	  called bmi160_i2c.

config BMI160_SPI
	tristate "Bosch BMI160 SPI driver"
	depends on SPI
	select BMI160
	select REGMAP_SPI
	help
	  If you say yes here you get support for BMI160 IMU on SPI with
	  accelerometer, gyroscope and external BMG160 magnetometer.

	  This driver can also be built as a module. If so, the module will be
	  called bmi160_spi.
+6 −0
Original line number Diff line number Diff line
#
# Makefile for Bosch BMI160 IMU
#
obj-$(CONFIG_BMI160) += bmi160_core.o
obj-$(CONFIG_BMI160_I2C) += bmi160_i2c.o
obj-$(CONFIG_BMI160_SPI) += bmi160_spi.o
+10 −0
Original line number Diff line number Diff line
#ifndef BMI160_H_
#define BMI160_H_

extern const struct regmap_config bmi160_regmap_config;

int bmi160_core_probe(struct device *dev, struct regmap *regmap,
		      const char *name, bool use_spi);
void bmi160_core_remove(struct device *dev);

#endif  /* BMI160_H_ */
Loading