All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Meerwald <pmeerw@pmeerw.net>, Vlad Dogaru <vlad.dogaru@intel.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: add bmp280 pressure and temperature driver
Date: Sat, 04 Oct 2014 11:30:30 +0100	[thread overview]
Message-ID: <542FCC46.1050700@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.01.1410031641190.17977@pmeerw.net>

On 03/10/14 15:44, Peter Meerwald wrote:
> 
>>>> +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?
> 
> yes
> 
> since pressure is using a temperature read and calibration data, it hardly 
> qualifies as 'raw'
I'd typically be happy with this if there was a significant advantage in
leaving the application of the final scale to userspace.  This would either
be in terms of time, accuracy or simplicity (as floating point math would
be available in userspace).  Hence the channel doesn't have to be completely
'raw'.  Having said that, looks like here it makes sense to just do the *10 in
kernel space ;)
> 
>> 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.
> 
> p.
> 

  reply	other threads:[~2014-10-04 10:30 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
2014-10-03 14:44     ` Peter Meerwald
2014-10-04 10:30       ` Jonathan Cameron [this message]
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=542FCC46.1050700@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=vlad.dogaru@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.