All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi83-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lorenzo.bianconi-qxv4g6HH51o@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 2/4] iio: common: st_sensors: check odr address value in st_sensors_set_odr()
Date: Sun, 17 Sep 2017 18:17:10 +0200	[thread overview]
Message-ID: <20170917161712.14645-3-lorenzo.bianconi@st.com> (raw)
In-Reply-To: <20170917161712.14645-1-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>

Do not try to configure sample frequency if the sensor do not export
odr register address in register map. That change will be used to
properly support LIS3DHH accel sensor.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 drivers/iio/common/st_sensors/st_sensors_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 40dfdfc0906b..57db19182e95 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -93,6 +93,9 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
 	struct st_sensor_odr_avl odr_out = {0, 0};
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
+	if (!sdata->sensor_settings->odr.addr)
+		return 0;
+
 	err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out);
 	if (err < 0)
 		goto st_sensors_match_odr_error;
-- 
2.14.1

WARNING: multiple messages have this Message-ID (diff)
From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
To: jic23@kernel.org
Cc: linux-iio@vger.kernel.org, lorenzo.bianconi@st.com,
	devicetree@vger.kernel.org
Subject: [PATCH 2/4] iio: common: st_sensors: check odr address value in st_sensors_set_odr()
Date: Sun, 17 Sep 2017 18:17:10 +0200	[thread overview]
Message-ID: <20170917161712.14645-3-lorenzo.bianconi@st.com> (raw)
In-Reply-To: <20170917161712.14645-1-lorenzo.bianconi@st.com>

Do not try to configure sample frequency if the sensor do not export
odr register address in register map. That change will be used to
properly support LIS3DHH accel sensor.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/common/st_sensors/st_sensors_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 40dfdfc0906b..57db19182e95 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -93,6 +93,9 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
 	struct st_sensor_odr_avl odr_out = {0, 0};
 	struct st_sensor_data *sdata = iio_priv(indio_dev);
 
+	if (!sdata->sensor_settings->odr.addr)
+		return 0;
+
 	err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out);
 	if (err < 0)
 		goto st_sensors_match_odr_error;
-- 
2.14.1

  parent reply	other threads:[~2017-09-17 16:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-17 16:17 [PATCH 0/4] Add support to LIS3DHH accel sensor Lorenzo Bianconi
2017-09-17 16:17 ` Lorenzo Bianconi
     [not found] ` <20170917161712.14645-1-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-09-17 16:17   ` [PATCH 1/4] iio: st_sensors: split open-drain parameters for irq1 and irq2 Lorenzo Bianconi
2017-09-17 16:17     ` Lorenzo Bianconi
     [not found]     ` <20170917161712.14645-2-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-10-10 19:39       ` Jonathan Cameron
2017-10-10 19:39         ` Jonathan Cameron
2017-09-17 16:17   ` Lorenzo Bianconi [this message]
2017-09-17 16:17     ` [PATCH 2/4] iio: common: st_sensors: check odr address value in st_sensors_set_odr() Lorenzo Bianconi
     [not found]     ` <20170917161712.14645-3-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-10-10 19:40       ` Jonathan Cameron
2017-10-10 19:40         ` Jonathan Cameron
2017-09-17 16:17   ` [PATCH 3/4] iio: accel: add support to LIS3DHH Lorenzo Bianconi
2017-09-17 16:17     ` Lorenzo Bianconi
     [not found]     ` <20170917161712.14645-4-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-10-10 19:40       ` Jonathan Cameron
2017-10-10 19:40         ` Jonathan Cameron
2017-09-17 16:17   ` [PATCH 4/4] dt-bindings: iio: accel: add LIS3DHH device bindings Lorenzo Bianconi
2017-09-17 16:17     ` Lorenzo Bianconi
     [not found]     ` <20170917161712.14645-5-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-09-20 20:53       ` Rob Herring
2017-09-20 20:53         ` Rob Herring
2017-10-10 19:43         ` Jonathan Cameron
2017-10-10 19:43           ` 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=20170917161712.14645-3-lorenzo.bianconi@st.com \
    --to=lorenzo.bianconi83-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lorenzo.bianconi-qxv4g6HH51o@public.gmane.org \
    /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.