From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: linux-iio@vger.kernel.org, linus.walleij@linaro.org,
lorenzo.bianconi@st.com, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/5] iio: st_sensors: do not always write enable_axis register
Date: Thu, 17 Aug 2017 16:00:57 +0100 [thread overview]
Message-ID: <20170817160057.2f25fd92@archlinux> (raw)
In-Reply-To: <20170816191316.11469-3-lorenzo.bianconi@st.com>
On Wed, 16 Aug 2017 21:13:13 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:
> New devices (e.g. LIS2DW12) enable all axis by default and do not export
> that capability in register map. Check if the enable_axis register
> address has been declared in st_sensor_settings map in order to verify if
> the driver needs to enable all sensor axis
>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Sounds like the software guys have been feeding back what is useful
to the hardware team ;)
Anyhow, patch is fine. Will pick up in V2.
Jonathan
> ---
> drivers/iio/common/st_sensors/st_sensors_core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index a26217b0604f..6331cc91e02d 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -221,11 +221,14 @@ EXPORT_SYMBOL(st_sensors_set_enable);
> int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable)
> {
> struct st_sensor_data *sdata = iio_priv(indio_dev);
> + int err = 0;
>
> - return st_sensors_write_data_with_mask(indio_dev,
> + if (sdata->sensor_settings->enable_axis.addr)
> + err = st_sensors_write_data_with_mask(indio_dev,
> sdata->sensor_settings->enable_axis.addr,
> sdata->sensor_settings->enable_axis.mask,
> axis_enable);
> + return err;
> }
> EXPORT_SYMBOL(st_sensors_set_axis_enable);
>
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lorenzo Bianconi
<lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
lorenzo.bianconi-qxv4g6HH51o@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/5] iio: st_sensors: do not always write enable_axis register
Date: Thu, 17 Aug 2017 16:00:57 +0100 [thread overview]
Message-ID: <20170817160057.2f25fd92@archlinux> (raw)
In-Reply-To: <20170816191316.11469-3-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
On Wed, 16 Aug 2017 21:13:13 +0200
Lorenzo Bianconi <lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> New devices (e.g. LIS2DW12) enable all axis by default and do not export
> that capability in register map. Check if the enable_axis register
> address has been declared in st_sensor_settings map in order to verify if
> the driver needs to enable all sensor axis
>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
Sounds like the software guys have been feeding back what is useful
to the hardware team ;)
Anyhow, patch is fine. Will pick up in V2.
Jonathan
> ---
> drivers/iio/common/st_sensors/st_sensors_core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
> index a26217b0604f..6331cc91e02d 100644
> --- a/drivers/iio/common/st_sensors/st_sensors_core.c
> +++ b/drivers/iio/common/st_sensors/st_sensors_core.c
> @@ -221,11 +221,14 @@ EXPORT_SYMBOL(st_sensors_set_enable);
> int st_sensors_set_axis_enable(struct iio_dev *indio_dev, u8 axis_enable)
> {
> struct st_sensor_data *sdata = iio_priv(indio_dev);
> + int err = 0;
>
> - return st_sensors_write_data_with_mask(indio_dev,
> + if (sdata->sensor_settings->enable_axis.addr)
> + err = st_sensors_write_data_with_mask(indio_dev,
> sdata->sensor_settings->enable_axis.addr,
> sdata->sensor_settings->enable_axis.mask,
> axis_enable);
> + return err;
> }
> EXPORT_SYMBOL(st_sensors_set_axis_enable);
>
next prev parent reply other threads:[~2017-08-17 15:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 19:13 [PATCH 0/5] Add support to LIS2DW12 accel sensor Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
2017-08-16 19:13 ` [PATCH 1/5] iio: st_sensors: decouple irq1 configuration parameters from the irq2 ones Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
2017-08-17 14:59 ` Jonathan Cameron
2017-08-17 14:59 ` Jonathan Cameron
2017-08-17 15:09 ` Lorenzo Bianconi
2017-08-17 15:09 ` Lorenzo Bianconi
2017-08-16 19:13 ` [PATCH 2/5] iio: st_sensors: do not always write enable_axis register Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
2017-08-17 15:00 ` Jonathan Cameron [this message]
2017-08-17 15:00 ` Jonathan Cameron
2017-08-16 19:13 ` [PATCH 3/5] iio: st_sensors: add register mask for status register Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
2017-08-17 15:04 ` Jonathan Cameron
2017-08-17 15:04 ` Jonathan Cameron
2017-08-16 19:13 ` [PATCH 4/5] iio: accel: add support to LIS2DW12 Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
2017-08-17 15:05 ` Jonathan Cameron
2017-08-17 15:05 ` Jonathan Cameron
2017-08-16 19:13 ` [PATCH 5/5] dt-bindings: iio: accel: add LIS2DW12 sensor device binding Lorenzo Bianconi
2017-08-16 19:13 ` Lorenzo Bianconi
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=20170817160057.2f25fd92@archlinux \
--to=jic23@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=lorenzo.bianconi@st.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.