mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Mair <christoph.mair@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jonathan Cameron <kernel@jic23.retrosnub.co.uk>,
	linux-kernel@vger.kernel.org,
	Stefan Schmidt <stefan@datenfreihafen.org>,
	Datta Shubhrajyoti <shubhrajyoti@ti.com>
Subject: Re: [PATCH] Support for the pressure sensor BMP085 from Bosch Sensortec.
Date: Wed, 23 Jun 2010 01:26:47 +0200	[thread overview]
Message-ID: <201006230126.48452.christoph.mair@gmail.com> (raw)
In-Reply-To: <20100621144958.d5fc694e.akpm@linux-foundation.org>

Am Montag 21 Juni 2010, 23:49:58 schrieben Sie:
> On Sun, 20 Jun 2010 22:50:58 +0200
> 
> Christoph Mair <christoph.mair@gmail.com> 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

  reply	other threads:[~2010-06-22 23:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-19  1:58 Christoph Mair
2010-06-19 10:29 ` Jonathan Cameron
2010-06-20  0:27   ` Christoph Mair
2010-06-20 11:00     ` Jonathan Cameron
2010-06-20 20:50       ` Christoph Mair
2010-06-21  6:45         ` Datta, Shubhrajyoti
2010-06-21  8:52         ` Datta, Shubhrajyoti
2010-06-21 21:49         ` Andrew Morton
2010-06-22 23:26           ` Christoph Mair [this message]
2010-06-23 11:41             ` Jonathan Cameron
2010-06-26 11:10           ` bmp085: add inline and ABI documentation Christoph Mair
2010-06-26 11:10           ` [PATCH 1/2] Add ABI documentation for the bmp085 digital pressure sensor Christoph Mair
2010-06-26 11:10           ` [PATCH 2/2] bmp085: Add interface documentation and link to datasheet Christoph Mair

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201006230126.48452.christoph.mair@gmail.com \
    --to=christoph.mair@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@jic23.retrosnub.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shubhrajyoti@ti.com \
    --cc=stefan@datenfreihafen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome