linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Add support to LIS2MDL magnetometer sensor
@ 2017-08-16 17:02 Lorenzo Bianconi
  2017-08-16 17:02 ` [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR Lorenzo Bianconi
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 17:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

Fix two interrupt issues for LSM303AGR magn sensor

Lorenzo Bianconi (4):
  iio: magnetometer: st_magn: fix status register address for LSM303AGR
  iio: magnetometer: st_magn: remove ihl property for LSM303AGR
  iio: magnetometer: add support to LIS2MDL
  dt-bindings: iio: magn: add LIS2MDL sensor device binding

 Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
 drivers/iio/magnetometer/st_magn.h                   | 1 +
 drivers/iio/magnetometer/st_magn_core.c              | 5 ++---
 drivers/iio/magnetometer/st_magn_i2c.c               | 5 +++++
 drivers/iio/magnetometer/st_magn_spi.c               | 5 +++++
 5 files changed, 14 insertions(+), 3 deletions(-)

-- 
2.14.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
@ 2017-08-16 17:02 ` Lorenzo Bianconi
  2017-08-17 14:43   ` Jonathan Cameron
  2017-08-16 17:02 ` [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property " Lorenzo Bianconi
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 17:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

Fixes: 97865fe41322 (iio: st_sensors: verify interrupt event to status)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/magnetometer/st_magn_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 3573636bad8e..039b0e94420a 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -358,7 +358,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
 			.mask_int1 = 0x01,
 			.addr_ihl = 0x63,
 			.mask_ihl = 0x04,
-			.addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
+			.addr_stat_drdy = 0x67,
 		},
 		.multi_read_bit = false,
 		.bootime = 2,
-- 
2.14.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property for LSM303AGR
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
  2017-08-16 17:02 ` [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR Lorenzo Bianconi
@ 2017-08-16 17:02 ` Lorenzo Bianconi
  2017-08-17 14:48   ` Jonathan Cameron
  2017-08-16 17:02 ` [PATCH 3/4] iio: magnetometer: add support to LIS2MDL Lorenzo Bianconi
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 17:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

Remove IRQ active low support for LSM303AGR since the sensor does not
support that capability for data-ready line

Fixes: a9fd053b56c6 (iio: st_sensors: support active-low interrupts)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/magnetometer/st_magn_core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index 039b0e94420a..cd89962f2de3 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -356,8 +356,6 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
 		.drdy_irq = {
 			.addr = 0x62,
 			.mask_int1 = 0x01,
-			.addr_ihl = 0x63,
-			.mask_ihl = 0x04,
 			.addr_stat_drdy = 0x67,
 		},
 		.multi_read_bit = false,
-- 
2.14.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] iio: magnetometer: add support to LIS2MDL
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
  2017-08-16 17:02 ` [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR Lorenzo Bianconi
  2017-08-16 17:02 ` [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property " Lorenzo Bianconi
@ 2017-08-16 17:02 ` Lorenzo Bianconi
  2017-08-17 14:52   ` Jonathan Cameron
  2017-08-16 17:02 ` [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding Lorenzo Bianconi
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 17:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

add support to STMicroelectronics LIS2MDL magnetometer in
st_magn framework

http://www.st.com/resource/en/datasheet/lis2mdl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/magnetometer/st_magn.h      | 1 +
 drivers/iio/magnetometer/st_magn_core.c | 1 +
 drivers/iio/magnetometer/st_magn_i2c.c  | 5 +++++
 drivers/iio/magnetometer/st_magn_spi.c  | 5 +++++
 4 files changed, 12 insertions(+)

diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h
index 9daca4681922..8fe51ce427bd 100644
--- a/drivers/iio/magnetometer/st_magn.h
+++ b/drivers/iio/magnetometer/st_magn.h
@@ -19,6 +19,7 @@
 #define LSM303DLM_MAGN_DEV_NAME		"lsm303dlm_magn"
 #define LIS3MDL_MAGN_DEV_NAME		"lis3mdl"
 #define LSM303AGR_MAGN_DEV_NAME		"lsm303agr_magn"
+#define LIS2MDL_MAGN_DEV_NAME		"lis2mdl"
 
 int st_magn_common_probe(struct iio_dev *indio_dev);
 void st_magn_common_remove(struct iio_dev *indio_dev);
diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index cd89962f2de3..e68368b5b2a3 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -323,6 +323,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
 		.wai_addr = 0x4f,
 		.sensors_supported = {
 			[0] = LSM303AGR_MAGN_DEV_NAME,
+			[1] = LIS2MDL_MAGN_DEV_NAME,
 		},
 		.ch = (struct iio_chan_spec *)st_magn_3_16bit_channels,
 		.odr = {
diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
index 6a6c8121ac2c..feaa28cf6a77 100644
--- a/drivers/iio/magnetometer/st_magn_i2c.c
+++ b/drivers/iio/magnetometer/st_magn_i2c.c
@@ -40,6 +40,10 @@ static const struct of_device_id st_magn_of_match[] = {
 		.compatible = "st,lsm303agr-magn",
 		.data = LSM303AGR_MAGN_DEV_NAME,
 	},
+	{
+		.compatible = "st,lis2mdl",
+		.data = LIS2MDL_MAGN_DEV_NAME,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, st_magn_of_match);
@@ -85,6 +89,7 @@ static const struct i2c_device_id st_magn_id_table[] = {
 	{ LSM303DLM_MAGN_DEV_NAME },
 	{ LIS3MDL_MAGN_DEV_NAME },
 	{ LSM303AGR_MAGN_DEV_NAME },
+	{ LIS2MDL_MAGN_DEV_NAME },
 	{},
 };
 MODULE_DEVICE_TABLE(i2c, st_magn_id_table);
diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
index 1ea64dd318aa..7b7cd08fcc32 100644
--- a/drivers/iio/magnetometer/st_magn_spi.c
+++ b/drivers/iio/magnetometer/st_magn_spi.c
@@ -33,6 +33,10 @@ static const struct of_device_id st_magn_of_match[] = {
 		.compatible = "st,lsm303agr-magn",
 		.data = LSM303AGR_MAGN_DEV_NAME,
 	},
+	{
+		.compatible = "st,lis2mdl",
+		.data = LIS2MDL_MAGN_DEV_NAME,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, st_magn_of_match);
@@ -74,6 +78,7 @@ static int st_magn_spi_remove(struct spi_device *spi)
 static const struct spi_device_id st_magn_id_table[] = {
 	{ LIS3MDL_MAGN_DEV_NAME },
 	{ LSM303AGR_MAGN_DEV_NAME },
+	{ LIS2MDL_MAGN_DEV_NAME },
 	{},
 };
 MODULE_DEVICE_TABLE(spi, st_magn_id_table);
-- 
2.14.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
                   ` (2 preceding siblings ...)
  2017-08-16 17:02 ` [PATCH 3/4] iio: magnetometer: add support to LIS2MDL Lorenzo Bianconi
@ 2017-08-16 17:02 ` Lorenzo Bianconi
  2017-08-17  7:01   ` Lorenzo Bianconi
  2017-08-16 18:52 ` [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
  2017-08-16 21:07 ` Linus Walleij
  5 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 17:02 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
index 1e305f61f3df..9ec6f5ce54fc 100644
--- a/Documentation/devicetree/bindings/iio/st-sensors.txt
+++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
@@ -64,6 +64,7 @@ Magnetometers:
 - st,lsm303dlhc-magn
 - st,lsm303dlm-magn
 - st,lis3mdl-magn
+- st,lis2mdl
 
 Pressure sensors:
 - st,lps001wp-press
-- 
2.14.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Add support to LIS2MDL magnetometer sensor
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
                   ` (3 preceding siblings ...)
  2017-08-16 17:02 ` [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding Lorenzo Bianconi
@ 2017-08-16 18:52 ` Lorenzo Bianconi
  2017-08-16 23:21   ` Jonathan Cameron
  2017-08-16 21:07 ` Linus Walleij
  5 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-16 18:52 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Linus Walleij, Lorenzo BIANCONI

Jonathan I forgot to add in cc device tree ML. Should I resend?

Regards,
Lorenzo

On Wed, Aug 16, 2017 at 7:02 PM, Lorenzo Bianconi
<lorenzo.bianconi83@gmail.com> wrote:
> Fix two interrupt issues for LSM303AGR magn sensor
>
> Lorenzo Bianconi (4):
>   iio: magnetometer: st_magn: fix status register address for LSM303AGR
>   iio: magnetometer: st_magn: remove ihl property for LSM303AGR
>   iio: magnetometer: add support to LIS2MDL
>   dt-bindings: iio: magn: add LIS2MDL sensor device binding
>
>  Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
>  drivers/iio/magnetometer/st_magn.h                   | 1 +
>  drivers/iio/magnetometer/st_magn_core.c              | 5 ++---
>  drivers/iio/magnetometer/st_magn_i2c.c               | 5 +++++
>  drivers/iio/magnetometer/st_magn_spi.c               | 5 +++++
>  5 files changed, 14 insertions(+), 3 deletions(-)
>
> --
> 2.14.0
>



-- 
UNIX is Sexy: who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount; fsck; more; yes; gasp;
umount; make clean; sleep

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Add support to LIS2MDL magnetometer sensor
  2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
                   ` (4 preceding siblings ...)
  2017-08-16 18:52 ` [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
@ 2017-08-16 21:07 ` Linus Walleij
  5 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2017-08-16 21:07 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Jonathan Cameron, linux-iio@vger.kernel.org, Lorenzo Bianconi

n Wed, Aug 16, 2017 at 7:02 PM, Lorenzo Bianconi
<lorenzo.bianconi83@gmail.com> wrote:

> Fix two interrupt issues for LSM303AGR magn sensor
>
> Lorenzo Bianconi (4):
>   iio: magnetometer: st_magn: fix status register address for LSM303AGR
>   iio: magnetometer: st_magn: remove ihl property for LSM303AGR
>   iio: magnetometer: add support to LIS2MDL
>   dt-bindings: iio: magn: add LIS2MDL sensor device binding

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
for all the patches.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] Add support to LIS2MDL magnetometer sensor
  2017-08-16 18:52 ` [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
@ 2017-08-16 23:21   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-08-16 23:21 UTC (permalink / raw)
  To: Lorenzo Bianconi, Jonathan Cameron
  Cc: linux-iio, Linus Walleij, Lorenzo BIANCONI

Reply to the ft patch adding the cc is fine.

On 17 August 2017 02:52:06 GMT+08:00, Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:
>Jonathan I forgot to add in cc device tree ML. Should I resend?
>
>Regards,
>Lorenzo
>
>On Wed, Aug 16, 2017 at 7:02 PM, Lorenzo Bianconi
><lorenzo.bianconi83@gmail.com> wrote:
>> Fix two interrupt issues for LSM303AGR magn sensor
>>
>> Lorenzo Bianconi (4):
>>   iio: magnetometer: st_magn: fix status register address for
>LSM303AGR
>>   iio: magnetometer: st_magn: remove ihl property for LSM303AGR
>>   iio: magnetometer: add support to LIS2MDL
>>   dt-bindings: iio: magn: add LIS2MDL sensor device binding
>>
>>  Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
>>  drivers/iio/magnetometer/st_magn.h                   | 1 +
>>  drivers/iio/magnetometer/st_magn_core.c              | 5 ++---
>>  drivers/iio/magnetometer/st_magn_i2c.c               | 5 +++++
>>  drivers/iio/magnetometer/st_magn_spi.c               | 5 +++++
>>  5 files changed, 14 insertions(+), 3 deletions(-)
>>
>> --
>> 2.14.0
>>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding
  2017-08-16 17:02 ` [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding Lorenzo Bianconi
@ 2017-08-17  7:01   ` Lorenzo Bianconi
  2017-08-17 14:55     ` Jonathan Cameron
  0 siblings, 1 reply; 13+ messages in thread
From: Lorenzo Bianconi @ 2017-08-17  7:01 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Linus Walleij, Lorenzo BIANCONI, devicetree

Added devicetree ml in cc

> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
> ---
>  Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
> index 1e305f61f3df..9ec6f5ce54fc 100644
> --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
> @@ -64,6 +64,7 @@ Magnetometers:
>  - st,lsm303dlhc-magn
>  - st,lsm303dlm-magn
>  - st,lis3mdl-magn
> +- st,lis2mdl
>
>  Pressure sensors:
>  - st,lps001wp-press
> --
> 2.14.0
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR
  2017-08-16 17:02 ` [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR Lorenzo Bianconi
@ 2017-08-17 14:43   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-08-17 14:43 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

On Wed, 16 Aug 2017 19:02:50 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> Fixes: 97865fe41322 (iio: st_sensors: verify interrupt event to status)
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Jonathan
> ---
>  drivers/iio/magnetometer/st_magn_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index 3573636bad8e..039b0e94420a 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -358,7 +358,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
>  			.mask_int1 = 0x01,
>  			.addr_ihl = 0x63,
>  			.mask_ihl = 0x04,
> -			.addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
> +			.addr_stat_drdy = 0x67,
>  		},
>  		.multi_read_bit = false,
>  		.bootime = 2,


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property for LSM303AGR
  2017-08-16 17:02 ` [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property " Lorenzo Bianconi
@ 2017-08-17 14:48   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-08-17 14:48 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

On Wed, 16 Aug 2017 19:02:51 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> Remove IRQ active low support for LSM303AGR since the sensor does not
> support that capability for data-ready line
> 
> Fixes: a9fd053b56c6 (iio: st_sensors: support active-low interrupts)
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan
> ---
>  drivers/iio/magnetometer/st_magn_core.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index 039b0e94420a..cd89962f2de3 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -356,8 +356,6 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
>  		.drdy_irq = {
>  			.addr = 0x62,
>  			.mask_int1 = 0x01,
> -			.addr_ihl = 0x63,
> -			.mask_ihl = 0x04,
>  			.addr_stat_drdy = 0x67,
>  		},
>  		.multi_read_bit = false,


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] iio: magnetometer: add support to LIS2MDL
  2017-08-16 17:02 ` [PATCH 3/4] iio: magnetometer: add support to LIS2MDL Lorenzo Bianconi
@ 2017-08-17 14:52   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-08-17 14:52 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, linus.walleij, lorenzo.bianconi

On Wed, 16 Aug 2017 19:02:52 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> add support to STMicroelectronics LIS2MDL magnetometer in
> st_magn framework
> 
> http://www.st.com/resource/en/datasheet/lis2mdl.pdf
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
There was no dependency really between patches 1 and 2 (fixes) and the new
support.  I would have slightly preferred them as two series.

Anyhow, applied to the togreg branch of iio.git and pushed out as
testing.

Thanks,

Jonathan
> ---
>  drivers/iio/magnetometer/st_magn.h      | 1 +
>  drivers/iio/magnetometer/st_magn_core.c | 1 +
>  drivers/iio/magnetometer/st_magn_i2c.c  | 5 +++++
>  drivers/iio/magnetometer/st_magn_spi.c  | 5 +++++
>  4 files changed, 12 insertions(+)
> 
> diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h
> index 9daca4681922..8fe51ce427bd 100644
> --- a/drivers/iio/magnetometer/st_magn.h
> +++ b/drivers/iio/magnetometer/st_magn.h
> @@ -19,6 +19,7 @@
>  #define LSM303DLM_MAGN_DEV_NAME		"lsm303dlm_magn"
>  #define LIS3MDL_MAGN_DEV_NAME		"lis3mdl"
>  #define LSM303AGR_MAGN_DEV_NAME		"lsm303agr_magn"
> +#define LIS2MDL_MAGN_DEV_NAME		"lis2mdl"
>  
>  int st_magn_common_probe(struct iio_dev *indio_dev);
>  void st_magn_common_remove(struct iio_dev *indio_dev);
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index cd89962f2de3..e68368b5b2a3 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -323,6 +323,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
>  		.wai_addr = 0x4f,
>  		.sensors_supported = {
>  			[0] = LSM303AGR_MAGN_DEV_NAME,
> +			[1] = LIS2MDL_MAGN_DEV_NAME,
>  		},
>  		.ch = (struct iio_chan_spec *)st_magn_3_16bit_channels,
>  		.odr = {
> diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
> index 6a6c8121ac2c..feaa28cf6a77 100644
> --- a/drivers/iio/magnetometer/st_magn_i2c.c
> +++ b/drivers/iio/magnetometer/st_magn_i2c.c
> @@ -40,6 +40,10 @@ static const struct of_device_id st_magn_of_match[] = {
>  		.compatible = "st,lsm303agr-magn",
>  		.data = LSM303AGR_MAGN_DEV_NAME,
>  	},
> +	{
> +		.compatible = "st,lis2mdl",
> +		.data = LIS2MDL_MAGN_DEV_NAME,
> +	},
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, st_magn_of_match);
> @@ -85,6 +89,7 @@ static const struct i2c_device_id st_magn_id_table[] = {
>  	{ LSM303DLM_MAGN_DEV_NAME },
>  	{ LIS3MDL_MAGN_DEV_NAME },
>  	{ LSM303AGR_MAGN_DEV_NAME },
> +	{ LIS2MDL_MAGN_DEV_NAME },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(i2c, st_magn_id_table);
> diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
> index 1ea64dd318aa..7b7cd08fcc32 100644
> --- a/drivers/iio/magnetometer/st_magn_spi.c
> +++ b/drivers/iio/magnetometer/st_magn_spi.c
> @@ -33,6 +33,10 @@ static const struct of_device_id st_magn_of_match[] = {
>  		.compatible = "st,lsm303agr-magn",
>  		.data = LSM303AGR_MAGN_DEV_NAME,
>  	},
> +	{
> +		.compatible = "st,lis2mdl",
> +		.data = LIS2MDL_MAGN_DEV_NAME,
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, st_magn_of_match);
> @@ -74,6 +78,7 @@ static int st_magn_spi_remove(struct spi_device *spi)
>  static const struct spi_device_id st_magn_id_table[] = {
>  	{ LIS3MDL_MAGN_DEV_NAME },
>  	{ LSM303AGR_MAGN_DEV_NAME },
> +	{ LIS2MDL_MAGN_DEV_NAME },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(spi, st_magn_id_table);


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding
  2017-08-17  7:01   ` Lorenzo Bianconi
@ 2017-08-17 14:55     ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2017-08-17 14:55 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, Linus Walleij, Lorenzo BIANCONI, devicetree

On Thu, 17 Aug 2017 09:01:22 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> Added devicetree ml in cc
> 
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
I've applied this as it is about as trivial as you can get.
If one of the devicetree maintainers really wants to reply then feel free ;)

Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

Jonathan
> > ---
> >  Documentation/devicetree/bindings/iio/st-sensors.txt | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
> > index 1e305f61f3df..9ec6f5ce54fc 100644
> > --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> > +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
> > @@ -64,6 +64,7 @@ Magnetometers:
> >  - st,lsm303dlhc-magn
> >  - st,lsm303dlm-magn
> >  - st,lis3mdl-magn
> > +- st,lis2mdl
> >
> >  Pressure sensors:
> >  - st,lps001wp-press
> > --
> > 2.14.0
> >  


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-08-17 14:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 17:02 [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
2017-08-16 17:02 ` [PATCH 1/4] iio: magnetometer: st_magn: fix status register address for LSM303AGR Lorenzo Bianconi
2017-08-17 14:43   ` Jonathan Cameron
2017-08-16 17:02 ` [PATCH 2/4] iio: magnetometer: st_magn: remove ihl property " Lorenzo Bianconi
2017-08-17 14:48   ` Jonathan Cameron
2017-08-16 17:02 ` [PATCH 3/4] iio: magnetometer: add support to LIS2MDL Lorenzo Bianconi
2017-08-17 14:52   ` Jonathan Cameron
2017-08-16 17:02 ` [PATCH 4/4] dt-bindings: iio: magn: add LIS2MDL sensor device binding Lorenzo Bianconi
2017-08-17  7:01   ` Lorenzo Bianconi
2017-08-17 14:55     ` Jonathan Cameron
2017-08-16 18:52 ` [PATCH 0/4] Add support to LIS2MDL magnetometer sensor Lorenzo Bianconi
2017-08-16 23:21   ` Jonathan Cameron
2017-08-16 21:07 ` Linus Walleij

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).