Commit 5bf1d290 authored by Christoph Mair's avatar Christoph Mair Committed by Linus Torvalds

drivers/misc: support for the pressure sensor BMP085 from Bosch Sensortec

This driver adds support for the BMP085 digital pressure sensor from Bosch
Sensortec.  It exposes a sysfs api to userspace where pressure and
temperature measurement results can be read from the pressure0_input and
temp0_input file.  The chip is able to calculate the average of up to
eight samples to increase the accuracy.  This feature can be controlled by
writing to the oversampling file.

The BMP085 digital pressure sensor can measure ambient air pressure and
temperature.  Both values can be obtained from sysfs files.  The pressure
is measured by reading from pressure0_input.  Valid values range from
30000 to 110000 pascal with a resolution of 1 pascal (=0.01 millibar).

temp0_input holds the current temperature in degree celsius, multiplied by
10.  This results in a resolution of a tenth degree celsius.  Values range
from -400 to 850.

To increase the accuracy, this chip can calculate the average of 1, 2, 4
or 8 samples.  This behavior is controlled through the oversampling sysfs
file.  Two to the power of the value written to that file specifies how
many samples will be used.  Valid values: 0..3.

[akpm@linux-foundation.org: fix typo]
[shubhrajyoti@ti.com: optimize the wait time for the pressure sensor, definition of long is arch dependent so make it u32]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarChristoph Mair <christoph.mair@gmail.com>
Signed-off-by: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Cc: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cdf8afca
What: /sys/bus/i2c/devices/<busnum>-<devaddr>/pressure0_input
Date: June 2010
Contact: Christoph Mair <christoph.mair@gmail.com>
Description: Start a pressure measurement and read the result. Values
represent the ambient air pressure in pascal (0.01 millibar).
Reading: returns the current air pressure.
What: /sys/bus/i2c/devices/<busnum>-<devaddr>/temp0_input
Date: June 2010
Contact: Christoph Mair <christoph.mair@gmail.com>
Description: Measure the ambient temperature. The returned value represents
the ambient temperature in units of 0.1 degree celsius.
Reading: returns the current temperature.
What: /sys/bus/i2c/devices/<busnum>-<devaddr>/oversampling
Date: June 2010
Contact: Christoph Mair <christoph.mair@gmail.com>
Description: Tell the bmp085 to use more samples to calculate a pressure
value. When writing to this file the chip will use 2^x samples
to calculate the next pressure value with x being the value
written. Using this feature will decrease RMS noise and
increase the measurement time.
Reading: returns the current oversampling setting.
Writing: sets a new oversampling setting.
Accepted values: 0..3.
...@@ -373,6 +373,16 @@ config ARM_CHARLCD ...@@ -373,6 +373,16 @@ config ARM_CHARLCD
line and the Linux version on the second line, but that's line and the Linux version on the second line, but that's
still useful. still useful.
config BMP085
tristate "BMP085 digital pressure sensor"
depends on I2C && SYSFS
help
If you say yes here you get support for the Bosch Sensortec
BMP086 digital pressure sensor.
To compile this driver as a module, choose M here: the
module will be called bmp085.
source "drivers/misc/c2port/Kconfig" source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig" source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig" source "drivers/misc/cb710/Kconfig"
......
...@@ -9,6 +9,7 @@ obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o ...@@ -9,6 +9,7 @@ obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o
obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o
obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
obj-$(CONFIG_BMP085) += bmp085.o
obj-$(CONFIG_ICS932S401) += ics932s401.o obj-$(CONFIG_ICS932S401) += ics932s401.o
obj-$(CONFIG_LKDTM) += lkdtm.o obj-$(CONFIG_LKDTM) += lkdtm.o
obj-$(CONFIG_TIFM_CORE) += tifm_core.o obj-$(CONFIG_TIFM_CORE) += tifm_core.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment