Re: [PATCH] Support for the pressure sensor BMP085 from Bosch Sensortec.

From: Christoph Mair
Date: Tue Jun 22 2010 - 19:27:55 EST


Am Montag 21 Juni 2010, 23:49:58 schrieben Sie:
> On Sun, 20 Jun 2010 22:50:58 +0200
>
> Christoph Mair <christoph.mair@xxxxxxxxx> wrote:
> > This driver adds support for the BMP085 digital pressure sensor
> > from Bosch Sensortec.
>
> If there's a datasheet available, it would be nice to provide a
> reference to that in the driver.
I will send a patch to fix this.

> Please do send a full description of the proposed API so we can review
> that. What are the contents of these files? What are the units of
> those contents, etc?
There is a short description before the methods bmp085_get_temperature() and
bmp085_get_pressure(), but anyway.

Here is a Description of the current sysfs user interface:

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.


> Are there any similar drivers in the tree (I don't think so) and if so
> does this new driver offer the same interface?
I did not find one.

> Bear in mind that if new drivers for similar devices _do_ come along
> then we'd prefer that those drivers implement the same interface as
> this one. So is this driver's interface well-designed from that point
> of view?
The pressure0_input and temp0_input should follow the naming convention of
hwmon devices. I think that would be ok for other sensors too. The
oversampling is special to this device and others may not support this.

A more general problem is the obtainable resolution. I work on a humidity
sensor driver for the SHT21. It measures temperatures with a resolution of
0.01 celsius, ten times higher than the bmp085.
Maybe we need an additional sysfs file which contains the current measurement
resolution.

I think it would be nice to have a general sensor api which for example
specifies the sensor type, the units used for this type and the resolution of
each result.
Any thoughts on this?

> Also, we're supposed to docuemnt these things formally in
> Documentation/ABI/.
I will send a patch for this one too.

>
> > ...
> >
> > + * The chip will use 2^oversampling samples for interlan averaging.
>
> I assumed that was supposed to read "internal".
True.

Best Regards,
Christoph
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/