From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Martin Kepplinger <martin.kepplinger@puri.sm>,
lorenzo.bianconi83@gmail.com, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: imu: st_lsm6dsx: make IIO_CHAN_INFO_SCALE shared by type
Date: Mon, 5 Aug 2019 17:04:35 +0200 [thread overview]
Message-ID: <20190805150435.GA15250@localhost.localdomain> (raw)
In-Reply-To: <20190805152148.0ea55f6e@archlinux>
[-- Attachment #1: Type: text/plain, Size: 2460 bytes --]
> On Thu, 1 Aug 2019 16:39:08 +0200
> Martin Kepplinger <martin.kepplinger@puri.sm> wrote:
>
> > in_accel_x_scale, in_accel_y_scale and in_accel_z_scale are always
> > the same. The scale is still defined to be in "info_mask_separate".
> >
> > Userspace (iio-sensor-proxy and others) is not used to that and only
> > looks for "in_accel_scale" for the scaling factor to apply.
> >
> > Change IIO_CHAN_INFO_SCALE from being separate in all channel to be
> > shared by type.
> >
> > This removes in_accel_x_scale, in_accel_y_scale and in_accel_z_scale and
> > makes available in_accel_scale.
> >
> > Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm>
> > ---
> >
> > AFAIK in all other drivers, IIO_CHAN_INFO_SCALE is "shared by type". Sure
> > devices are different, but LSM6DSX devices still don't have different
> > scales for x/y/z channels :)
>
> I'm fine with this, but would like a Lorenzo ack as we have had
> devices in other series where these are not equal. It used to
> be common in accelerometers as I think it was hard to get a large
> range in the vertical direction. Doubt that applies on these modern
> parts though!
>
> Thanks,
>
> Jonathan
AFAIK all the supported sensors have the same sensitivity on all axis and so I
am fine with this patch (it should be done in this way from day 0 actually :))
but is it going to break uapi? if not feel free to add:
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Regards,
Lorenzo
>
>
> >
> > thanks,
> >
> > martin
> >
> >
> >
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > index af379a5429ed..59c3ab7cbb6f 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > @@ -56,8 +56,8 @@ enum st_lsm6dsx_hw_id {
> > .address = addr, \
> > .modified = 1, \
> > .channel2 = mod, \
> > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
> > - BIT(IIO_CHAN_INFO_SCALE), \
> > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
> > + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \
> > .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \
> > .scan_index = scan_idx, \
> > .scan_type = { \
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-08-05 15:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 14:39 [PATCH] iio: imu: st_lsm6dsx: make IIO_CHAN_INFO_SCALE shared by type Martin Kepplinger
2019-08-05 14:21 ` Jonathan Cameron
2019-08-05 15:04 ` Lorenzo Bianconi [this message]
2019-08-05 15:41 ` 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=20190805150435.GA15250@localhost.localdomain \
--to=lorenzo@kernel.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=martin.kepplinger@puri.sm \
--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