From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: lorenzo.bianconi@redhat.com, linux-iio@vger.kernel.org,
mario.tesi@st.com, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub
Date: Fri, 12 Nov 2021 16:27:58 +0000 [thread overview]
Message-ID: <20211112162758.2c2293ae@jic23-huawei> (raw)
In-Reply-To: <78e0ba2979aca8cc1894fe4c99e784591ba681f1.1636552075.git.lorenzo@kernel.org>
On Wed, 10 Nov 2021 15:42:32 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> Introduce the capability to disable sensorhub through a device-tree
> property since there are some configurations where users want to
> explicitly disable sensor-hub auto-probing at bootstrap.
> A typical configuration is when the sensorhub clock/data lines are connected
> to a pull-up resistor since no slave sensors are connected to the i2c master.
> If SDO/SA0 line is connected to the same pull-up resistor, when the driver
> tries to probe slave devices connected on sensor-hub, it will force SDO/SA0
> line to low, modifying the device i2c address.
That's some 'interesting' wiring...
My only suggestion here is perhaps expand on shub as disable-sensor-hub
would be easier for people not familiar with the abbreviation?
Jonathan
>
> Tested-by: Mario Tesi <mario.tesi@st.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index f2cbbc756459..82ac6c59ca03 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -2244,7 +2244,9 @@ int st_lsm6dsx_probe(struct device *dev, int irq, int hw_id,
> return err;
>
> hub_settings = &hw->settings->shub_settings;
> - if (hub_settings->master_en.addr) {
> + if (hub_settings->master_en.addr &&
> + (!dev_fwnode(dev) ||
> + !device_property_read_bool(dev, "st,disable-shub"))) {
> err = st_lsm6dsx_shub_probe(hw, name);
> if (err < 0)
> return err;
next prev parent reply other threads:[~2021-11-12 16:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 14:42 [PATCH 0/2] add the capability to disable st_lsm6dsx sensor-hub Lorenzo Bianconi
2021-11-10 14:42 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub Lorenzo Bianconi
2021-11-12 16:27 ` Jonathan Cameron [this message]
2021-11-12 17:50 ` Lorenzo Bianconi
2021-11-10 14:42 ` [PATCH 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-shub property Lorenzo Bianconi
2021-11-12 16:28 ` Jonathan Cameron
2021-11-12 17:50 ` 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=20211112162758.2c2293ae@jic23-huawei \
--to=jic23@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=mario.tesi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).