Linux IIO development
 help / color / mirror / Atom feed
From: Vlad Dogaru <vlad.dogaru@intel.com>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org
Subject: Re: [PATCH] iio: add bmp280 pressure and temperature driver
Date: Fri, 3 Oct 2014 13:16:19 +0300	[thread overview]
Message-ID: <20141003101619.GA17511@vdogaru> (raw)
In-Reply-To: <alpine.DEB.2.01.1410022146100.8592@pmeerw.net>

On Thu, Oct 02, 2014 at 10:04:45PM +0200, Peter Meerwald wrote:
<snip>
> > +/*
> > + * Returns temperature in DegC, resolution is 0.01 DegC.  Output value of
> > + * "5123" equals 51.23 DegC.  t_fine carries fine temperature as global
> > + * value.
> > + *
> > + * Taken from datasheet, Section 3.11.3, "Compensation formula".
> > + */
> > +static s32 bmp280_compensate_temp(struct bmp280_data *data,
> > +				  s32 adc_temp)
> > +{
> > +	s32 var1, var2, T;
> 
> use lowercase t?

I snatched this from the datasheet, which used capital T.  I'll use
lowercase in v2.

<snip>

> > +static int bmp280_read_raw(struct iio_dev *indio_dev,
> > +			   struct iio_chan_spec const *chan,
> > +			   int *val, int *val2, long mask)
> > +{
> > +	int ret;
> > +	struct bmp280_data *data = iio_priv(indio_dev);
> > +
> > +	mutex_lock(&data->lock);
> 
> locking is only needed for _RAW
> 
> > +
> > +	switch (mask) {
> > +	case IIO_CHAN_INFO_RAW:
> 
> I think this should be _PROCESSED, not _RAW;
> there is calibration and all kind of scaling done internally

Just to make sure here:  If I use _PROCESSED, I need to apply scale in
kernel space and remove _SCALE, correct?

I will address the rest of your observations in v2, once I get a chance
to test using the device on Monday.

Thank you for the review.

  reply	other threads:[~2014-10-03 10:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02 19:40 [PATCH] iio: add bmp280 pressure and temperature driver Vlad Dogaru
2014-10-02 20:04 ` Peter Meerwald
2014-10-03 10:16   ` Vlad Dogaru [this message]
2014-10-03 14:44     ` Peter Meerwald
2014-10-04 10:30       ` Jonathan Cameron
2014-10-04 11:09   ` Jonathan Cameron

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=20141003101619.GA17511@vdogaru \
    --to=vlad.dogaru@intel.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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