* [PATCH v2 0/2] add the capability to disable st_lsm6dsx sensor-hub
@ 2021-11-13 15:23 Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property Lorenzo Bianconi
0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2021-11-13 15:23 UTC (permalink / raw)
To: jic23; +Cc: lorenzo.bianconi, linux-iio, mario.tesi, devicetree
Introduce the capability to disable sensorhub through a device-tree property
since 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.
Changes since v1:
- rename disable-shub property in disable-sensor-hub
- improve commit log
Lorenzo Bianconi (2):
iio: imu: st_lsm6dsx: add dts property to disable sensor-hub
Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property
Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 7 +++++++
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
--
2.31.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub
2021-11-13 15:23 [PATCH v2 0/2] add the capability to disable st_lsm6dsx sensor-hub Lorenzo Bianconi
@ 2021-11-13 15:23 ` Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property Lorenzo Bianconi
1 sibling, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2021-11-13 15:23 UTC (permalink / raw)
To: jic23; +Cc: lorenzo.bianconi, linux-iio, mario.tesi, devicetree
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.
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..727b4b6ac696 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-sensor-hub"))) {
err = st_lsm6dsx_shub_probe(hw, name);
if (err < 0)
return err;
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property
2021-11-13 15:23 [PATCH v2 0/2] add the capability to disable st_lsm6dsx sensor-hub Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub Lorenzo Bianconi
@ 2021-11-13 15:23 ` Lorenzo Bianconi
2021-11-29 21:26 ` Rob Herring
1 sibling, 1 reply; 5+ messages in thread
From: Lorenzo Bianconi @ 2021-11-13 15:23 UTC (permalink / raw)
To: jic23; +Cc: lorenzo.bianconi, linux-iio, mario.tesi, devicetree
Enable/disable internal i2c controller slave autoprobing at bootstrap.
Disable sensor-hub is useful if i2c controller clock/data lines are
connected through a pull-up with other chip lines (e.g. SDO/SA0).
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
index d9b3213318fb..0750f700a143 100644
--- a/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
@@ -61,6 +61,13 @@ properties:
type: boolean
description: enable/disable internal i2c controller pullup resistors.
+ st,disable-sensor-hub:
+ type: boolean
+ description:
+ Enable/disable internal i2c controller slave autoprobing at bootstrap.
+ Disable sensor-hub is useful if i2c controller clock/data lines are
+ connected through a pull-up with other chip lines (e.g. SDO/SA0).
+
drive-open-drain:
type: boolean
description:
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property
2021-11-13 15:23 ` [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property Lorenzo Bianconi
@ 2021-11-29 21:26 ` Rob Herring
2021-12-04 15:12 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2021-11-29 21:26 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: jic23, lorenzo.bianconi, devicetree, linux-iio, mario.tesi
On Sat, 13 Nov 2021 16:23:15 +0100, Lorenzo Bianconi wrote:
> Enable/disable internal i2c controller slave autoprobing at bootstrap.
> Disable sensor-hub is useful if i2c controller clock/data lines are
> connected through a pull-up with other chip lines (e.g. SDO/SA0).
>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 7 +++++++
> 1 file changed, 7 insertions(+)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property
2021-11-29 21:26 ` Rob Herring
@ 2021-12-04 15:12 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2021-12-04 15:12 UTC (permalink / raw)
To: Rob Herring
Cc: Lorenzo Bianconi, lorenzo.bianconi, devicetree, linux-iio, mario.tesi
On Mon, 29 Nov 2021 15:26:17 -0600
Rob Herring <robh@kernel.org> wrote:
> On Sat, 13 Nov 2021 16:23:15 +0100, Lorenzo Bianconi wrote:
> > Enable/disable internal i2c controller slave autoprobing at bootstrap.
> > Disable sensor-hub is useful if i2c controller clock/data lines are
> > connected through a pull-up with other chip lines (e.g. SDO/SA0).
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
>
> Reviewed-by: Rob Herring <robh@kernel.org>
Series applied to the togreg branch of iio.git
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-04 15:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-13 15:23 [PATCH v2 0/2] add the capability to disable st_lsm6dsx sensor-hub Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: add dts property to disable sensor-hub Lorenzo Bianconi
2021-11-13 15:23 ` [PATCH v2 2/2] Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property Lorenzo Bianconi
2021-11-29 21:26 ` Rob Herring
2021-12-04 15:12 ` Jonathan Cameron
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.