2023-04-13 03:11:54

by Marius Hoch

[permalink] [raw]
Subject: [PATCH v2 0/6] iio: st_sensors: Add lsm303d support

Hi!

This patch series adds support for the LSM303D accelerometer and
magnetometer. As the LSM303D is basically, as far as I can tell,
the LSM9DS0 without gyroscope, we can easily re-use its definitions.

This was tested on a Lenovo Yoga Tablet 2 1051-F.

Cheers,
Marius

Marius Hoch (6):
iio: accel: st_accel: Add LSM303D
iio: magnetometer: st_accel: Add LSM303D
iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver
iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU
driver
iio: Comment that the LSM303D also has the Magnetometer DRDY
dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

.../devicetree/bindings/iio/st,st-sensors.yaml | 1 +
drivers/iio/accel/st_accel_core.c | 1 +
drivers/iio/imu/st_lsm9ds0/Kconfig | 3 ++-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 15 +++++++++++++++
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 15 +++++++++++++++
drivers/iio/magnetometer/st_magn_core.c | 1 +
include/linux/iio/common/st_sensors.h | 1 +
include/linux/platform_data/st_sensors_pdata.h | 2 +-
8 files changed, 37 insertions(+), 2 deletions(-)


base-commit: e62252bc55b6d4eddc6c2bdbf95a448180d6a08d
--
2.39.2


2023-04-13 03:12:02

by Marius Hoch

[permalink] [raw]
Subject: [PATCH v2 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

Same as the lsm9ds0, except that the lsm303d doesn't
feature a gyroscope.

Signed-off-by: Marius Hoch <[email protected]>
---
Documentation/devicetree/bindings/iio/st,st-sensors.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
index c6201976378f..194aca5542c2 100644
--- a/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
+++ b/Documentation/devicetree/bindings/iio/st,st-sensors.yaml
@@ -85,6 +85,7 @@ properties:
- description: IMUs
enum:
- st,lsm9ds0-imu
+ - st,lsm303d-imu
- description: Deprecated bindings
enum:
- st,lis302dl-spi
--
2.39.2

2023-04-13 03:12:14

by Marius Hoch

[permalink] [raw]
Subject: [PATCH v2 5/6] iio: Comment that the LSM303D also has the Magnetometer DRDY

Per its datasheet, the LSM303D also features that
pin.

Signed-off-by: Marius Hoch <[email protected]>
---
include/linux/platform_data/st_sensors_pdata.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/platform_data/st_sensors_pdata.h b/include/linux/platform_data/st_sensors_pdata.h
index 897051e51b78..a657830232ae 100644
--- a/include/linux/platform_data/st_sensors_pdata.h
+++ b/include/linux/platform_data/st_sensors_pdata.h
@@ -15,7 +15,7 @@
* @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
* Available only for accelerometer, magnetometer and pressure sensors.
* Accelerometer DRDY on LSM330 available only on pin 1 (see datasheet).
- * Magnetometer DRDY is supported only on LSM9DS0.
+ * Magnetometer DRDY is supported only on LSM9DS0 and LSM303D.
* @open_drain: set the interrupt line to be open drain if possible.
* @spi_3wire: enable spi-3wire mode.
* @pullups: enable/disable i2c controller pullup resistors.
--
2.39.2

2023-04-13 08:10:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

On 13/04/2023 04:40, Marius Hoch wrote:
> Same as the lsm9ds0, except that the lsm303d doesn't
> feature a gyroscope.
>
> Signed-off-by: Marius Hoch <[email protected]>

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC. It might happen, that command when run on an older
kernel, gives you outdated entries. Therefore please be sure you base
your patches on recent Linux kernel.

Best regards,
Krzysztof

2023-04-15 16:58:58

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

On Thu, 13 Apr 2023 10:07:04 +0200
Krzysztof Kozlowski <[email protected]> wrote:

> On 13/04/2023 04:40, Marius Hoch wrote:
> > Same as the lsm9ds0, except that the lsm303d doesn't
> > feature a gyroscope.
> >
> > Signed-off-by: Marius Hoch <[email protected]>
>
> Please use scripts/get_maintainers.pl to get a list of necessary people
> and lists to CC. It might happen, that command when run on an older
> kernel, gives you outdated entries. Therefore please be sure you base
> your patches on recent Linux kernel.

Just to avoid any confusion. Point here is that the dt-binding
maintainers and list should be cc'd on series that touch bindings.

Jonathan

>
> Best regards,
> Krzysztof
>

2023-04-16 01:20:29

by Marius Hoch

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

On 15/04/2023 18:51, Jonathan Cameron wrote:
> On Thu, 13 Apr 2023 10:07:04 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
>> On 13/04/2023 04:40, Marius Hoch wrote:
>>> Same as the lsm9ds0, except that the lsm303d doesn't
>>> feature a gyroscope.
>>>
>>> Signed-off-by: Marius Hoch <[email protected]>
>> Please use scripts/get_maintainers.pl to get a list of necessary people
>> and lists to CC. It might happen, that command when run on an older
>> kernel, gives you outdated entries. Therefore please be sure you base
>> your patches on recent Linux kernel.
> Just to avoid any confusion. Point here is that the dt-binding
> maintainers and list should be cc'd on series that touch bindings.
>
> Jonathan
Thank you for your replies. Not sure what went wrong here initially, I
probably only ran get_maintainer.pl on some of the patches.

For v3 I used a complete and up to date list of recipients.

Cheers,
Marius
>
>> Best regards,
>> Krzysztof
>>

2023-04-16 07:20:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer

On 15/04/2023 18:51, Jonathan Cameron wrote:
> On Thu, 13 Apr 2023 10:07:04 +0200
> Krzysztof Kozlowski <[email protected]> wrote:
>
>> On 13/04/2023 04:40, Marius Hoch wrote:
>>> Same as the lsm9ds0, except that the lsm303d doesn't
>>> feature a gyroscope.
>>>
>>> Signed-off-by: Marius Hoch <[email protected]>
>>
>> Please use scripts/get_maintainers.pl to get a list of necessary people
>> and lists to CC. It might happen, that command when run on an older
>> kernel, gives you outdated entries. Therefore please be sure you base
>> your patches on recent Linux kernel.
>
> Just to avoid any confusion. Point here is that the dt-binding
> maintainers and list should be cc'd on series that touch bindings.
>

Maybe not only there, maybe more people were missed.

Best regards,
Krzysztof