Skip to contentSkip to conversation

iio:gyro:bmg160 Gyro Sensor driver

PATCH Superseded Srinivas Pandruvada 1 participant 3 messages Jul 29, 2014 IIO

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover iio:gyro:bmg160 Gyro Sensor driver

v2:
- Add device id in any-motion trigger
- Removed string comparison for trigger name to identify trigger source
- Prevent disabling any motion interrupts when both any motion trigger and events are on, but any one of them is disabled via sysfs
- Switch on chan->type
- Created new function to raw read axis
- Explanation why need to power on for changing sampling freq and scale

v1:
- Runtime PM: Removed module parameter for delay configuration Use RTPM autosuspend delay feature. This allows sysfs configuration of autosuspend time.

- Trigger
As suggested, there are two triggers:
- data_ready : Trigger which will allow all gyro periodic sampled data to be received by user space
- any-motion: When used, will configure the chipset so that data is pushed only when there is any motion, allowing system to enter deeper idle power states

- Events
ROC type events will send direction instead of either. Also both events and data triggers can be enabled together.

- Addition of unbuffered TEMP read interface

- Misc error message corrections as suggested by Peter Meerwald

TBD: Add sysfs attribute to trigger to configure thresholds. Currently the triggers don't have feature to add sysfs attributes unlike IIO device. But this has to be a RFC patch on top.

v0:
Base version for review

Srinivas Pandruvada (2):
iio:gyro:bmg160 Gyro Sensor driver
iio:gyro:bmg160 documentation

 .../ABI/testing/sysfs-bus-iio-gyro-bmg160          |    9 +
 drivers/iio/gyro/Kconfig                           |   11 +
 drivers/iio/gyro/Makefile                          |    1 +
 drivers/iio/gyro/bmg160.c                          | 1174 ++++++++++++++++++++
 4 files changed, 1195 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-gyro-bmg160
 create mode 100644 drivers/iio/gyro/bmg160.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/2 iio:gyro:bmg160 Gyro Sensor driver

This change implements support for BMG160 Gyro sensor. Although chip has several advanced features, this change implements minimum set required for using gyro sensor.

---
 drivers/iio/gyro/Kconfig  |   11 +
 drivers/iio/gyro/Makefile |    1 +
 drivers/iio/gyro/bmg160.c | 1174 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1186 insertions(+)
 create mode 100644 drivers/iio/gyro/bmg160.c
drivers/iio/gyro/Kconfig +11 -0
index ac2d69e..d630ae9 100644
@@ -50,6 +50,17 @@ config ADXRS450
 	  This driver can also be built as a module.  If so, the module
 	  will be called adxrs450.
 
+config BMG160
+	tristate "BOSCH BMG160 Gyro Sensor"
+	depends on I2C
+	select IIO_TRIGGERED_BUFFER if IIO_BUFFER
+	help
+	  Say yes here to build support for Bosch BMG160 Tri-axis Gyro Sensor
+	  driver.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called bmg160.
+
 config HID_SENSOR_GYRO_3D
 	depends on HID_SENSOR_HUB
 	select IIO_BUFFER
drivers/iio/gyro/Makefile +1 -0
index 2f2752a..36a3877 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_ADIS16130) += adis16130.o
 obj-$(CONFIG_ADIS16136) += adis16136.o
 obj-$(CONFIG_ADIS16260) += adis16260.o
 obj-$(CONFIG_ADXRS450) += adxrs450.o
+obj-$(CONFIG_BMG160) += bmg160.o
 
 obj-$(CONFIG_HID_SENSOR_GYRO_3D) += hid-sensor-gyro-3d.o
 
drivers/iio/gyro/bmg160.c new file +1174 -0

1,174 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/2 iio:gyro:bmg160 documentation

In reply to Srinivas Pandruvada

Added any-motion trigger documentation.

---
 Documentation/ABI/testing/sysfs-bus-iio-gyro-bmg160 | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-gyro-bmg160
Documentation/ABI/testing/sysfs-bus-iio-gyro-bmg160 new file +7 -0
new file mode 100644
index 0000000..1f316a5
@@ -0,0 +1,7 @@
+What:		/sys/bus/iio/devices/triggerX/name = "bmg160-any-motion-devX"
+KernelVersion:	3.17
+Contact:	[email protected]
+Description:
+		The BMG160 gyro kernel module provides an additional trigger,
+		which sets driver in a mode, where data is pushed to the buffer
+		only when there is any motion.
Signature · 1 line
1.9.1