All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] add support to LSM6DS3H and LSM6DSL
@ 2017-01-29 10:49 ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Lorenzo Bianconi (5):
  iio: imu: st_lsm6dsx: add support to multiple devices with the same
    settings
  iio: imu: st_lsm6dsx: add support to lsm6dsl
  Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device
    binding
  iio: imu: st_lsm6dsx: add support to lsm6ds3h
  Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device
    binding

 .../devicetree/bindings/iio/imu/st_lsm6dsx.txt     |  2 ++
 drivers/iio/imu/st_lsm6dsx/Kconfig                 |  2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h            |  7 +++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c     |  9 ++---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c       | 40 ++++++++++++++--------
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c        | 10 ++++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c        | 10 ++++++
 7 files changed, 59 insertions(+), 21 deletions(-)

-- 
2.9.3

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

* [PATCH 0/5] add support to LSM6DS3H and LSM6DSL
@ 2017-01-29 10:49 ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

Lorenzo Bianconi (5):
  iio: imu: st_lsm6dsx: add support to multiple devices with the same
    settings
  iio: imu: st_lsm6dsx: add support to lsm6dsl
  Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device
    binding
  iio: imu: st_lsm6dsx: add support to lsm6ds3h
  Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device
    binding

 .../devicetree/bindings/iio/imu/st_lsm6dsx.txt     |  2 ++
 drivers/iio/imu/st_lsm6dsx/Kconfig                 |  2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h            |  7 +++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c     |  9 ++---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c       | 40 ++++++++++++++--------
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c        | 10 ++++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c        | 10 ++++++
 7 files changed, 59 insertions(+), 21 deletions(-)

-- 
2.9.3

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

* [PATCH 1/5] iio: imu: st_lsm6dsx: add support to multiple devices with the same settings
  2017-01-29 10:49 ` Lorenzo Bianconi
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  -1 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Add capability to support multiple devices with the same
st_lsm6dsx_settings like LSM6DSM/LSM6DSL

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  3 ++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 30 +++++++++++++++-------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 69deafe..2c1bb9e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -20,6 +20,7 @@
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
 	ST_LSM6DSM_ID,
+	ST_LSM6DSX_MAX_ID,
 };
 
 #define ST_LSM6DSX_CHAN_SIZE		2
@@ -50,7 +51,7 @@ struct st_lsm6dsx_reg {
 struct st_lsm6dsx_settings {
 	u8 wai;
 	u16 max_fifo_size;
-	enum st_lsm6dsx_hw_id id;
+	enum st_lsm6dsx_hw_id id[ST_LSM6DSX_MAX_ID];
 };
 
 enum st_lsm6dsx_sensor_id {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index c92ddcc..499e60a 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -74,12 +74,6 @@
 #define ST_LSM6DSX_REG_GYRO_OUT_Y_L_ADDR	0x24
 #define ST_LSM6DSX_REG_GYRO_OUT_Z_L_ADDR	0x26
 
-#define ST_LSM6DS3_WHOAMI			0x69
-#define ST_LSM6DSM_WHOAMI			0x6a
-
-#define ST_LSM6DS3_MAX_FIFO_SIZE		8192
-#define ST_LSM6DSM_MAX_FIFO_SIZE		4096
-
 #define ST_LSM6DSX_ACC_FS_2G_GAIN		IIO_G_TO_M_S_2(61)
 #define ST_LSM6DSX_ACC_FS_4G_GAIN		IIO_G_TO_M_S_2(122)
 #define ST_LSM6DSX_ACC_FS_8G_GAIN		IIO_G_TO_M_S_2(244)
@@ -164,14 +158,18 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
 
 static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 	{
-		.wai = ST_LSM6DS3_WHOAMI,
-		.max_fifo_size = ST_LSM6DS3_MAX_FIFO_SIZE,
-		.id = ST_LSM6DS3_ID,
+		.wai = 0x69,
+		.max_fifo_size = 8192,
+		.id = {
+			[0] = ST_LSM6DS3_ID,
+		},
 	},
 	{
-		.wai = ST_LSM6DSM_WHOAMI,
-		.max_fifo_size = ST_LSM6DSM_MAX_FIFO_SIZE,
-		.id = ST_LSM6DSM_ID,
+		.wai = 0x6a,
+		.max_fifo_size = 4096,
+		.id = {
+			[0] = ST_LSM6DSM_ID,
+		},
 	},
 };
 
@@ -241,11 +239,15 @@ int st_lsm6dsx_write_with_mask(struct st_lsm6dsx_hw *hw, u8 addr, u8 mask,
 
 static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id)
 {
-	int err, i;
+	int err, i, j;
 	u8 data;
 
 	for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
-		if (id == st_lsm6dsx_sensor_settings[i].id)
+		for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
+			if (id == st_lsm6dsx_sensor_settings[i].id[j])
+				break;
+		}
+		if (j < ST_LSM6DSX_MAX_ID)
 			break;
 	}
 
-- 
2.9.3

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

* [PATCH 1/5] iio: imu: st_lsm6dsx: add support to multiple devices with the same settings
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

Add capability to support multiple devices with the same
st_lsm6dsx_settings like LSM6DSM/LSM6DSL

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  3 ++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 30 +++++++++++++++-------------
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 69deafe..2c1bb9e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -20,6 +20,7 @@
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
 	ST_LSM6DSM_ID,
+	ST_LSM6DSX_MAX_ID,
 };
 
 #define ST_LSM6DSX_CHAN_SIZE		2
@@ -50,7 +51,7 @@ struct st_lsm6dsx_reg {
 struct st_lsm6dsx_settings {
 	u8 wai;
 	u16 max_fifo_size;
-	enum st_lsm6dsx_hw_id id;
+	enum st_lsm6dsx_hw_id id[ST_LSM6DSX_MAX_ID];
 };
 
 enum st_lsm6dsx_sensor_id {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index c92ddcc..499e60a 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -74,12 +74,6 @@
 #define ST_LSM6DSX_REG_GYRO_OUT_Y_L_ADDR	0x24
 #define ST_LSM6DSX_REG_GYRO_OUT_Z_L_ADDR	0x26
 
-#define ST_LSM6DS3_WHOAMI			0x69
-#define ST_LSM6DSM_WHOAMI			0x6a
-
-#define ST_LSM6DS3_MAX_FIFO_SIZE		8192
-#define ST_LSM6DSM_MAX_FIFO_SIZE		4096
-
 #define ST_LSM6DSX_ACC_FS_2G_GAIN		IIO_G_TO_M_S_2(61)
 #define ST_LSM6DSX_ACC_FS_4G_GAIN		IIO_G_TO_M_S_2(122)
 #define ST_LSM6DSX_ACC_FS_8G_GAIN		IIO_G_TO_M_S_2(244)
@@ -164,14 +158,18 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
 
 static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 	{
-		.wai = ST_LSM6DS3_WHOAMI,
-		.max_fifo_size = ST_LSM6DS3_MAX_FIFO_SIZE,
-		.id = ST_LSM6DS3_ID,
+		.wai = 0x69,
+		.max_fifo_size = 8192,
+		.id = {
+			[0] = ST_LSM6DS3_ID,
+		},
 	},
 	{
-		.wai = ST_LSM6DSM_WHOAMI,
-		.max_fifo_size = ST_LSM6DSM_MAX_FIFO_SIZE,
-		.id = ST_LSM6DSM_ID,
+		.wai = 0x6a,
+		.max_fifo_size = 4096,
+		.id = {
+			[0] = ST_LSM6DSM_ID,
+		},
 	},
 };
 
@@ -241,11 +239,15 @@ int st_lsm6dsx_write_with_mask(struct st_lsm6dsx_hw *hw, u8 addr, u8 mask,
 
 static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id)
 {
-	int err, i;
+	int err, i, j;
 	u8 data;
 
 	for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
-		if (id == st_lsm6dsx_sensor_settings[i].id)
+		for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
+			if (id == st_lsm6dsx_sensor_settings[i].id[j])
+				break;
+		}
+		if (j < ST_LSM6DSX_MAX_ID)
 			break;
 	}
 
-- 
2.9.3

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

* [PATCH 2/5] iio: imu: st_lsm6dsx: add support to lsm6dsl
  2017-01-29 10:49 ` Lorenzo Bianconi
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  -1 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 5 +++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
 6 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index 935d4cd0..d264783 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
 	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
 	help
 	  Say yes here to build support for STMicroelectronics LSM6DSx imu
-	  sensor. Supported devices: lsm6ds3, lsm6dsm
+	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm6dsx.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 2c1bb9e..e0ece13 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -15,10 +15,12 @@
 #include <linux/device.h>
 
 #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
+#define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
 #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
+	ST_LSM6DSL_ID,
 	ST_LSM6DSM_ID,
 	ST_LSM6DSX_MAX_ID,
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 78532ce..73a6492e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -1,7 +1,7 @@
 /*
  * STMicroelectronics st_lsm6dsx FIFO buffer library driver
  *
- * LSM6DS3/LSM6DSM: The FIFO buffer can be configured to store data
+ * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
  * from gyroscope and accelerometer. Samples are queued without any tag
  * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
  *  - 1st data set is reserved for gyroscope data
@@ -206,7 +206,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
 }
 
 /**
- * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSM read FIFO routine
+ * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
  * @hw: Pointer to instance of struct st_lsm6dsx_hw.
  *
  * Read samples from the hw FIFO and push them to IIO buffers.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 499e60a..5d8d5cd 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -17,7 +17,7 @@
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 8KB
  *
- * - LSM6DSM:
+ * - LSM6DSL/LSM6DSM:
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
@@ -168,7 +168,8 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 		.wai = 0x6a,
 		.max_fifo_size = 4096,
 		.id = {
-			[0] = ST_LSM6DSM_ID,
+			[0] = ST_LSM6DSL_ID,
+			[1] = ST_LSM6DSM_ID,
 		},
 	},
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index ea30411..60a3de0 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6dsl",
+		.data = (void *)ST_LSM6DSL_ID,
+	},
+	{
 		.compatible = "st,lsm6dsm",
 		.data = (void *)ST_LSM6DSM_ID,
 	},
@@ -80,6 +84,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 
 static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
index fbe7247..39edb40 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6dsl",
+		.data = (void *)ST_LSM6DSL_ID,
+	},
+	{
 		.compatible = "st,lsm6dsm",
 		.data = (void *)ST_LSM6DSM_ID,
 	},
@@ -97,6 +101,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
 
 static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
 };
-- 
2.9.3

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

* [PATCH 2/5] iio: imu: st_lsm6dsx: add support to lsm6dsl
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 5 +++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
 6 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index 935d4cd0..d264783 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
 	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
 	help
 	  Say yes here to build support for STMicroelectronics LSM6DSx imu
-	  sensor. Supported devices: lsm6ds3, lsm6dsm
+	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm6dsx.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 2c1bb9e..e0ece13 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -15,10 +15,12 @@
 #include <linux/device.h>
 
 #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
+#define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
 #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
+	ST_LSM6DSL_ID,
 	ST_LSM6DSM_ID,
 	ST_LSM6DSX_MAX_ID,
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 78532ce..73a6492e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -1,7 +1,7 @@
 /*
  * STMicroelectronics st_lsm6dsx FIFO buffer library driver
  *
- * LSM6DS3/LSM6DSM: The FIFO buffer can be configured to store data
+ * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
  * from gyroscope and accelerometer. Samples are queued without any tag
  * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
  *  - 1st data set is reserved for gyroscope data
@@ -206,7 +206,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
 }
 
 /**
- * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSM read FIFO routine
+ * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
  * @hw: Pointer to instance of struct st_lsm6dsx_hw.
  *
  * Read samples from the hw FIFO and push them to IIO buffers.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 499e60a..5d8d5cd 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -17,7 +17,7 @@
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 8KB
  *
- * - LSM6DSM:
+ * - LSM6DSL/LSM6DSM:
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
@@ -168,7 +168,8 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 		.wai = 0x6a,
 		.max_fifo_size = 4096,
 		.id = {
-			[0] = ST_LSM6DSM_ID,
+			[0] = ST_LSM6DSL_ID,
+			[1] = ST_LSM6DSM_ID,
 		},
 	},
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index ea30411..60a3de0 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6dsl",
+		.data = (void *)ST_LSM6DSL_ID,
+	},
+	{
 		.compatible = "st,lsm6dsm",
 		.data = (void *)ST_LSM6DSM_ID,
 	},
@@ -80,6 +84,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 
 static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
 };
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
index fbe7247..39edb40 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6dsl",
+		.data = (void *)ST_LSM6DSL_ID,
+	},
+	{
 		.compatible = "st,lsm6dsm",
 		.data = (void *)ST_LSM6DSM_ID,
 	},
@@ -97,6 +101,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
 
 static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
 };
-- 
2.9.3


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

* [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
  2017-01-29 10:49 ` Lorenzo Bianconi
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  -1 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
index cf81afd..048eca7 100644
--- a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
+++ b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
@@ -3,6 +3,7 @@
 Required properties:
 - compatible: must be one of:
   "st,lsm6ds3"
+  "st,lsm6dsl"
   "st,lsm6dsm"
 - reg: i2c address of the sensor / spi cs line
 
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

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

diff --git a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
index cf81afd..048eca7 100644
--- a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
+++ b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
@@ -3,6 +3,7 @@
 Required properties:
 - compatible: must be one of:
   "st,lsm6ds3"
+  "st,lsm6dsl"
   "st,lsm6dsm"
 - reg: i2c address of the sensor / spi cs line
 
-- 
2.9.3


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

* [PATCH 4/5] iio: imu: st_lsm6dsx: add support to lsm6ds3h
  2017-01-29 10:49 ` Lorenzo Bianconi
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  -1 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +++++----
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 9 ++++++++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
 6 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index d264783..e573371 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
 	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
 	help
 	  Say yes here to build support for STMicroelectronics LSM6DSx imu
-	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
+	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm6dsx.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index e0ece13..6a9849e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -15,11 +15,13 @@
 #include <linux/device.h>
 
 #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
+#define ST_LSM6DS3H_DEV_NAME	"lsm6ds3h"
 #define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
 #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
+	ST_LSM6DS3H_ID,
 	ST_LSM6DSL_ID,
 	ST_LSM6DSM_ID,
 	ST_LSM6DSX_MAX_ID,
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 73a6492e..e71ecce 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -1,9 +1,10 @@
 /*
  * STMicroelectronics st_lsm6dsx FIFO buffer library driver
  *
- * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
- * from gyroscope and accelerometer. Samples are queued without any tag
- * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
+ * LSM6DS3/LSM6DS3H/LSM6DSL/LSM6DSM: The FIFO buffer can be configured
+ * to store data from gyroscope and accelerometer. Samples are queued
+ * without any tag according to a specific pattern based on 'FIFO data sets'
+ * (6 bytes each):
  *  - 1st data set is reserved for gyroscope data
  *  - 2nd data set is reserved for accelerometer data
  * The FIFO pattern changes depending on the ODRs and decimation factors
@@ -206,7 +207,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
 }
 
 /**
- * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
+ * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DS3H-LSM6DSL-LSM6DSM read FIFO routine
  * @hw: Pointer to instance of struct st_lsm6dsx_hw.
  *
  * Read samples from the hw FIFO and push them to IIO buffers.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 5d8d5cd..c433223 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -17,7 +17,7 @@
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 8KB
  *
- * - LSM6DSL/LSM6DSM:
+ * - LSM6DS3H/LSM6DSL/LSM6DSM:
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
@@ -165,6 +165,13 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 		},
 	},
 	{
+		.wai = 0x69,
+		.max_fifo_size = 4096,
+		.id = {
+			[0] = ST_LSM6DS3H_ID,
+		},
+	},
+	{
 		.wai = 0x6a,
 		.max_fifo_size = 4096,
 		.id = {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index 60a3de0..2e4ed26 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6ds3h",
+		.data = (void *)ST_LSM6DS3H_ID,
+	},
+	{
 		.compatible = "st,lsm6dsl",
 		.data = (void *)ST_LSM6DSL_ID,
 	},
@@ -84,6 +88,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 
 static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
 	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
index 39edb40..1bf4a58 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6ds3h",
+		.data = (void *)ST_LSM6DS3H_ID,
+	},
+	{
 		.compatible = "st,lsm6dsl",
 		.data = (void *)ST_LSM6DSL_ID,
 	},
@@ -101,6 +105,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
 
 static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
 	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 4/5] iio: imu: st_lsm6dsx: add support to lsm6ds3h
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
---
 drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +++++----
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 9 ++++++++-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
 6 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
index d264783..e573371 100644
--- a/drivers/iio/imu/st_lsm6dsx/Kconfig
+++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
@@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
 	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
 	help
 	  Say yes here to build support for STMicroelectronics LSM6DSx imu
-	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
+	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm6dsx.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index e0ece13..6a9849e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -15,11 +15,13 @@
 #include <linux/device.h>
 
 #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
+#define ST_LSM6DS3H_DEV_NAME	"lsm6ds3h"
 #define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
 #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
 
 enum st_lsm6dsx_hw_id {
 	ST_LSM6DS3_ID,
+	ST_LSM6DS3H_ID,
 	ST_LSM6DSL_ID,
 	ST_LSM6DSM_ID,
 	ST_LSM6DSX_MAX_ID,
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 73a6492e..e71ecce 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -1,9 +1,10 @@
 /*
  * STMicroelectronics st_lsm6dsx FIFO buffer library driver
  *
- * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
- * from gyroscope and accelerometer. Samples are queued without any tag
- * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
+ * LSM6DS3/LSM6DS3H/LSM6DSL/LSM6DSM: The FIFO buffer can be configured
+ * to store data from gyroscope and accelerometer. Samples are queued
+ * without any tag according to a specific pattern based on 'FIFO data sets'
+ * (6 bytes each):
  *  - 1st data set is reserved for gyroscope data
  *  - 2nd data set is reserved for accelerometer data
  * The FIFO pattern changes depending on the ODRs and decimation factors
@@ -206,7 +207,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
 }
 
 /**
- * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
+ * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DS3H-LSM6DSL-LSM6DSM read FIFO routine
  * @hw: Pointer to instance of struct st_lsm6dsx_hw.
  *
  * Read samples from the hw FIFO and push them to IIO buffers.
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index 5d8d5cd..c433223 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -17,7 +17,7 @@
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
  *   - FIFO size: 8KB
  *
- * - LSM6DSL/LSM6DSM:
+ * - LSM6DS3H/LSM6DSL/LSM6DSM:
  *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
  *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
  *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
@@ -165,6 +165,13 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
 		},
 	},
 	{
+		.wai = 0x69,
+		.max_fifo_size = 4096,
+		.id = {
+			[0] = ST_LSM6DS3H_ID,
+		},
+	},
+	{
 		.wai = 0x6a,
 		.max_fifo_size = 4096,
 		.id = {
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
index 60a3de0..2e4ed26 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
@@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6ds3h",
+		.data = (void *)ST_LSM6DS3H_ID,
+	},
+	{
 		.compatible = "st,lsm6dsl",
 		.data = (void *)ST_LSM6DSL_ID,
 	},
@@ -84,6 +88,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
 
 static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
 	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
index 39edb40..1bf4a58 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
@@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
 		.data = (void *)ST_LSM6DS3_ID,
 	},
 	{
+		.compatible = "st,lsm6ds3h",
+		.data = (void *)ST_LSM6DS3H_ID,
+	},
+	{
 		.compatible = "st,lsm6dsl",
 		.data = (void *)ST_LSM6DSL_ID,
 	},
@@ -101,6 +105,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
 
 static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
 	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
+	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
 	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
 	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
 	{},
-- 
2.9.3


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

* [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
  2017-01-29 10:49 ` Lorenzo Bianconi
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  -1 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23-DgEjT+Ai2ygdnm+yROfE0A
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
---
 Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
index 048eca7..8305fb0 100644
--- a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
+++ b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
@@ -3,6 +3,7 @@
 Required properties:
 - compatible: must be one of:
   "st,lsm6ds3"
+  "st,lsm6ds3h"
   "st,lsm6dsl"
   "st,lsm6dsm"
 - reg: i2c address of the sensor / spi cs line
-- 
2.9.3

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

* [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
@ 2017-01-29 10:49     ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2017-01-29 10:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, devicetree, lorenzo.bianconi

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

diff --git a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
index 048eca7..8305fb0 100644
--- a/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
+++ b/Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
@@ -3,6 +3,7 @@
 Required properties:
 - compatible: must be one of:
   "st,lsm6ds3"
+  "st,lsm6ds3h"
   "st,lsm6dsl"
   "st,lsm6dsm"
 - reg: i2c address of the sensor / spi cs line
-- 
2.9.3


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

* Re: [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
  2017-01-29 10:49     ` Lorenzo Bianconi
@ 2017-02-01 16:04         ` Rob Herring
  -1 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2017-02-01 16:04 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: jic23-DgEjT+Ai2ygdnm+yROfE0A, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On Sun, Jan 29, 2017 at 11:49:26AM +0100, Lorenzo Bianconi wrote:
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
@ 2017-02-01 16:04         ` Rob Herring
  0 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2017-02-01 16:04 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: jic23, linux-iio, devicetree, lorenzo.bianconi

On Sun, Jan 29, 2017 at 11:49:26AM +0100, Lorenzo Bianconi wrote:
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
> ---
>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
  2017-01-29 10:49     ` Lorenzo Bianconi
@ 2017-02-01 16:06         ` Rob Herring
  -1 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2017-02-01 16:06 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: jic23-DgEjT+Ai2ygdnm+yROfE0A, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On Sun, Jan 29, 2017 at 11:49:28AM +0100, Lorenzo Bianconi wrote:
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>  1 file changed, 1 insertion(+)

This could be combined with patch 3.

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

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

* Re: [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
@ 2017-02-01 16:06         ` Rob Herring
  0 siblings, 0 replies; 26+ messages in thread
From: Rob Herring @ 2017-02-01 16:06 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: jic23, linux-iio, devicetree, lorenzo.bianconi

On Sun, Jan 29, 2017 at 11:49:28AM +0100, Lorenzo Bianconi wrote:
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
> ---
>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>  1 file changed, 1 insertion(+)

This could be combined with patch 3.

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/5] iio: imu: st_lsm6dsx: add support to multiple devices with the same settings
  2017-01-29 10:49     ` Lorenzo Bianconi
@ 2017-02-04 12:23         ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:23 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add capability to support multiple devices with the same
> st_lsm6dsx_settings like LSM6DSM/LSM6DSL
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders
to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  3 ++-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 30 +++++++++++++++-------------
>  2 files changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index 69deafe..2c1bb9e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -20,6 +20,7 @@
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
>  	ST_LSM6DSM_ID,
> +	ST_LSM6DSX_MAX_ID,
>  };
>  
>  #define ST_LSM6DSX_CHAN_SIZE		2
> @@ -50,7 +51,7 @@ struct st_lsm6dsx_reg {
>  struct st_lsm6dsx_settings {
>  	u8 wai;
>  	u16 max_fifo_size;
> -	enum st_lsm6dsx_hw_id id;
> +	enum st_lsm6dsx_hw_id id[ST_LSM6DSX_MAX_ID];
>  };
>  
>  enum st_lsm6dsx_sensor_id {
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index c92ddcc..499e60a 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -74,12 +74,6 @@
>  #define ST_LSM6DSX_REG_GYRO_OUT_Y_L_ADDR	0x24
>  #define ST_LSM6DSX_REG_GYRO_OUT_Z_L_ADDR	0x26
>  
> -#define ST_LSM6DS3_WHOAMI			0x69
> -#define ST_LSM6DSM_WHOAMI			0x6a
> -
> -#define ST_LSM6DS3_MAX_FIFO_SIZE		8192
> -#define ST_LSM6DSM_MAX_FIFO_SIZE		4096
> -
>  #define ST_LSM6DSX_ACC_FS_2G_GAIN		IIO_G_TO_M_S_2(61)
>  #define ST_LSM6DSX_ACC_FS_4G_GAIN		IIO_G_TO_M_S_2(122)
>  #define ST_LSM6DSX_ACC_FS_8G_GAIN		IIO_G_TO_M_S_2(244)
> @@ -164,14 +158,18 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
>  
>  static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  	{
> -		.wai = ST_LSM6DS3_WHOAMI,
> -		.max_fifo_size = ST_LSM6DS3_MAX_FIFO_SIZE,
> -		.id = ST_LSM6DS3_ID,
> +		.wai = 0x69,
> +		.max_fifo_size = 8192,
> +		.id = {
> +			[0] = ST_LSM6DS3_ID,
> +		},
>  	},
>  	{
> -		.wai = ST_LSM6DSM_WHOAMI,
> -		.max_fifo_size = ST_LSM6DSM_MAX_FIFO_SIZE,
> -		.id = ST_LSM6DSM_ID,
> +		.wai = 0x6a,
> +		.max_fifo_size = 4096,
> +		.id = {
> +			[0] = ST_LSM6DSM_ID,
> +		},
>  	},
>  };
>  
> @@ -241,11 +239,15 @@ int st_lsm6dsx_write_with_mask(struct st_lsm6dsx_hw *hw, u8 addr, u8 mask,
>  
>  static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id)
>  {
> -	int err, i;
> +	int err, i, j;
>  	u8 data;
>  
>  	for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
> -		if (id == st_lsm6dsx_sensor_settings[i].id)
> +		for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
> +			if (id == st_lsm6dsx_sensor_settings[i].id[j])
> +				break;
> +		}
> +		if (j < ST_LSM6DSX_MAX_ID)
>  			break;
>  	}
>  
> 

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

* Re: [PATCH 1/5] iio: imu: st_lsm6dsx: add support to multiple devices with the same settings
@ 2017-02-04 12:23         ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:23 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, devicetree, lorenzo.bianconi

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add capability to support multiple devices with the same
> st_lsm6dsx_settings like LSM6DSM/LSM6DSL
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders
to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  3 ++-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 30 +++++++++++++++-------------
>  2 files changed, 18 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index 69deafe..2c1bb9e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -20,6 +20,7 @@
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
>  	ST_LSM6DSM_ID,
> +	ST_LSM6DSX_MAX_ID,
>  };
>  
>  #define ST_LSM6DSX_CHAN_SIZE		2
> @@ -50,7 +51,7 @@ struct st_lsm6dsx_reg {
>  struct st_lsm6dsx_settings {
>  	u8 wai;
>  	u16 max_fifo_size;
> -	enum st_lsm6dsx_hw_id id;
> +	enum st_lsm6dsx_hw_id id[ST_LSM6DSX_MAX_ID];
>  };
>  
>  enum st_lsm6dsx_sensor_id {
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index c92ddcc..499e60a 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -74,12 +74,6 @@
>  #define ST_LSM6DSX_REG_GYRO_OUT_Y_L_ADDR	0x24
>  #define ST_LSM6DSX_REG_GYRO_OUT_Z_L_ADDR	0x26
>  
> -#define ST_LSM6DS3_WHOAMI			0x69
> -#define ST_LSM6DSM_WHOAMI			0x6a
> -
> -#define ST_LSM6DS3_MAX_FIFO_SIZE		8192
> -#define ST_LSM6DSM_MAX_FIFO_SIZE		4096
> -
>  #define ST_LSM6DSX_ACC_FS_2G_GAIN		IIO_G_TO_M_S_2(61)
>  #define ST_LSM6DSX_ACC_FS_4G_GAIN		IIO_G_TO_M_S_2(122)
>  #define ST_LSM6DSX_ACC_FS_8G_GAIN		IIO_G_TO_M_S_2(244)
> @@ -164,14 +158,18 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
>  
>  static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  	{
> -		.wai = ST_LSM6DS3_WHOAMI,
> -		.max_fifo_size = ST_LSM6DS3_MAX_FIFO_SIZE,
> -		.id = ST_LSM6DS3_ID,
> +		.wai = 0x69,
> +		.max_fifo_size = 8192,
> +		.id = {
> +			[0] = ST_LSM6DS3_ID,
> +		},
>  	},
>  	{
> -		.wai = ST_LSM6DSM_WHOAMI,
> -		.max_fifo_size = ST_LSM6DSM_MAX_FIFO_SIZE,
> -		.id = ST_LSM6DSM_ID,
> +		.wai = 0x6a,
> +		.max_fifo_size = 4096,
> +		.id = {
> +			[0] = ST_LSM6DSM_ID,
> +		},
>  	},
>  };
>  
> @@ -241,11 +239,15 @@ int st_lsm6dsx_write_with_mask(struct st_lsm6dsx_hw *hw, u8 addr, u8 mask,
>  
>  static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id)
>  {
> -	int err, i;
> +	int err, i, j;
>  	u8 data;
>  
>  	for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
> -		if (id == st_lsm6dsx_sensor_settings[i].id)
> +		for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
> +			if (id == st_lsm6dsx_sensor_settings[i].id[j])
> +				break;
> +		}
> +		if (j < ST_LSM6DSX_MAX_ID)
>  			break;
>  	}
>  
> 


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

* Re: [PATCH 2/5] iio: imu: st_lsm6dsx: add support to lsm6dsl
  2017-01-29 10:49     ` Lorenzo Bianconi
@ 2017-02-04 12:24         ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:24 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor
> 
> http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 5 +++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
>  6 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
> index 935d4cd0..d264783 100644
> --- a/drivers/iio/imu/st_lsm6dsx/Kconfig
> +++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
> @@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
>  	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
>  	help
>  	  Say yes here to build support for STMicroelectronics LSM6DSx imu
> -	  sensor. Supported devices: lsm6ds3, lsm6dsm
> +	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
>  
>  	  To compile this driver as a module, choose M here: the module
>  	  will be called st_lsm6dsx.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index 2c1bb9e..e0ece13 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -15,10 +15,12 @@
>  #include <linux/device.h>
>  
>  #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
> +#define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
>  #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
>  
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
> +	ST_LSM6DSL_ID,
>  	ST_LSM6DSM_ID,
>  	ST_LSM6DSX_MAX_ID,
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 78532ce..73a6492e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -1,7 +1,7 @@
>  /*
>   * STMicroelectronics st_lsm6dsx FIFO buffer library driver
>   *
> - * LSM6DS3/LSM6DSM: The FIFO buffer can be configured to store data
> + * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
>   * from gyroscope and accelerometer. Samples are queued without any tag
>   * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
>   *  - 1st data set is reserved for gyroscope data
> @@ -206,7 +206,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
>  }
>  
>  /**
> - * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSM read FIFO routine
> + * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
>   * @hw: Pointer to instance of struct st_lsm6dsx_hw.
>   *
>   * Read samples from the hw FIFO and push them to IIO buffers.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index 499e60a..5d8d5cd 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -17,7 +17,7 @@
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
>   *   - FIFO size: 8KB
>   *
> - * - LSM6DSM:
> + * - LSM6DSL/LSM6DSM:
>   *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
>   *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
> @@ -168,7 +168,8 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  		.wai = 0x6a,
>  		.max_fifo_size = 4096,
>  		.id = {
> -			[0] = ST_LSM6DSM_ID,
> +			[0] = ST_LSM6DSL_ID,
> +			[1] = ST_LSM6DSM_ID,
>  		},
>  	},
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> index ea30411..60a3de0 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> @@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6dsl",
> +		.data = (void *)ST_LSM6DSL_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsm",
>  		.data = (void *)ST_LSM6DSM_ID,
>  	},
> @@ -80,6 +84,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
>  
>  static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> index fbe7247..39edb40 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> @@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6dsl",
> +		.data = (void *)ST_LSM6DSL_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsm",
>  		.data = (void *)ST_LSM6DSM_ID,
>  	},
> @@ -97,6 +101,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
>  
>  static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
>  };
> 

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

* Re: [PATCH 2/5] iio: imu: st_lsm6dsx: add support to lsm6dsl
@ 2017-02-04 12:24         ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:24 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, devicetree, lorenzo.bianconi

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add support to STM LSM6DSL 6-axis (acc + gyro) Mems sensor
> 
> http://www.st.com/resource/en/datasheet/lsm6dsl.pdf
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 5 +++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
>  6 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
> index 935d4cd0..d264783 100644
> --- a/drivers/iio/imu/st_lsm6dsx/Kconfig
> +++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
> @@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
>  	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
>  	help
>  	  Say yes here to build support for STMicroelectronics LSM6DSx imu
> -	  sensor. Supported devices: lsm6ds3, lsm6dsm
> +	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
>  
>  	  To compile this driver as a module, choose M here: the module
>  	  will be called st_lsm6dsx.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index 2c1bb9e..e0ece13 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -15,10 +15,12 @@
>  #include <linux/device.h>
>  
>  #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
> +#define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
>  #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
>  
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
> +	ST_LSM6DSL_ID,
>  	ST_LSM6DSM_ID,
>  	ST_LSM6DSX_MAX_ID,
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 78532ce..73a6492e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -1,7 +1,7 @@
>  /*
>   * STMicroelectronics st_lsm6dsx FIFO buffer library driver
>   *
> - * LSM6DS3/LSM6DSM: The FIFO buffer can be configured to store data
> + * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
>   * from gyroscope and accelerometer. Samples are queued without any tag
>   * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
>   *  - 1st data set is reserved for gyroscope data
> @@ -206,7 +206,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
>  }
>  
>  /**
> - * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSM read FIFO routine
> + * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
>   * @hw: Pointer to instance of struct st_lsm6dsx_hw.
>   *
>   * Read samples from the hw FIFO and push them to IIO buffers.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index 499e60a..5d8d5cd 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -17,7 +17,7 @@
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
>   *   - FIFO size: 8KB
>   *
> - * - LSM6DSM:
> + * - LSM6DSL/LSM6DSM:
>   *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
>   *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
> @@ -168,7 +168,8 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  		.wai = 0x6a,
>  		.max_fifo_size = 4096,
>  		.id = {
> -			[0] = ST_LSM6DSM_ID,
> +			[0] = ST_LSM6DSL_ID,
> +			[1] = ST_LSM6DSM_ID,
>  		},
>  	},
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> index ea30411..60a3de0 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> @@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6dsl",
> +		.data = (void *)ST_LSM6DSL_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsm",
>  		.data = (void *)ST_LSM6DSM_ID,
>  	},
> @@ -80,6 +84,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
>  
>  static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
>  };
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> index fbe7247..39edb40 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> @@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6dsl",
> +		.data = (void *)ST_LSM6DSL_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsm",
>  		.data = (void *)ST_LSM6DSM_ID,
>  	},
> @@ -97,6 +101,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
>  
>  static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
>  };
> 


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

* Re: [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
  2017-02-01 16:04         ` Rob Herring
@ 2017-02-04 12:24           ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:24 UTC (permalink / raw)
  To: Rob Herring, Lorenzo Bianconi
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On 01/02/17 16:04, Rob Herring wrote:
> On Sun, Jan 29, 2017 at 11:49:26AM +0100, Lorenzo Bianconi wrote:
>> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
>> ---
>>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>>  1 file changed, 1 insertion(+)
> 
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 
Applied.

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

* Re: [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding
@ 2017-02-04 12:24           ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:24 UTC (permalink / raw)
  To: Rob Herring, Lorenzo Bianconi; +Cc: linux-iio, devicetree, lorenzo.bianconi

On 01/02/17 16:04, Rob Herring wrote:
> On Sun, Jan 29, 2017 at 11:49:26AM +0100, Lorenzo Bianconi wrote:
>> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
>> ---
>>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>>  1 file changed, 1 insertion(+)
> 
> Acked-by: Rob Herring <robh@kernel.org>
> 
Applied.

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

* Re: [PATCH 4/5] iio: imu: st_lsm6dsx: add support to lsm6ds3h
  2017-01-29 10:49     ` Lorenzo Bianconi
@ 2017-02-04 12:25         ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:25 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor
> 
> http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
Applied.
> ---
>  drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +++++----
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 9 ++++++++-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
>  6 files changed, 26 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
> index d264783..e573371 100644
> --- a/drivers/iio/imu/st_lsm6dsx/Kconfig
> +++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
> @@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
>  	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
>  	help
>  	  Say yes here to build support for STMicroelectronics LSM6DSx imu
> -	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
> +	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm
>  
>  	  To compile this driver as a module, choose M here: the module
>  	  will be called st_lsm6dsx.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index e0ece13..6a9849e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -15,11 +15,13 @@
>  #include <linux/device.h>
>  
>  #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
> +#define ST_LSM6DS3H_DEV_NAME	"lsm6ds3h"
>  #define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
>  #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
>  
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
> +	ST_LSM6DS3H_ID,
>  	ST_LSM6DSL_ID,
>  	ST_LSM6DSM_ID,
>  	ST_LSM6DSX_MAX_ID,
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 73a6492e..e71ecce 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -1,9 +1,10 @@
>  /*
>   * STMicroelectronics st_lsm6dsx FIFO buffer library driver
>   *
> - * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
> - * from gyroscope and accelerometer. Samples are queued without any tag
> - * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
> + * LSM6DS3/LSM6DS3H/LSM6DSL/LSM6DSM: The FIFO buffer can be configured
> + * to store data from gyroscope and accelerometer. Samples are queued
> + * without any tag according to a specific pattern based on 'FIFO data sets'
> + * (6 bytes each):
>   *  - 1st data set is reserved for gyroscope data
>   *  - 2nd data set is reserved for accelerometer data
>   * The FIFO pattern changes depending on the ODRs and decimation factors
> @@ -206,7 +207,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
>  }
>  
>  /**
> - * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
> + * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DS3H-LSM6DSL-LSM6DSM read FIFO routine
>   * @hw: Pointer to instance of struct st_lsm6dsx_hw.
>   *
>   * Read samples from the hw FIFO and push them to IIO buffers.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index 5d8d5cd..c433223 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -17,7 +17,7 @@
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
>   *   - FIFO size: 8KB
>   *
> - * - LSM6DSL/LSM6DSM:
> + * - LSM6DS3H/LSM6DSL/LSM6DSM:
>   *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
>   *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
> @@ -165,6 +165,13 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  		},
>  	},
>  	{
> +		.wai = 0x69,
> +		.max_fifo_size = 4096,
> +		.id = {
> +			[0] = ST_LSM6DS3H_ID,
> +		},
> +	},
> +	{
>  		.wai = 0x6a,
>  		.max_fifo_size = 4096,
>  		.id = {
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> index 60a3de0..2e4ed26 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> @@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6ds3h",
> +		.data = (void *)ST_LSM6DS3H_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsl",
>  		.data = (void *)ST_LSM6DSL_ID,
>  	},
> @@ -84,6 +88,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
>  
>  static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
>  	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> index 39edb40..1bf4a58 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> @@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6ds3h",
> +		.data = (void *)ST_LSM6DS3H_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsl",
>  		.data = (void *)ST_LSM6DSL_ID,
>  	},
> @@ -101,6 +105,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
>  
>  static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
>  	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 4/5] iio: imu: st_lsm6dsx: add support to lsm6ds3h
@ 2017-02-04 12:25         ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:25 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-iio, devicetree, lorenzo.bianconi

On 29/01/17 10:49, Lorenzo Bianconi wrote:
> Add support to STM LSM6DS3H 6-axis (acc + gyro) Mems sensor
> 
> http://www.st.com/resource/en/datasheet/lsm6ds3h.pdf
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Applied.
> ---
>  drivers/iio/imu/st_lsm6dsx/Kconfig             | 2 +-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 9 +++++----
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   | 9 ++++++++-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c    | 5 +++++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c    | 5 +++++
>  6 files changed, 26 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
> index d264783..e573371 100644
> --- a/drivers/iio/imu/st_lsm6dsx/Kconfig
> +++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
> @@ -8,7 +8,7 @@ config IIO_ST_LSM6DSX
>  	select IIO_ST_LSM6DSX_SPI if (SPI_MASTER)
>  	help
>  	  Say yes here to build support for STMicroelectronics LSM6DSx imu
> -	  sensor. Supported devices: lsm6ds3, lsm6dsl, lsm6dsm
> +	  sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm
>  
>  	  To compile this driver as a module, choose M here: the module
>  	  will be called st_lsm6dsx.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index e0ece13..6a9849e 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -15,11 +15,13 @@
>  #include <linux/device.h>
>  
>  #define ST_LSM6DS3_DEV_NAME	"lsm6ds3"
> +#define ST_LSM6DS3H_DEV_NAME	"lsm6ds3h"
>  #define ST_LSM6DSL_DEV_NAME	"lsm6dsl"
>  #define ST_LSM6DSM_DEV_NAME	"lsm6dsm"
>  
>  enum st_lsm6dsx_hw_id {
>  	ST_LSM6DS3_ID,
> +	ST_LSM6DS3H_ID,
>  	ST_LSM6DSL_ID,
>  	ST_LSM6DSM_ID,
>  	ST_LSM6DSX_MAX_ID,
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> index 73a6492e..e71ecce 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> @@ -1,9 +1,10 @@
>  /*
>   * STMicroelectronics st_lsm6dsx FIFO buffer library driver
>   *
> - * LSM6DS3/LSM6DSL/LSM6DSM: The FIFO buffer can be configured to store data
> - * from gyroscope and accelerometer. Samples are queued without any tag
> - * according to a specific pattern based on 'FIFO data sets' (6 bytes each):
> + * LSM6DS3/LSM6DS3H/LSM6DSL/LSM6DSM: The FIFO buffer can be configured
> + * to store data from gyroscope and accelerometer. Samples are queued
> + * without any tag according to a specific pattern based on 'FIFO data sets'
> + * (6 bytes each):
>   *  - 1st data set is reserved for gyroscope data
>   *  - 2nd data set is reserved for accelerometer data
>   * The FIFO pattern changes depending on the ODRs and decimation factors
> @@ -206,7 +207,7 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark)
>  }
>  
>  /**
> - * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DSL-LSM6DSM read FIFO routine
> + * st_lsm6dsx_read_fifo() - LSM6DS3-LSM6DS3H-LSM6DSL-LSM6DSM read FIFO routine
>   * @hw: Pointer to instance of struct st_lsm6dsx_hw.
>   *
>   * Read samples from the hw FIFO and push them to IIO buffers.
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index 5d8d5cd..c433223 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -17,7 +17,7 @@
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
>   *   - FIFO size: 8KB
>   *
> - * - LSM6DSL/LSM6DSM:
> + * - LSM6DS3H/LSM6DSL/LSM6DSM:
>   *   - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416
>   *   - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
>   *   - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
> @@ -165,6 +165,13 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  		},
>  	},
>  	{
> +		.wai = 0x69,
> +		.max_fifo_size = 4096,
> +		.id = {
> +			[0] = ST_LSM6DS3H_ID,
> +		},
> +	},
> +	{
>  		.wai = 0x6a,
>  		.max_fifo_size = 4096,
>  		.id = {
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> index 60a3de0..2e4ed26 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> @@ -71,6 +71,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6ds3h",
> +		.data = (void *)ST_LSM6DS3H_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsl",
>  		.data = (void *)ST_LSM6DSL_ID,
>  	},
> @@ -84,6 +88,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
>  
>  static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
>  	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> index 39edb40..1bf4a58 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> @@ -88,6 +88,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
>  		.data = (void *)ST_LSM6DS3_ID,
>  	},
>  	{
> +		.compatible = "st,lsm6ds3h",
> +		.data = (void *)ST_LSM6DS3H_ID,
> +	},
> +	{
>  		.compatible = "st,lsm6dsl",
>  		.data = (void *)ST_LSM6DSL_ID,
>  	},
> @@ -101,6 +105,7 @@ MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
>  
>  static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
>  	{ ST_LSM6DS3_DEV_NAME, ST_LSM6DS3_ID },
> +	{ ST_LSM6DS3H_DEV_NAME, ST_LSM6DS3H_ID },
>  	{ ST_LSM6DSL_DEV_NAME, ST_LSM6DSL_ID },
>  	{ ST_LSM6DSM_DEV_NAME, ST_LSM6DSM_ID },
>  	{},
> 


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

* Re: [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
  2017-02-01 16:06         ` Rob Herring
@ 2017-02-04 12:27           ` Jonathan Cameron
  -1 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:27 UTC (permalink / raw)
  To: Rob Herring, Lorenzo Bianconi
  Cc: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, lorenzo.bianconi-qxv4g6HH51o

On 01/02/17 16:06, Rob Herring wrote:
> On Sun, Jan 29, 2017 at 11:49:28AM +0100, Lorenzo Bianconi wrote:
>> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
>> ---
>>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>>  1 file changed, 1 insertion(+)
> 
> This could be combined with patch 3.
> 
> Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 
Yeah, whilst it's normally one change one patch, this series did
seem to break things up a little excessively!  Perhaps 3 patches would
have be ideal.

1) Supporting refactor of code
2) New device support
3) DT for new devices.

Meh however.  Good easy series for me to handle so I'm happy
anyway ;)

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

Chances are high that this is too late for the coming merge windows - all depends
on how fed up Linus is feeling tomorrow!

Jonathan
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding
@ 2017-02-04 12:27           ` Jonathan Cameron
  0 siblings, 0 replies; 26+ messages in thread
From: Jonathan Cameron @ 2017-02-04 12:27 UTC (permalink / raw)
  To: Rob Herring, Lorenzo Bianconi; +Cc: linux-iio, devicetree, lorenzo.bianconi

On 01/02/17 16:06, Rob Herring wrote:
> On Sun, Jan 29, 2017 at 11:49:28AM +0100, Lorenzo Bianconi wrote:
>> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
>> ---
>>  Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt | 1 +
>>  1 file changed, 1 insertion(+)
> 
> This could be combined with patch 3.
> 
> Acked-by: Rob Herring <robh@kernel.org>
> 
Yeah, whilst it's normally one change one patch, this series did
seem to break things up a little excessively!  Perhaps 3 patches would
have be ideal.

1) Supporting refactor of code
2) New device support
3) DT for new devices.

Meh however.  Good easy series for me to handle so I'm happy
anyway ;)

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

Chances are high that this is too late for the coming merge windows - all depends
on how fed up Linus is feeling tomorrow!

Jonathan

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

end of thread, other threads:[~2017-02-04 12:27 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-29 10:49 [PATCH 0/5] add support to LSM6DS3H and LSM6DSL Lorenzo Bianconi
2017-01-29 10:49 ` Lorenzo Bianconi
     [not found] ` <20170129104928.15533-1-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-01-29 10:49   ` [PATCH 1/5] iio: imu: st_lsm6dsx: add support to multiple devices with the same settings Lorenzo Bianconi
2017-01-29 10:49     ` Lorenzo Bianconi
     [not found]     ` <20170129104928.15533-2-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-02-04 12:23       ` Jonathan Cameron
2017-02-04 12:23         ` Jonathan Cameron
2017-01-29 10:49   ` [PATCH 2/5] iio: imu: st_lsm6dsx: add support to lsm6dsl Lorenzo Bianconi
2017-01-29 10:49     ` Lorenzo Bianconi
     [not found]     ` <20170129104928.15533-3-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-02-04 12:24       ` Jonathan Cameron
2017-02-04 12:24         ` Jonathan Cameron
2017-01-29 10:49   ` [PATCH 3/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6dsl sensor device binding Lorenzo Bianconi
2017-01-29 10:49     ` Lorenzo Bianconi
     [not found]     ` <20170129104928.15533-4-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-02-01 16:04       ` Rob Herring
2017-02-01 16:04         ` Rob Herring
2017-02-04 12:24         ` Jonathan Cameron
2017-02-04 12:24           ` Jonathan Cameron
2017-01-29 10:49   ` [PATCH 4/5] iio: imu: st_lsm6dsx: add support to lsm6ds3h Lorenzo Bianconi
2017-01-29 10:49     ` Lorenzo Bianconi
     [not found]     ` <20170129104928.15533-5-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-02-04 12:25       ` Jonathan Cameron
2017-02-04 12:25         ` Jonathan Cameron
2017-01-29 10:49   ` [PATCH 5/5] Documentation: dt: iio: imu: st_lsm6dsx: add lsm6ds3h sensor device binding Lorenzo Bianconi
2017-01-29 10:49     ` Lorenzo Bianconi
     [not found]     ` <20170129104928.15533-6-lorenzo.bianconi-qxv4g6HH51o@public.gmane.org>
2017-02-01 16:06       ` Rob Herring
2017-02-01 16:06         ` Rob Herring
2017-02-04 12:27         ` Jonathan Cameron
2017-02-04 12:27           ` 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.