All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Dogaru <vlad.dogaru@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
	linux-iio@vger.kernel.org,
	Christoph Mair <christoph.mair@gmail.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2 1/2] iio: pressure: bmp280: add support for BMP180
Date: Mon, 18 Apr 2016 15:01:22 +0300	[thread overview]
Message-ID: <20160418120122.GC20350@vdogaru> (raw)
In-Reply-To: <57120E15.2020105@kernel.org>

Hi Jonathan,

On Sat, Apr 16, 2016 at 11:04:05AM +0100, Jonathan Cameron wrote:
> On 15/04/16 18:53, Akinobu Mita wrote:
[...]
> > +static int bmp180_read_press(struct bmp280_data *data,
> > +			     int *val, int *val2)
> > +{
> > +	int ret;
> > +	s32 adc_press;
> > +	u32 comp_press;
> > +
> > +	/* Read and compensate temperature so we get a reading of t_fine. */
> > +	ret = bmp180_read_temp(data, NULL);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = bmp180_read_adc_press(data, &adc_press);
> > +	if (ret)
> > +		return ret;
> > +
> > +	comp_press = bmp180_compensate_press(data, adc_press);
> > +
> > +	*val = comp_press;
> > +	*val2 = 1000;
> This would be better done using a _scale info_mask element to handle the divide
> by 1000.  That lets the decision on whether the conversion is even needed be
> moved to userspace.
> 
> Unfortunately that's also true for the bmp280 as it stands which is annoying
> as that makes it ABI which we shouldn't be changing.  Ah well, the device
> is slow anyway so not terrible to leave this as it is.  I should have picked
> that up when reviewing that driver originally - sometimes we have live with
> our mistakes!

I don't think that qualifies as breaking ABI.  The ABI specifies which
files *may* exist and how they should be interpreted, if they exist.
It does not guarantee that a specific sensor such as BMP280 exposes its
measurement as in_temp_input, rather than in_temp_raw and in_temp_scale.

That said, I don't feel strongly about the changes either way.  When I
initially wrote the driver I thought the operations were harmless enough
to do in the kernel.

Thanks,
Vlad

  reply	other threads:[~2016-04-18 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 17:53 [PATCH v2 0/2] iio: pressure: bmp280: add support for BMP180 and oversampling rate control Akinobu Mita
2016-04-15 17:53 ` [PATCH v2 1/2] iio: pressure: bmp280: add support for BMP180 Akinobu Mita
2016-04-16 10:04   ` Jonathan Cameron
2016-04-18 12:01     ` Vlad Dogaru [this message]
2016-04-18 13:47       ` jic23
2016-04-15 17:53 ` [PATCH v2 2/2] iio: pressure: bmp280: add ability to control oversampling rate Akinobu Mita
2016-04-16 10:08   ` Jonathan Cameron
2016-04-18 11:52   ` Vlad Dogaru
2016-04-18 13:46     ` Akinobu Mita

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=20160418120122.GC20350@vdogaru \
    --to=vlad.dogaru@intel.com \
    --cc=akinobu.mita@gmail.com \
    --cc=christoph.mair@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --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 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.