bma023: Support for Bosch BMA023 and SMB380 accelerometers
Subsystems (2)
PATCH 1/1 bma023: Support for Bosch BMA023 and SMB380 accelerometers
Updated patch to add documentation for the interfaces provided. Note that this is an input driver, it's not a driver for the staging IIO work, nor is it intended to be.
--
From: Joseph Lai <[email protected]>
This patch supports driver for BOSCH BMA023 and SMB380 which are accelerometers.
We also expose some data from this device to uusers through sysfs interface in a similar manner as the lis drivers so that the data can be used for one off uses, and also as as an input device for joystick type uses.
The driver allows the setting and reading of the device's properties via sysfs attributes.
Based on an original driver
[Extensively rewritten]
---
Documentation/ABI/testing/sysfs-i2c-bma023 | 93 ++ drivers/input/misc/Kconfig | 10 drivers/input/misc/Makefile | 1 drivers/input/misc/bma023.c | 1308 ++++++++++++++++++++++++++++ include/linux/i2c/bma023.h | 44 + 5 files changed, 1456 insertions(+), 0 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-i2c-bma023 create mode 100644 drivers/input/misc/bma023.c create mode 100644 include/linux/i2c/bma023.h
Documentation/ABI/testing/sysfs-i2c-bma023 new file +93 -0
@@ -0,0 +1,93 @@ +*Note*: It is anticpated that if IIO ever makes it upstream that the +preferred general purpose non-input interface to this hardware will become IIO. + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/range +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Configure the sensing range of the device + 0: +/- 2G + 1: +/- 4G + 2: +/- 8G + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/bandwidth +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Digital filtering on ADC output data + 0: 25Hz + 1: 50Hz + 2: 100Hz + 3: 190Hz + 4: 375Hz + 5: 750Hz + 6: 1500Hz + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/new_data_int +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Generate an interrupt when the axes values are changed + 0: disable + 1: enable + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/hg_int +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Generate an interrupt when the high-g threshold is met + 0: disable + 1: enable + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/lg_int +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Generate an interrupt when the low-g threshold is met + 0: disable + 1: enable + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/hg_dur +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: High G duration required to trigger. + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/hg_hyst +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: High G duration hysteresis + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/hg_thres +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: High G threshold + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/lg_dur +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Low G duration required to trigger + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/lg_hyst +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Low G duration hysteresis + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/lg_thres +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Low G threshold + (See the equations in the data sheet) + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/power_mode +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Power mode + 0: Use runtime PM + 1: Forced on + +What: /sys/bus/i2c/devices/<busnum>-<devaddr>/accel_data +Date: February 2011 +Contact: Alan Cox <[email protected]> +Description: Raw XYZ co-ordinate data, each ranges from -512 to +511, + formatted as (x,y,z) to match existing similar interfaces +
drivers/input/misc/Kconfig +10 -0
@@ -454,4 +454,14 @@ config INPUT_CMA3000_I2C To compile this driver as a module, choose M here: the module will be called cma3000_d0x_i2c. +config INPUT_BMA023 + tristate "BMA023/SMB380 Triaxial acceleration sensor" + depends on I2C + help + Say Y here if you want to support Bosch BMA023/SMB380 + connected via an I2C bus. + + To compile this driver as a module, choose M here: the + module will be called bma023. + endif
drivers/input/misc/Makefile +1 -0
@@ -36,6 +36,7 @@ obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o obj-$(CONFIG_INPUT_RB532_BUTTON) += rb532_button.o obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o +obj-$(CONFIG_INPUT_BMA023) += bma023.o obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o
drivers/input/misc/bma023.c new file +1308 -0
1,308 lines not on this page · raw message
include/linux/i2c/bma023.h new file +44 -0
44 lines not on this page · raw message
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html