[[Xenial][SRU] 0/4] lps22hb pressure sensor support

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[[Xenial][SRU] 0/4] lps22hb pressure sensor support

Shrirang Bagul
BugLink: https://launchpad.net/bugs/1642258

This work is based on ver. Ubuntu-4.4.0-49.70 in Xenial kernel. The patches
are backported and add support for lps22hb pressure sensor. This sensor is
present on Dell IoT gateways.

Gregor Boirie (4):
  iio:st_pressure:initial lps22hb sensor support
  iio:st_pressure: align storagebits on power of 2
  iio:st_pressure: document sampling gains
  iio:st_pressure:lps22hb: temperature support

 .../devicetree/bindings/iio/st-sensors.txt         |   1 +
 drivers/iio/pressure/Kconfig                       |   2 +-
 drivers/iio/pressure/st_pressure.h                 |   1 +
 drivers/iio/pressure/st_pressure_core.c            | 203 ++++++++++++++++++++-
 drivers/iio/pressure/st_pressure_i2c.c             |   4 +
 drivers/iio/pressure/st_pressure_spi.c             |   1 +
 6 files changed, 203 insertions(+), 9 deletions(-)

--
2.9.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[[Xenial][SRU] 1/4] iio:st_pressure:initial lps22hb sensor support

Shrirang Bagul
From: Gregor Boirie <[hidden email]>

BugLink: https://launchpad.net/bugs/1642258

Initial support for ST LPS22HB pressure sensor. Datasheet:
http://www2.st.com/resource/en/datasheet/lps22hb.pdf

Features:
* pressure data and timestamping channels
* sampling frequency selection
* interrupt based trigger
* over I2C or SPI

Signed-off-by: Gregor Boirie <[hidden email]>
Signed-off-by: Jonathan Cameron <[hidden email]>
(backported from commit e039e2f5b4dab9a90bb5441a154c01a051b1abfa)
Signed-off-by: Shrirang Bagul <[hidden email]>
---
 .../devicetree/bindings/iio/st-sensors.txt         |  1 +
 drivers/iio/pressure/Kconfig                       |  2 +-
 drivers/iio/pressure/st_pressure.h                 |  1 +
 drivers/iio/pressure/st_pressure_core.c            | 91 +++++++++++++++++++++-
 drivers/iio/pressure/st_pressure_i2c.c             |  4 +
 drivers/iio/pressure/st_pressure_spi.c             |  1 +
 6 files changed, 95 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
index d3ccdb1..b25fe92 100644
--- a/Documentation/devicetree/bindings/iio/st-sensors.txt
+++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
@@ -57,3 +57,4 @@ Pressure sensors:
 - st,lps001wp-press
 - st,lps25h-press
 - st,lps331ap-press
+- st,lps22hb-press
diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
index 6f2e7c9..a5fc260 100644
--- a/drivers/iio/pressure/Kconfig
+++ b/drivers/iio/pressure/Kconfig
@@ -101,7 +101,7 @@ config IIO_ST_PRESS
  select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
  help
   Say yes here to build support for STMicroelectronics pressure
-  sensors: LPS001WP, LPS25H, LPS331AP.
+  sensors: LPS001WP, LPS25H, LPS331AP, LPS22HB.
 
   This driver can also be built as a module. If so, these modules
   will be created:
diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h
index f5f4149..903a21e 100644
--- a/drivers/iio/pressure/st_pressure.h
+++ b/drivers/iio/pressure/st_pressure.h
@@ -17,6 +17,7 @@
 #define LPS001WP_PRESS_DEV_NAME "lps001wp"
 #define LPS25H_PRESS_DEV_NAME "lps25h"
 #define LPS331AP_PRESS_DEV_NAME "lps331ap"
+#define LPS22HB_PRESS_DEV_NAME "lps22hb"
 
 /**
  * struct st_sensors_platform_data - default press platform data
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 5056bd6..ecf3cd4 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -109,6 +109,26 @@
 #define ST_PRESS_LPS25H_OUT_XL_ADDR 0x28
 #define ST_TEMP_LPS25H_OUT_L_ADDR 0x2b
 
+/* CUSTOM VALUES FOR LPS22HB SENSOR */
+#define ST_PRESS_LPS22HB_WAI_EXP 0xb1
+#define ST_PRESS_LPS22HB_ODR_ADDR 0x10
+#define ST_PRESS_LPS22HB_ODR_MASK 0x70
+#define ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL 0x01
+#define ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL 0x02
+#define ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL 0x03
+#define ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL 0x04
+#define ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL 0x05
+#define ST_PRESS_LPS22HB_PW_ADDR 0x10
+#define ST_PRESS_LPS22HB_PW_MASK 0x70
+#define ST_PRESS_LPS22HB_BDU_ADDR 0x10
+#define ST_PRESS_LPS22HB_BDU_MASK 0x02
+#define ST_PRESS_LPS22HB_DRDY_IRQ_ADDR 0x12
+#define ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK 0x04
+#define ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK 0x08
+#define ST_PRESS_LPS22HB_IHL_IRQ_ADDR 0x12
+#define ST_PRESS_LPS22HB_IHL_IRQ_MASK 0x80
+#define ST_PRESS_LPS22HB_MULTIREAD_BIT true
+
 static const struct iio_chan_spec st_press_1_channels[] = {
  {
  .type = IIO_PRESSURE,
@@ -181,6 +201,27 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
  IIO_CHAN_SOFT_TIMESTAMP(1)
 };
 
+static const struct iio_chan_spec st_press_lps22hb_channels[] = {
+ {
+ .type = IIO_PRESSURE,
+ .channel2 = IIO_NO_MOD,
+ .address = ST_PRESS_1_OUT_XL_ADDR,
+ .scan_index = 0,
+ .scan_type = {
+ .sign = 'u',
+ .realbits = 24,
+ .storagebits = 24,
+ .endianness = IIO_LE,
+ },
+ .info_mask_separate =
+ BIT(IIO_CHAN_INFO_RAW) |
+ BIT(IIO_CHAN_INFO_SCALE),
+ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
+ .modified = 0,
+ },
+ IIO_CHAN_SOFT_TIMESTAMP(1)
+};
+
 static const struct st_sensor_settings st_press_sensors_settings[] = {
  {
  .wai = ST_PRESS_LPS331AP_WAI_EXP,
@@ -328,6 +369,49 @@ static const struct st_sensor_settings st_press_sensors_settings[] = {
  .multi_read_bit = ST_PRESS_LPS25H_MULTIREAD_BIT,
  .bootime = 2,
  },
+ {
+ .wai = ST_PRESS_LPS22HB_WAI_EXP,
+ .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+ .sensors_supported = {
+ [0] = LPS22HB_PRESS_DEV_NAME,
+ },
+ .ch = (struct iio_chan_spec *)st_press_lps22hb_channels,
+ .num_ch = ARRAY_SIZE(st_press_lps22hb_channels),
+ .odr = {
+ .addr = ST_PRESS_LPS22HB_ODR_ADDR,
+ .mask = ST_PRESS_LPS22HB_ODR_MASK,
+ .odr_avl = {
+ { 1, ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL, },
+ { 10, ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL, },
+ { 25, ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL, },
+ { 50, ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL, },
+ { 75, ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL, },
+ },
+ },
+ .pw = {
+ .addr = ST_PRESS_LPS22HB_PW_ADDR,
+ .mask = ST_PRESS_LPS22HB_PW_MASK,
+ .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+ },
+ .fs = {
+ .fs_avl = {
+ [0] = {
+ .num = ST_PRESS_FS_AVL_1260MB,
+ .gain = ST_PRESS_KPASCAL_NANO_SCALE,
+ },
+ },
+ },
+ .bdu = {
+ .addr = ST_PRESS_LPS22HB_BDU_ADDR,
+ .mask = ST_PRESS_LPS22HB_BDU_MASK,
+ },
+ .drdy_irq = {
+ .addr = ST_PRESS_LPS22HB_DRDY_IRQ_ADDR,
+ .mask_int1 = ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK,
+ .mask_int2 = ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK,
+ },
+ .multi_read_bit = ST_PRESS_LPS22HB_MULTIREAD_BIT,
+ },
 };
 
 static int st_press_write_raw(struct iio_dev *indio_dev,
@@ -456,10 +540,9 @@ int st_press_common_probe(struct iio_dev *indio_dev)
  indio_dev->channels = press_data->sensor_settings->ch;
  indio_dev->num_channels = press_data->sensor_settings->num_ch;
 
- if (press_data->sensor_settings->fs.addr != 0)
- press_data->current_fullscale =
- (struct st_sensor_fullscale_avl *)
- &press_data->sensor_settings->fs.fs_avl[0];
+ press_data->current_fullscale =
+ (struct st_sensor_fullscale_avl *)
+ &press_data->sensor_settings->fs.fs_avl[0];
 
  press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz;
 
diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
index 8fcf976..ed18701 100644
--- a/drivers/iio/pressure/st_pressure_i2c.c
+++ b/drivers/iio/pressure/st_pressure_i2c.c
@@ -32,6 +32,10 @@ static const struct of_device_id st_press_of_match[] = {
  .compatible = "st,lps331ap-press",
  .data = LPS331AP_PRESS_DEV_NAME,
  },
+ {
+ .compatible = "st,lps22hb-press",
+ .data = LPS22HB_PRESS_DEV_NAME,
+ },
  {},
 };
 MODULE_DEVICE_TABLE(of, st_press_of_match);
diff --git a/drivers/iio/pressure/st_pressure_spi.c b/drivers/iio/pressure/st_pressure_spi.c
index 40c0692..5505080 100644
--- a/drivers/iio/pressure/st_pressure_spi.c
+++ b/drivers/iio/pressure/st_pressure_spi.c
@@ -50,6 +50,7 @@ static const struct spi_device_id st_press_id_table[] = {
  { LPS001WP_PRESS_DEV_NAME },
  { LPS25H_PRESS_DEV_NAME },
  { LPS331AP_PRESS_DEV_NAME },
+ { LPS22HB_PRESS_DEV_NAME },
  {},
 };
 MODULE_DEVICE_TABLE(spi, st_press_id_table);
--
2.9.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[[Xenial][SRU] 2/4] iio:st_pressure: align storagebits on power of 2

Shrirang Bagul
In reply to this post by Shrirang Bagul
From: Gregor Boirie <[hidden email]>

BugLink: https://launchpad.net/bugs/1642258

Sampled pressure data are 24 bits long and should be stored in a 32 bits
word.

Signed-off-by: Gregor Boirie <[hidden email]>
Tested-by: Linus Walleij <[hidden email]>
Signed-off-by: Jonathan Cameron <[hidden email]>
(backported from commit c9d5e5b97e8723e20204b430edde2f3dc5f5c0cf)
Signed-off-by: Shrirang Bagul <[hidden email]>
---
 drivers/iio/pressure/st_pressure_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index ecf3cd4..8532181 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -138,7 +138,7 @@ static const struct iio_chan_spec st_press_1_channels[] = {
  .scan_type = {
  .sign = 'u',
  .realbits = 24,
- .storagebits = 24,
+ .storagebits = 32,
  .endianness = IIO_LE,
  },
  .info_mask_separate =
@@ -210,7 +210,7 @@ static const struct iio_chan_spec st_press_lps22hb_channels[] = {
  .scan_type = {
  .sign = 'u',
  .realbits = 24,
- .storagebits = 24,
+ .storagebits = 32,
  .endianness = IIO_LE,
  },
  .info_mask_separate =
--
2.9.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[[Xenial][SRU] 3/4] iio:st_pressure: document sampling gains

Shrirang Bagul
In reply to this post by Shrirang Bagul
From: Gregor Boirie <[hidden email]>

BugLink: https://launchpad.net/bugs/1642258

Details scaling factors and offsets applied to raw temperature and pressure
samples.

Signed-off-by: Gregor Boirie <[hidden email]>
Tested-by: Linus Walleij <[hidden email]>
Signed-off-by: Jonathan Cameron <[hidden email]>
(backported from commit 19b7b8a89b8d98fdafd80b61160a167deb75888d)
Signed-off-by: Shrirang Bagul <[hidden email]>
---
 drivers/iio/pressure/st_pressure_core.c | 92 +++++++++++++++++++++++++++++++--
 1 file changed, 88 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 8532181..94c1530 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -28,6 +28,72 @@
 #include <linux/iio/common/st_sensors.h>
 #include "st_pressure.h"
 
+/*
+ * About determining pressure scaling factors
+ * ------------------------------------------
+ *
+ * Datasheets specify typical pressure sensitivity so that pressure is computed
+ * according to the following equation :
+ *     pressure[mBar] = raw / sensitivity
+ * where :
+ *     raw          the 24 bits long raw sampled pressure
+ *     sensitivity  a scaling factor specified by the datasheet in LSB/mBar
+ *
+ * IIO ABI expects pressure to be expressed as kPascal, hence pressure should be
+ * computed according to :
+ *     pressure[kPascal] = pressure[mBar] / 10
+ *                       = raw / (sensitivity * 10)                          (1)
+ *
+ * Finally, st_press_read_raw() returns pressure scaling factor as an
+ * IIO_VAL_INT_PLUS_NANO with a zero integral part and "gain" as decimal part.
+ * Therefore, from (1), "gain" becomes :
+ *     gain = 10^9 / (sensitivity * 10)
+ *          = 10^8 / sensitivity
+ *
+ * About determining temperature scaling factors and offsets
+ * ---------------------------------------------------------
+ *
+ * Datasheets specify typical temperature sensitivity and offset so that
+ * temperature is computed according to the following equation :
+ *     temp[Celsius] = offset[Celsius] + (raw / sensitivity)
+ * where :
+ *     raw          the 16 bits long raw sampled temperature
+ *     offset       a constant specified by the datasheet in degree Celsius
+ *                  (sometimes zero)
+ *     sensitivity  a scaling factor specified by the datasheet in LSB/Celsius
+ *
+ * IIO ABI expects temperature to be expressed as milli degree Celsius such as
+ * user space should compute temperature according to :
+ *     temp[mCelsius] = temp[Celsius] * 10^3
+ *                    = (offset[Celsius] + (raw / sensitivity)) * 10^3
+ *                    = ((offset[Celsius] * sensitivity) + raw) *
+ *                      (10^3 / sensitivity)                                 (2)
+ *
+ * IIO ABI expects user space to apply offset and scaling factors to raw samples
+ * according to :
+ *     temp[mCelsius] = (OFFSET + raw) * SCALE
+ * where :
+ *     OFFSET an arbitrary constant exposed by device
+ *     SCALE  an arbitrary scaling factor exposed by device
+ *
+ * Matching OFFSET and SCALE with members of (2) gives :
+ *     OFFSET = offset[Celsius] * sensitivity                                (3)
+ *     SCALE  = 10^3 / sensitivity                                           (4)
+ *
+ * st_press_read_raw() returns temperature scaling factor as an
+ * IIO_VAL_FRACTIONAL with a 10^3 numerator and "gain2" as denominator.
+ * Therefore, from (3), "gain2" becomes :
+ *     gain2 = sensitivity
+ *
+ * When declared within channel, i.e. for a non zero specified offset,
+ * st_press_read_raw() will return the latter as an IIO_VAL_FRACTIONAL such as :
+ *     numerator = OFFSET * 10^3
+ *     denominator = 10^3
+ * giving from (4):
+ *     numerator = offset[Celsius] * 10^3 * sensitivity
+ *               = offset[mCelsius] * gain2
+ */
+
 #define MCELSIUS_PER_CELSIUS 1000
 
 /* Default pressure sensitivity */
@@ -48,7 +114,11 @@
 #define ST_PRESS_1_OUT_XL_ADDR 0x28
 #define ST_TEMP_1_OUT_L_ADDR 0x2b
 
-/* CUSTOM VALUES FOR LPS331AP SENSOR */
+/*
+ * CUSTOM VALUES FOR LPS331AP SENSOR
+ * See LPS331AP datasheet:
+ * http://www2.st.com/resource/en/datasheet/lps331ap.pdf
+ */
 #define ST_PRESS_LPS331AP_WAI_EXP 0xbb
 #define ST_PRESS_LPS331AP_ODR_ADDR 0x20
 #define ST_PRESS_LPS331AP_ODR_MASK 0x70
@@ -67,7 +137,9 @@
 #define ST_PRESS_LPS331AP_DRDY_IRQ_INT2_MASK 0x20
 #define ST_PRESS_LPS331AP_MULTIREAD_BIT true
 
-/* CUSTOM VALUES FOR LPS001WP SENSOR */
+/*
+ * CUSTOM VALUES FOR THE OBSOLETE LPS001WP SENSOR
+ */
 
 /* LPS001WP pressure resolution */
 #define ST_PRESS_LPS001WP_LSB_PER_MBAR 16UL
@@ -90,7 +162,11 @@
 #define ST_PRESS_LPS001WP_OUT_L_ADDR 0x28
 #define ST_TEMP_LPS001WP_OUT_L_ADDR 0x2a
 
-/* CUSTOM VALUES FOR LPS25H SENSOR */
+/*
+ * CUSTOM VALUES FOR LPS25H SENSOR
+ * See LPS25H datasheet:
+ * http://www2.st.com/resource/en/datasheet/lps25h.pdf
+ */
 #define ST_PRESS_LPS25H_WAI_EXP 0xbd
 #define ST_PRESS_LPS25H_ODR_ADDR 0x20
 #define ST_PRESS_LPS25H_ODR_MASK 0x70
@@ -109,7 +185,11 @@
 #define ST_PRESS_LPS25H_OUT_XL_ADDR 0x28
 #define ST_TEMP_LPS25H_OUT_L_ADDR 0x2b
 
-/* CUSTOM VALUES FOR LPS22HB SENSOR */
+/*
+ * CUSTOM VALUES FOR LPS22HB SENSOR
+ * See LPS22HB datasheet:
+ * http://www2.st.com/resource/en/datasheet/lps22hb.pdf
+ */
 #define ST_PRESS_LPS22HB_WAI_EXP 0xb1
 #define ST_PRESS_LPS22HB_ODR_ADDR 0x10
 #define ST_PRESS_LPS22HB_ODR_MASK 0x70
@@ -395,6 +475,10 @@ static const struct st_sensor_settings st_press_sensors_settings[] = {
  },
  .fs = {
  .fs_avl = {
+ /*
+ * Sensitivity values as defined in table 3 of
+ * LPS22HB datasheet.
+ */
  [0] = {
  .num = ST_PRESS_FS_AVL_1260MB,
  .gain = ST_PRESS_KPASCAL_NANO_SCALE,
--
2.9.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[[Xenial][SRU] 4/4] iio:st_pressure:lps22hb: temperature support

Shrirang Bagul
In reply to this post by Shrirang Bagul
From: Gregor Boirie <[hidden email]>

BugLink: https://launchpad.net/bugs/1642258

Implement lps22hb temperature sampling channel.

Signed-off-by: Gregor Boirie <[hidden email]>
Tested-by: Linus Walleij <[hidden email]>
Signed-off-by: Jonathan Cameron <[hidden email]>
(backported from commit 85d79136d3080729b13d1dcd433727223038e830)
Signed-off-by: Shrirang Bagul <[hidden email]>
---
 drivers/iio/pressure/st_pressure_core.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 94c1530..77acc41 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -190,6 +190,10 @@
  * See LPS22HB datasheet:
  * http://www2.st.com/resource/en/datasheet/lps22hb.pdf
  */
+
+/* LPS22HB temperature sensitivity */
+#define ST_PRESS_LPS22HB_LSB_PER_CELSIUS 100UL
+
 #define ST_PRESS_LPS22HB_WAI_EXP 0xb1
 #define ST_PRESS_LPS22HB_ODR_ADDR 0x10
 #define ST_PRESS_LPS22HB_ODR_MASK 0x70
@@ -299,7 +303,22 @@ static const struct iio_chan_spec st_press_lps22hb_channels[] = {
  .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
  .modified = 0,
  },
- IIO_CHAN_SOFT_TIMESTAMP(1)
+ {
+ .type = IIO_TEMP,
+ .address = ST_TEMP_1_OUT_L_ADDR,
+ .scan_index = 1,
+ .scan_type = {
+ .sign = 's',
+ .realbits = 16,
+ .storagebits = 16,
+ .endianness = IIO_LE,
+ },
+ .info_mask_separate =
+ BIT(IIO_CHAN_INFO_RAW) |
+ BIT(IIO_CHAN_INFO_SCALE),
+ .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
+ },
+ IIO_CHAN_SOFT_TIMESTAMP(2)
 };
 
 static const struct st_sensor_settings st_press_sensors_settings[] = {
@@ -476,12 +495,13 @@ static const struct st_sensor_settings st_press_sensors_settings[] = {
  .fs = {
  .fs_avl = {
  /*
- * Sensitivity values as defined in table 3 of
- * LPS22HB datasheet.
+ * Pressure and temperature sensitivity values
+ * as defined in table 3 of LPS22HB datasheet.
  */
  [0] = {
  .num = ST_PRESS_FS_AVL_1260MB,
  .gain = ST_PRESS_KPASCAL_NANO_SCALE,
+ .gain2 = ST_PRESS_LPS22HB_LSB_PER_CELSIUS,
  },
  },
  },
--
2.9.3


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [[Xenial][SRU] 1/4] iio:st_pressure:initial lps22hb sensor support

Stefan Bader-2
In reply to this post by Shrirang Bagul
On 25.11.2016 05:31, Shrirang Bagul wrote:

> From: Gregor Boirie <[hidden email]>
>
> BugLink: https://launchpad.net/bugs/1642258
>
> Initial support for ST LPS22HB pressure sensor. Datasheet:
> http://www2.st.com/resource/en/datasheet/lps22hb.pdf
>
> Features:
> * pressure data and timestamping channels
> * sampling frequency selection
> * interrupt based trigger
> * over I2C or SPI
>
> Signed-off-by: Gregor Boirie <[hidden email]>
> Signed-off-by: Jonathan Cameron <[hidden email]>
> (backported from commit e039e2f5b4dab9a90bb5441a154c01a051b1abfa)
> Signed-off-by: Shrirang Bagul <[hidden email]>
> ---
>  .../devicetree/bindings/iio/st-sensors.txt         |  1 +
>  drivers/iio/pressure/Kconfig                       |  2 +-
>  drivers/iio/pressure/st_pressure.h                 |  1 +
>  drivers/iio/pressure/st_pressure_core.c            | 91 +++++++++++++++++++++-
>  drivers/iio/pressure/st_pressure_i2c.c             |  4 +
>  drivers/iio/pressure/st_pressure_spi.c             |  1 +
>  6 files changed, 95 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt b/Documentation/devicetree/bindings/iio/st-sensors.txt
> index d3ccdb1..b25fe92 100644
> --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
> @@ -57,3 +57,4 @@ Pressure sensors:
>  - st,lps001wp-press
>  - st,lps25h-press
>  - st,lps331ap-press
> +- st,lps22hb-press
> diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
> index 6f2e7c9..a5fc260 100644
> --- a/drivers/iio/pressure/Kconfig
> +++ b/drivers/iio/pressure/Kconfig
> @@ -101,7 +101,7 @@ config IIO_ST_PRESS
>   select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
>   help
>    Say yes here to build support for STMicroelectronics pressure
> -  sensors: LPS001WP, LPS25H, LPS331AP.
> +  sensors: LPS001WP, LPS25H, LPS331AP, LPS22HB.
>  
>    This driver can also be built as a module. If so, these modules
>    will be created:
> diff --git a/drivers/iio/pressure/st_pressure.h b/drivers/iio/pressure/st_pressure.h
> index f5f4149..903a21e 100644
> --- a/drivers/iio/pressure/st_pressure.h
> +++ b/drivers/iio/pressure/st_pressure.h
> @@ -17,6 +17,7 @@
>  #define LPS001WP_PRESS_DEV_NAME "lps001wp"
>  #define LPS25H_PRESS_DEV_NAME "lps25h"
>  #define LPS331AP_PRESS_DEV_NAME "lps331ap"
> +#define LPS22HB_PRESS_DEV_NAME "lps22hb"
>  
>  /**
>   * struct st_sensors_platform_data - default press platform data
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 5056bd6..ecf3cd4 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -109,6 +109,26 @@
>  #define ST_PRESS_LPS25H_OUT_XL_ADDR 0x28
>  #define ST_TEMP_LPS25H_OUT_L_ADDR 0x2b
>  
> +/* CUSTOM VALUES FOR LPS22HB SENSOR */
> +#define ST_PRESS_LPS22HB_WAI_EXP 0xb1
> +#define ST_PRESS_LPS22HB_ODR_ADDR 0x10
> +#define ST_PRESS_LPS22HB_ODR_MASK 0x70
> +#define ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL 0x01
> +#define ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL 0x02
> +#define ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL 0x03
> +#define ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL 0x04
> +#define ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL 0x05
> +#define ST_PRESS_LPS22HB_PW_ADDR 0x10
> +#define ST_PRESS_LPS22HB_PW_MASK 0x70
> +#define ST_PRESS_LPS22HB_BDU_ADDR 0x10
> +#define ST_PRESS_LPS22HB_BDU_MASK 0x02
> +#define ST_PRESS_LPS22HB_DRDY_IRQ_ADDR 0x12
> +#define ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK 0x04
> +#define ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK 0x08
> +#define ST_PRESS_LPS22HB_IHL_IRQ_ADDR 0x12
> +#define ST_PRESS_LPS22HB_IHL_IRQ_MASK 0x80
> +#define ST_PRESS_LPS22HB_MULTIREAD_BIT true
> +
>  static const struct iio_chan_spec st_press_1_channels[] = {
>   {
>   .type = IIO_PRESSURE,
> @@ -181,6 +201,27 @@ static const struct iio_chan_spec st_press_lps001wp_channels[] = {
>   IIO_CHAN_SOFT_TIMESTAMP(1)
>  };
>  
> +static const struct iio_chan_spec st_press_lps22hb_channels[] = {
> + {
> + .type = IIO_PRESSURE,
> + .channel2 = IIO_NO_MOD,
> + .address = ST_PRESS_1_OUT_XL_ADDR,
> + .scan_index = 0,
> + .scan_type = {
> + .sign = 'u',
> + .realbits = 24,
> + .storagebits = 24,
> + .endianness = IIO_LE,
> + },
> + .info_mask_separate =
> + BIT(IIO_CHAN_INFO_RAW) |
> + BIT(IIO_CHAN_INFO_SCALE),
> + .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
> + .modified = 0,
> + },
> + IIO_CHAN_SOFT_TIMESTAMP(1)
> +};
> +
>  static const struct st_sensor_settings st_press_sensors_settings[] = {
>   {
>   .wai = ST_PRESS_LPS331AP_WAI_EXP,
> @@ -328,6 +369,49 @@ static const struct st_sensor_settings st_press_sensors_settings[] = {
>   .multi_read_bit = ST_PRESS_LPS25H_MULTIREAD_BIT,
>   .bootime = 2,
>   },
> + {
> + .wai = ST_PRESS_LPS22HB_WAI_EXP,
> + .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
> + .sensors_supported = {
> + [0] = LPS22HB_PRESS_DEV_NAME,
> + },
> + .ch = (struct iio_chan_spec *)st_press_lps22hb_channels,
> + .num_ch = ARRAY_SIZE(st_press_lps22hb_channels),
> + .odr = {
> + .addr = ST_PRESS_LPS22HB_ODR_ADDR,
> + .mask = ST_PRESS_LPS22HB_ODR_MASK,
> + .odr_avl = {
> + { 1, ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL, },
> + { 10, ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL, },
> + { 25, ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL, },
> + { 50, ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL, },
> + { 75, ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL, },
> + },
> + },
> + .pw = {
> + .addr = ST_PRESS_LPS22HB_PW_ADDR,
> + .mask = ST_PRESS_LPS22HB_PW_MASK,
> + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
> + },
> + .fs = {
> + .fs_avl = {
> + [0] = {
> + .num = ST_PRESS_FS_AVL_1260MB,
> + .gain = ST_PRESS_KPASCAL_NANO_SCALE,
> + },
> + },
> + },
> + .bdu = {
> + .addr = ST_PRESS_LPS22HB_BDU_ADDR,
> + .mask = ST_PRESS_LPS22HB_BDU_MASK,
> + },
> + .drdy_irq = {
> + .addr = ST_PRESS_LPS22HB_DRDY_IRQ_ADDR,
> + .mask_int1 = ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK,
> + .mask_int2 = ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK,
> + },
> + .multi_read_bit = ST_PRESS_LPS22HB_MULTIREAD_BIT,
> + },
>  };
>  
>  static int st_press_write_raw(struct iio_dev *indio_dev,
> @@ -456,10 +540,9 @@ int st_press_common_probe(struct iio_dev *indio_dev)
>   indio_dev->channels = press_data->sensor_settings->ch;
>   indio_dev->num_channels = press_data->sensor_settings->num_ch;
>  
> - if (press_data->sensor_settings->fs.addr != 0)
> - press_data->current_fullscale =
> - (struct st_sensor_fullscale_avl *)
> - &press_data->sensor_settings->fs.fs_avl[0];
> + press_data->current_fullscale =
> + (struct st_sensor_fullscale_avl *)
> + &press_data->sensor_settings->fs.fs_avl[0];
Most of the rest appears to add code in a way that limits it to a specific hw.
Except here ^ where I am not sure whether this could not have impact on existing
hw using this driver. Was there any testing to check for potential regressions?

-Stefan

>  
>   press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz;
>  
> diff --git a/drivers/iio/pressure/st_pressure_i2c.c b/drivers/iio/pressure/st_pressure_i2c.c
> index 8fcf976..ed18701 100644
> --- a/drivers/iio/pressure/st_pressure_i2c.c
> +++ b/drivers/iio/pressure/st_pressure_i2c.c
> @@ -32,6 +32,10 @@ static const struct of_device_id st_press_of_match[] = {
>   .compatible = "st,lps331ap-press",
>   .data = LPS331AP_PRESS_DEV_NAME,
>   },
> + {
> + .compatible = "st,lps22hb-press",
> + .data = LPS22HB_PRESS_DEV_NAME,
> + },
>   {},
>  };
>  MODULE_DEVICE_TABLE(of, st_press_of_match);
> diff --git a/drivers/iio/pressure/st_pressure_spi.c b/drivers/iio/pressure/st_pressure_spi.c
> index 40c0692..5505080 100644
> --- a/drivers/iio/pressure/st_pressure_spi.c
> +++ b/drivers/iio/pressure/st_pressure_spi.c
> @@ -50,6 +50,7 @@ static const struct spi_device_id st_press_id_table[] = {
>   { LPS001WP_PRESS_DEV_NAME },
>   { LPS25H_PRESS_DEV_NAME },
>   { LPS331AP_PRESS_DEV_NAME },
> + { LPS22HB_PRESS_DEV_NAME },
>   {},
>  };
>  MODULE_DEVICE_TABLE(spi, st_press_id_table);
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ACK w/cmt: [[Xenial][SRU] 0/4] lps22hb pressure sensor support

Tim Gardner-2
In reply to this post by Shrirang Bagul
These patches are all clean cherry-picks, not backports.

--
Tim Gardner [hidden email]

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [[Xenial][SRU] 1/4] iio:st_pressure:initial lps22hb sensor support

Shrirang Bagul
In reply to this post by Stefan Bader-2
On Mon, 2016-11-28 at 11:48 +0100, Stefan Bader wrote:

> On 25.11.2016 05:31, Shrirang Bagul wrote:
> > From: Gregor Boirie <[hidden email]>
> >
> > BugLink: https://launchpad.net/bugs/1642258
> >
> > Initial support for ST LPS22HB pressure sensor. Datasheet:
> > http://www2.st.com/resource/en/datasheet/lps22hb.pdf
> >
> > Features:
> > * pressure data and timestamping channels
> > * sampling frequency selection
> > * interrupt based trigger
> > * over I2C or SPI
> >
> > Signed-off-by: Gregor Boirie <[hidden email]>
> > Signed-off-by: Jonathan Cameron <[hidden email]>
> > (backported from commit e039e2f5b4dab9a90bb5441a154c01a051b1abfa)
> > Signed-off-by: Shrirang Bagul <[hidden email]>
> > ---
> >  .../devicetree/bindings/iio/st-sensors.txt         |  1 +
> >  drivers/iio/pressure/Kconfig                       |  2 +-
> >  drivers/iio/pressure/st_pressure.h                 |  1 +
> >  drivers/iio/pressure/st_pressure_core.c            | 91
> > +++++++++++++++++++++-
> >  drivers/iio/pressure/st_pressure_i2c.c             |  4 +
> >  drivers/iio/pressure/st_pressure_spi.c             |  1 +
> >  6 files changed, 95 insertions(+), 5 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/st-sensors.txt
> > b/Documentation/devicetree/bindings/iio/st-sensors.txt
> > index d3ccdb1..b25fe92 100644
> > --- a/Documentation/devicetree/bindings/iio/st-sensors.txt
> > +++ b/Documentation/devicetree/bindings/iio/st-sensors.txt
> > @@ -57,3 +57,4 @@ Pressure sensors:
> >  - st,lps001wp-press
> >  - st,lps25h-press
> >  - st,lps331ap-press
> > +- st,lps22hb-press
> > diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
> > index 6f2e7c9..a5fc260 100644
> > --- a/drivers/iio/pressure/Kconfig
> > +++ b/drivers/iio/pressure/Kconfig
> > @@ -101,7 +101,7 @@ config IIO_ST_PRESS
> >   select IIO_TRIGGERED_BUFFER if (IIO_BUFFER)
> >   help
> >     Say yes here to build support for STMicroelectronics pressure
> > -   sensors: LPS001WP, LPS25H, LPS331AP.
> > +   sensors: LPS001WP, LPS25H, LPS331AP, LPS22HB.
> >  
> >     This driver can also be built as a module. If so, these modules
> >     will be created:
> > diff --git a/drivers/iio/pressure/st_pressure.h
> > b/drivers/iio/pressure/st_pressure.h
> > index f5f4149..903a21e 100644
> > --- a/drivers/iio/pressure/st_pressure.h
> > +++ b/drivers/iio/pressure/st_pressure.h
> > @@ -17,6 +17,7 @@
> >  #define LPS001WP_PRESS_DEV_NAME "lps001wp"
> >  #define LPS25H_PRESS_DEV_NAME "lps25h"
> >  #define LPS331AP_PRESS_DEV_NAME "lps331ap"
> > +#define LPS22HB_PRESS_DEV_NAME "lps22hb"
> >  
> >  /**
> >   * struct st_sensors_platform_data - default press platform data
> > diff --git a/drivers/iio/pressure/st_pressure_core.c
> > b/drivers/iio/pressure/st_pressure_core.c
> > index 5056bd6..ecf3cd4 100644
> > --- a/drivers/iio/pressure/st_pressure_core.c
> > +++ b/drivers/iio/pressure/st_pressure_core.c
> > @@ -109,6 +109,26 @@
> >  #define ST_PRESS_LPS25H_OUT_XL_ADDR 0x28
> >  #define ST_TEMP_LPS25H_OUT_L_ADDR 0x2b
> >  
> > +/* CUSTOM VALUES FOR LPS22HB SENSOR */
> > +#define ST_PRESS_LPS22HB_WAI_EXP 0xb1
> > +#define ST_PRESS_LPS22HB_ODR_ADDR 0x10
> > +#define ST_PRESS_LPS22HB_ODR_MASK 0x70
> > +#define ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL 0x01
> > +#define ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL 0x02
> > +#define ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL 0x03
> > +#define ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL 0x04
> > +#define ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL 0x05
> > +#define ST_PRESS_LPS22HB_PW_ADDR 0x10
> > +#define ST_PRESS_LPS22HB_PW_MASK 0x70
> > +#define ST_PRESS_LPS22HB_BDU_ADDR 0x10
> > +#define ST_PRESS_LPS22HB_BDU_MASK 0x02
> > +#define ST_PRESS_LPS22HB_DRDY_IRQ_ADDR 0x12
> > +#define ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK 0x04
> > +#define ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK 0x08
> > +#define ST_PRESS_LPS22HB_IHL_IRQ_ADDR 0x12
> > +#define ST_PRESS_LPS22HB_IHL_IRQ_MASK 0x80
> > +#define ST_PRESS_LPS22HB_MULTIREAD_BIT true
> > +
> >  static const struct iio_chan_spec st_press_1_channels[] = {
> >   {
> >   .type = IIO_PRESSURE,
> > @@ -181,6 +201,27 @@ static const struct iio_chan_spec
> > st_press_lps001wp_channels[] = {
> >   IIO_CHAN_SOFT_TIMESTAMP(1)
> >  };
> >  
> > +static const struct iio_chan_spec st_press_lps22hb_channels[] = {
> > + {
> > + .type = IIO_PRESSURE,
> > + .channel2 = IIO_NO_MOD,
> > + .address = ST_PRESS_1_OUT_XL_ADDR,
> > + .scan_index = 0,
> > + .scan_type = {
> > + .sign = 'u',
> > + .realbits = 24,
> > + .storagebits = 24,
> > + .endianness = IIO_LE,
> > + },
> > + .info_mask_separate =
> > + BIT(IIO_CHAN_INFO_RAW) |
> > + BIT(IIO_CHAN_INFO_SCALE),
> > + .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ),
> > + .modified = 0,
> > + },
> > + IIO_CHAN_SOFT_TIMESTAMP(1)
> > +};
> > +
> >  static const struct st_sensor_settings st_press_sensors_settings[] = {
> >   {
> >   .wai = ST_PRESS_LPS331AP_WAI_EXP,
> > @@ -328,6 +369,49 @@ static const struct st_sensor_settings
> > st_press_sensors_settings[] = {
> >   .multi_read_bit = ST_PRESS_LPS25H_MULTIREAD_BIT,
> >   .bootime = 2,
> >   },
> > + {
> > + .wai = ST_PRESS_LPS22HB_WAI_EXP,
> > + .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
> > + .sensors_supported = {
> > + [0] = LPS22HB_PRESS_DEV_NAME,
> > + },
> > + .ch = (struct iio_chan_spec *)st_press_lps22hb_channels,
> > + .num_ch = ARRAY_SIZE(st_press_lps22hb_channels),
> > + .odr = {
> > + .addr = ST_PRESS_LPS22HB_ODR_ADDR,
> > + .mask = ST_PRESS_LPS22HB_ODR_MASK,
> > + .odr_avl = {
> > + { 1, ST_PRESS_LPS22HB_ODR_AVL_1HZ_VAL, },
> > + { 10, ST_PRESS_LPS22HB_ODR_AVL_10HZ_VAL, },
> > + { 25, ST_PRESS_LPS22HB_ODR_AVL_25HZ_VAL, },
> > + { 50, ST_PRESS_LPS22HB_ODR_AVL_50HZ_VAL, },
> > + { 75, ST_PRESS_LPS22HB_ODR_AVL_75HZ_VAL, },
> > + },
> > + },
> > + .pw = {
> > + .addr = ST_PRESS_LPS22HB_PW_ADDR,
> > + .mask = ST_PRESS_LPS22HB_PW_MASK,
> > + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
> > + },
> > + .fs = {
> > + .fs_avl = {
> > + [0] = {
> > + .num = ST_PRESS_FS_AVL_1260MB,
> > + .gain =
> > ST_PRESS_KPASCAL_NANO_SCALE,
> > + },
> > + },
> > + },
> > + .bdu = {
> > + .addr = ST_PRESS_LPS22HB_BDU_ADDR,
> > + .mask = ST_PRESS_LPS22HB_BDU_MASK,
> > + },
> > + .drdy_irq = {
> > + .addr = ST_PRESS_LPS22HB_DRDY_IRQ_ADDR,
> > + .mask_int1 = ST_PRESS_LPS22HB_DRDY_IRQ_INT1_MASK,
> > + .mask_int2 = ST_PRESS_LPS22HB_DRDY_IRQ_INT2_MASK,
> > + },
> > + .multi_read_bit = ST_PRESS_LPS22HB_MULTIREAD_BIT,
> > + },
> >  };
> >  
> >  static int st_press_write_raw(struct iio_dev *indio_dev,
> > @@ -456,10 +540,9 @@ int st_press_common_probe(struct iio_dev *indio_dev)
> >   indio_dev->channels = press_data->sensor_settings->ch;
> >   indio_dev->num_channels = press_data->sensor_settings->num_ch;
> >  
> > - if (press_data->sensor_settings->fs.addr != 0)
> > - press_data->current_fullscale =
> > - (struct st_sensor_fullscale_avl *)
> > - &press_data->sensor_settings->fs.fs_avl[0];
> > + press_data->current_fullscale =
> > + (struct st_sensor_fullscale_avl *)
> > + &press_data->sensor_settings->fs.fs_avl[0];
>
> Most of the rest appears to add code in a way that limits it to a specific hw.
> Except here ^ where I am not sure whether this could not have impact on
> existing
> hw using this driver. Was there any testing to check for potential
> regressions?
>
> -Stefan
>
The change here is initializing the current scaling settings for the sensor hw
to default values. The data structure which holds these values is immutable.
I've checked the code again and don't believe it'll cause any regressions.

I would have preferred to test this for different sensors, however we don't have
the required hardware.

-Shrirang

> >  
> >   press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz;
> >  
> > diff --git a/drivers/iio/pressure/st_pressure_i2c.c
> > b/drivers/iio/pressure/st_pressure_i2c.c
> > index 8fcf976..ed18701 100644
> > --- a/drivers/iio/pressure/st_pressure_i2c.c
> > +++ b/drivers/iio/pressure/st_pressure_i2c.c
> > @@ -32,6 +32,10 @@ static const struct of_device_id st_press_of_match[] = {
> >   .compatible = "st,lps331ap-press",
> >   .data = LPS331AP_PRESS_DEV_NAME,
> >   },
> > + {
> > + .compatible = "st,lps22hb-press",
> > + .data = LPS22HB_PRESS_DEV_NAME,
> > + },
> >   {},
> >  };
> >  MODULE_DEVICE_TABLE(of, st_press_of_match);
> > diff --git a/drivers/iio/pressure/st_pressure_spi.c
> > b/drivers/iio/pressure/st_pressure_spi.c
> > index 40c0692..5505080 100644
> > --- a/drivers/iio/pressure/st_pressure_spi.c
> > +++ b/drivers/iio/pressure/st_pressure_spi.c
> > @@ -50,6 +50,7 @@ static const struct spi_device_id st_press_id_table[] = {
> >   { LPS001WP_PRESS_DEV_NAME },
> >   { LPS25H_PRESS_DEV_NAME },
> >   { LPS331AP_PRESS_DEV_NAME },
> > + { LPS22HB_PRESS_DEV_NAME },
> >   {},
> >  };
> >  MODULE_DEVICE_TABLE(spi, st_press_id_table);
> >
>
>
--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (857 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ACK/cmnt: [[Xenial][SRU] 0/4] lps22hb pressure sensor support

Stefan Bader-2
In reply to this post by Shrirang Bagul
On 25.11.2016 05:31, Shrirang Bagul wrote:

> BugLink: https://launchpad.net/bugs/1642258
>
> This work is based on ver. Ubuntu-4.4.0-49.70 in Xenial kernel. The patches
> are backported and add support for lps22hb pressure sensor. This sensor is
> present on Dell IoT gateways.
>
> Gregor Boirie (4):
>   iio:st_pressure:initial lps22hb sensor support
>   iio:st_pressure: align storagebits on power of 2
>   iio:st_pressure: document sampling gains
>   iio:st_pressure:lps22hb: temperature support
>
>  .../devicetree/bindings/iio/st-sensors.txt         |   1 +
>  drivers/iio/pressure/Kconfig                       |   2 +-
>  drivers/iio/pressure/st_pressure.h                 |   1 +
>  drivers/iio/pressure/st_pressure_core.c            | 203 ++++++++++++++++++++-
>  drivers/iio/pressure/st_pressure_i2c.c             |   4 +
>  drivers/iio/pressure/st_pressure_spi.c             |   1 +
>  6 files changed, 203 insertions(+), 9 deletions(-)
>
So based on feedback the risk could be tolerable. Again set might need a bit of
adaption (cherry-pick / SAUCE) when applying.

-Stefan


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED w/cmt: [[Xenial][SRU] 0/4] lps22hb pressure sensor support

Luis Henriques
In reply to this post by Shrirang Bagul
Applied to xenial master-next branch, and also the fix for bug #1644726
("AD5593R configurable multi-channel converter support").  However, I've
added an additional patch to enable the new modules (see below).

Cheers,
--
Luís

commit f4c9fe1a056e35a62f7648f3ea0f14adf62f0d2c
Author: Luis Henriques <[hidden email]>
Date:   Tue Nov 29 16:11:06 2016 +0000

    UBUNTU: [Config] CONFIG_AD5592R/AD5593R=m
   
    BugLink: https://launchpad.net/bugs/1644726
   
    Signed-off-by: Luis Henriques <[hidden email]>

diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu
index cd9fb60780a1..b0dac7a841a6 100644
--- a/debian.master/config/config.common.ubuntu
+++ b/debian.master/config/config.common.ubuntu
@@ -108,6 +108,9 @@ CONFIG_AD5421=m
 CONFIG_AD5446=m
 CONFIG_AD5449=m
 CONFIG_AD5504=m
+CONFIG_AD5592R=m
+CONFIG_AD5592R_BASE=m
+CONFIG_AD5593R=m
 CONFIG_AD5624R_SPI=m
 CONFIG_AD5686=m
 CONFIG_AD5755=m

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (836 bytes) Download Attachment