]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Mon, 3 Feb 2020 03:01:13 +0000 (22:01 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 3 Feb 2020 03:01:13 +0000 (22:01 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/crypto-pcrypt-fix-user-after-free-on-module-unload.patch [new file with mode: 0644]
queue-4.9/iio-gyro-st_gyro-fix-l3gd20h-support.patch [new file with mode: 0644]
queue-4.9/iio-gyro-st_gyro-inline-per-sensor-data.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/crypto-pcrypt-fix-user-after-free-on-module-unload.patch b/queue-4.9/crypto-pcrypt-fix-user-after-free-on-module-unload.patch
new file mode 100644 (file)
index 0000000..b3b4dc3
--- /dev/null
@@ -0,0 +1,43 @@
+From 366369ddb0ae92d97a11ddf76ea59d540a7eaf1c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 19 Nov 2019 17:41:31 +0800
+Subject: crypto: pcrypt - Fix user-after-free on module unload
+
+From: Herbert Xu <herbert@gondor.apana.org.au>
+
+[ Upstream commit 07bfd9bdf568a38d9440c607b72342036011f727 ]
+
+On module unload of pcrypt we must unregister the crypto algorithms
+first and then tear down the padata structure.  As otherwise the
+crypto algorithms are still alive and can be used while the padata
+structure is being freed.
+
+Fixes: 5068c7a883d1 ("crypto: pcrypt - Add pcrypt crypto...")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ crypto/pcrypt.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c
+index a5718c0a3dc4e..1348541da463a 100644
+--- a/crypto/pcrypt.c
++++ b/crypto/pcrypt.c
+@@ -505,11 +505,12 @@ static int __init pcrypt_init(void)
+ static void __exit pcrypt_exit(void)
+ {
++      crypto_unregister_template(&pcrypt_tmpl);
++
+       pcrypt_fini_padata(&pencrypt);
+       pcrypt_fini_padata(&pdecrypt);
+       kset_unregister(pcrypt_kset);
+-      crypto_unregister_template(&pcrypt_tmpl);
+ }
+ module_init(pcrypt_init);
+-- 
+2.20.1
+
diff --git a/queue-4.9/iio-gyro-st_gyro-fix-l3gd20h-support.patch b/queue-4.9/iio-gyro-st_gyro-fix-l3gd20h-support.patch
new file mode 100644 (file)
index 0000000..5b26d18
--- /dev/null
@@ -0,0 +1,125 @@
+From 0c19ba18aa84c0f896b00190e6407214668cccd3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 19 Jun 2017 22:04:30 +0200
+Subject: iio: gyro: st_gyro: fix L3GD20H support
+
+From: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+
+[ Upstream commit 45a4e4220bf4927e321e18750e47c576bf62b000 ]
+
+Add proper support for L3GD20H gyroscope sensor. In particular:
+- use L3GD20H as device name instead of L3GD20
+- fix available full scales
+- fix available sample frequencies
+
+Note that the original patch listed first below introduced broken support for
+this part.  The second patch drops the support as it didn't work.
+
+This new patch brings in working support.
+
+Fixes: 9444a300c2be (IIO: Add support for L3GD20H gyroscope)
+Fixes: a0657716416f ("iio:gyro: bug on L3GD20H gyroscope support")
+Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/gyro/st_gyro.h      |  1 +
+ drivers/iio/gyro/st_gyro_core.c | 13 +++++++------
+ drivers/iio/gyro/st_gyro_i2c.c  |  5 +++++
+ drivers/iio/gyro/st_gyro_spi.c  |  1 +
+ 4 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/iio/gyro/st_gyro.h b/drivers/iio/gyro/st_gyro.h
+index a5c5c4e29addc..48923ae6ac3bd 100644
+--- a/drivers/iio/gyro/st_gyro.h
++++ b/drivers/iio/gyro/st_gyro.h
+@@ -19,6 +19,7 @@
+ #define LSM330DL_GYRO_DEV_NAME                "lsm330dl_gyro"
+ #define LSM330DLC_GYRO_DEV_NAME               "lsm330dlc_gyro"
+ #define L3GD20_GYRO_DEV_NAME          "l3gd20"
++#define L3GD20H_GYRO_DEV_NAME         "l3gd20h"
+ #define L3G4IS_GYRO_DEV_NAME          "l3g4is_ui"
+ #define LSM330_GYRO_DEV_NAME          "lsm330_gyro"
+ #define LSM9DS0_GYRO_DEV_NAME         "lsm9ds0_gyro"
+diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
+index 2a42b3d583e85..e366422e85127 100644
+--- a/drivers/iio/gyro/st_gyro_core.c
++++ b/drivers/iio/gyro/st_gyro_core.c
+@@ -35,6 +35,7 @@
+ #define ST_GYRO_DEFAULT_OUT_Z_L_ADDR          0x2c
+ /* FULLSCALE */
++#define ST_GYRO_FS_AVL_245DPS                 245
+ #define ST_GYRO_FS_AVL_250DPS                 250
+ #define ST_GYRO_FS_AVL_500DPS                 500
+ #define ST_GYRO_FS_AVL_2000DPS                        2000
+@@ -196,17 +197,17 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+               .wai = 0xd7,
+               .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+               .sensors_supported = {
+-                      [0] = L3GD20_GYRO_DEV_NAME,
++                      [0] = L3GD20H_GYRO_DEV_NAME,
+               },
+               .ch = (struct iio_chan_spec *)st_gyro_16bit_channels,
+               .odr = {
+                       .addr = 0x20,
+                       .mask = 0xc0,
+                       .odr_avl = {
+-                              { .hz = 95, .value = 0x00, },
+-                              { .hz = 190, .value = 0x01, },
+-                              { .hz = 380, .value = 0x02, },
+-                              { .hz = 760, .value = 0x03, },
++                              { .hz = 100, .value = 0x00, },
++                              { .hz = 200, .value = 0x01, },
++                              { .hz = 400, .value = 0x02, },
++                              { .hz = 800, .value = 0x03, },
+                       },
+               },
+               .pw = {
+@@ -224,7 +225,7 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                       .mask = 0x30,
+                       .fs_avl = {
+                               [0] = {
+-                                      .num = ST_GYRO_FS_AVL_250DPS,
++                                      .num = ST_GYRO_FS_AVL_245DPS,
+                                       .value = 0x00,
+                                       .gain = IIO_DEGREE_TO_RAD(8750),
+                               },
+diff --git a/drivers/iio/gyro/st_gyro_i2c.c b/drivers/iio/gyro/st_gyro_i2c.c
+index 40056b8210364..3f628746cb93e 100644
+--- a/drivers/iio/gyro/st_gyro_i2c.c
++++ b/drivers/iio/gyro/st_gyro_i2c.c
+@@ -40,6 +40,10 @@ static const struct of_device_id st_gyro_of_match[] = {
+               .compatible = "st,l3gd20-gyro",
+               .data = L3GD20_GYRO_DEV_NAME,
+       },
++      {
++              .compatible = "st,l3gd20h-gyro",
++              .data = L3GD20H_GYRO_DEV_NAME,
++      },
+       {
+               .compatible = "st,l3g4is-gyro",
+               .data = L3G4IS_GYRO_DEV_NAME,
+@@ -95,6 +99,7 @@ static const struct i2c_device_id st_gyro_id_table[] = {
+       { LSM330DL_GYRO_DEV_NAME },
+       { LSM330DLC_GYRO_DEV_NAME },
+       { L3GD20_GYRO_DEV_NAME },
++      { L3GD20H_GYRO_DEV_NAME },
+       { L3G4IS_GYRO_DEV_NAME },
+       { LSM330_GYRO_DEV_NAME },
+       { LSM9DS0_GYRO_DEV_NAME },
+diff --git a/drivers/iio/gyro/st_gyro_spi.c b/drivers/iio/gyro/st_gyro_spi.c
+index fbf2faed501c8..fa14d8f2170d7 100644
+--- a/drivers/iio/gyro/st_gyro_spi.c
++++ b/drivers/iio/gyro/st_gyro_spi.c
+@@ -52,6 +52,7 @@ static const struct spi_device_id st_gyro_id_table[] = {
+       { LSM330DL_GYRO_DEV_NAME },
+       { LSM330DLC_GYRO_DEV_NAME },
+       { L3GD20_GYRO_DEV_NAME },
++      { L3GD20H_GYRO_DEV_NAME },
+       { L3G4IS_GYRO_DEV_NAME },
+       { LSM330_GYRO_DEV_NAME },
+       { LSM9DS0_GYRO_DEV_NAME },
+-- 
+2.20.1
+
diff --git a/queue-4.9/iio-gyro-st_gyro-inline-per-sensor-data.patch b/queue-4.9/iio-gyro-st_gyro-inline-per-sensor-data.patch
new file mode 100644 (file)
index 0000000..0b995c1
--- /dev/null
@@ -0,0 +1,387 @@
+From b21d64ba7ac88f9992c167042174299f483a5254 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 9 Nov 2016 16:09:58 +0100
+Subject: iio: gyro: st_gyro: inline per-sensor data
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+[ Upstream commit d8594fa22a3f7c294639d9aa2959d63e66d9437c ]
+
+We have #defines for all the individual sensor registers and
+value/mask pairs #defined at the top of the file and used at
+exactly one spot.
+
+This is usually good if the #defines give a meaning to the
+opaque magic numbers.
+
+However in this case, the semantic meaning is inherent in the
+name of the C99-addressable fields, and that means duplication
+of information, and only makes the code hard to maintain since
+you every time have to add a new #define AND update the site
+where it is to be used.
+
+Get rid of the #defines and just open code the values into the
+appropriate struct elements. Make sure to explicitly address
+the .hz and .value fields in the st_sensor_odr_avl struct
+so that the meaning of all values is clear.
+
+This patch is purely syntactic should have no semantic effect.
+
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Jonathan Cameron <jic23@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/iio/gyro/st_gyro_core.c | 205 ++++++++++----------------------
+ 1 file changed, 66 insertions(+), 139 deletions(-)
+
+diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
+index aea034d8fe0fb..2a42b3d583e85 100644
+--- a/drivers/iio/gyro/st_gyro_core.c
++++ b/drivers/iio/gyro/st_gyro_core.c
+@@ -39,79 +39,6 @@
+ #define ST_GYRO_FS_AVL_500DPS                 500
+ #define ST_GYRO_FS_AVL_2000DPS                        2000
+-/* CUSTOM VALUES FOR SENSOR 1 */
+-#define ST_GYRO_1_WAI_EXP                     0xd3
+-#define ST_GYRO_1_ODR_ADDR                    0x20
+-#define ST_GYRO_1_ODR_MASK                    0xc0
+-#define ST_GYRO_1_ODR_AVL_100HZ_VAL           0x00
+-#define ST_GYRO_1_ODR_AVL_200HZ_VAL           0x01
+-#define ST_GYRO_1_ODR_AVL_400HZ_VAL           0x02
+-#define ST_GYRO_1_ODR_AVL_800HZ_VAL           0x03
+-#define ST_GYRO_1_PW_ADDR                     0x20
+-#define ST_GYRO_1_PW_MASK                     0x08
+-#define ST_GYRO_1_FS_ADDR                     0x23
+-#define ST_GYRO_1_FS_MASK                     0x30
+-#define ST_GYRO_1_FS_AVL_250_VAL              0x00
+-#define ST_GYRO_1_FS_AVL_500_VAL              0x01
+-#define ST_GYRO_1_FS_AVL_2000_VAL             0x02
+-#define ST_GYRO_1_FS_AVL_250_GAIN             IIO_DEGREE_TO_RAD(8750)
+-#define ST_GYRO_1_FS_AVL_500_GAIN             IIO_DEGREE_TO_RAD(17500)
+-#define ST_GYRO_1_FS_AVL_2000_GAIN            IIO_DEGREE_TO_RAD(70000)
+-#define ST_GYRO_1_BDU_ADDR                    0x23
+-#define ST_GYRO_1_BDU_MASK                    0x80
+-#define ST_GYRO_1_DRDY_IRQ_ADDR                       0x22
+-#define ST_GYRO_1_DRDY_IRQ_INT2_MASK          0x08
+-#define ST_GYRO_1_MULTIREAD_BIT                       true
+-
+-/* CUSTOM VALUES FOR SENSOR 2 */
+-#define ST_GYRO_2_WAI_EXP                     0xd4
+-#define ST_GYRO_2_ODR_ADDR                    0x20
+-#define ST_GYRO_2_ODR_MASK                    0xc0
+-#define ST_GYRO_2_ODR_AVL_95HZ_VAL            0x00
+-#define ST_GYRO_2_ODR_AVL_190HZ_VAL           0x01
+-#define ST_GYRO_2_ODR_AVL_380HZ_VAL           0x02
+-#define ST_GYRO_2_ODR_AVL_760HZ_VAL           0x03
+-#define ST_GYRO_2_PW_ADDR                     0x20
+-#define ST_GYRO_2_PW_MASK                     0x08
+-#define ST_GYRO_2_FS_ADDR                     0x23
+-#define ST_GYRO_2_FS_MASK                     0x30
+-#define ST_GYRO_2_FS_AVL_250_VAL              0x00
+-#define ST_GYRO_2_FS_AVL_500_VAL              0x01
+-#define ST_GYRO_2_FS_AVL_2000_VAL             0x02
+-#define ST_GYRO_2_FS_AVL_250_GAIN             IIO_DEGREE_TO_RAD(8750)
+-#define ST_GYRO_2_FS_AVL_500_GAIN             IIO_DEGREE_TO_RAD(17500)
+-#define ST_GYRO_2_FS_AVL_2000_GAIN            IIO_DEGREE_TO_RAD(70000)
+-#define ST_GYRO_2_BDU_ADDR                    0x23
+-#define ST_GYRO_2_BDU_MASK                    0x80
+-#define ST_GYRO_2_DRDY_IRQ_ADDR                       0x22
+-#define ST_GYRO_2_DRDY_IRQ_INT2_MASK          0x08
+-#define ST_GYRO_2_MULTIREAD_BIT                       true
+-
+-/* CUSTOM VALUES FOR SENSOR 3 */
+-#define ST_GYRO_3_WAI_EXP                     0xd7
+-#define ST_GYRO_3_ODR_ADDR                    0x20
+-#define ST_GYRO_3_ODR_MASK                    0xc0
+-#define ST_GYRO_3_ODR_AVL_95HZ_VAL            0x00
+-#define ST_GYRO_3_ODR_AVL_190HZ_VAL           0x01
+-#define ST_GYRO_3_ODR_AVL_380HZ_VAL           0x02
+-#define ST_GYRO_3_ODR_AVL_760HZ_VAL           0x03
+-#define ST_GYRO_3_PW_ADDR                     0x20
+-#define ST_GYRO_3_PW_MASK                     0x08
+-#define ST_GYRO_3_FS_ADDR                     0x23
+-#define ST_GYRO_3_FS_MASK                     0x30
+-#define ST_GYRO_3_FS_AVL_250_VAL              0x00
+-#define ST_GYRO_3_FS_AVL_500_VAL              0x01
+-#define ST_GYRO_3_FS_AVL_2000_VAL             0x02
+-#define ST_GYRO_3_FS_AVL_250_GAIN             IIO_DEGREE_TO_RAD(8750)
+-#define ST_GYRO_3_FS_AVL_500_GAIN             IIO_DEGREE_TO_RAD(17500)
+-#define ST_GYRO_3_FS_AVL_2000_GAIN            IIO_DEGREE_TO_RAD(70000)
+-#define ST_GYRO_3_BDU_ADDR                    0x23
+-#define ST_GYRO_3_BDU_MASK                    0x80
+-#define ST_GYRO_3_DRDY_IRQ_ADDR                       0x22
+-#define ST_GYRO_3_DRDY_IRQ_INT2_MASK          0x08
+-#define ST_GYRO_3_MULTIREAD_BIT                       true
+-
+-
+ static const struct iio_chan_spec st_gyro_16bit_channels[] = {
+       ST_SENSORS_LSM_CHANNELS(IIO_ANGL_VEL,
+                       BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
+@@ -130,7 +57,7 @@ static const struct iio_chan_spec st_gyro_16bit_channels[] = {
+ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+       {
+-              .wai = ST_GYRO_1_WAI_EXP,
++              .wai = 0xd3,
+               .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+               .sensors_supported = {
+                       [0] = L3G4200D_GYRO_DEV_NAME,
+@@ -138,18 +65,18 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+               },
+               .ch = (struct iio_chan_spec *)st_gyro_16bit_channels,
+               .odr = {
+-                      .addr = ST_GYRO_1_ODR_ADDR,
+-                      .mask = ST_GYRO_1_ODR_MASK,
++                      .addr = 0x20,
++                      .mask = 0xc0,
+                       .odr_avl = {
+-                              { 100, ST_GYRO_1_ODR_AVL_100HZ_VAL, },
+-                              { 200, ST_GYRO_1_ODR_AVL_200HZ_VAL, },
+-                              { 400, ST_GYRO_1_ODR_AVL_400HZ_VAL, },
+-                              { 800, ST_GYRO_1_ODR_AVL_800HZ_VAL, },
++                              { .hz = 100, .value = 0x00, },
++                              { .hz = 200, .value = 0x01, },
++                              { .hz = 400, .value = 0x02, },
++                              { .hz = 800, .value = 0x03, },
+                       },
+               },
+               .pw = {
+-                      .addr = ST_GYRO_1_PW_ADDR,
+-                      .mask = ST_GYRO_1_PW_MASK,
++                      .addr = 0x20,
++                      .mask = 0x08,
+                       .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
+                       .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+               },
+@@ -158,33 +85,33 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                       .mask = ST_SENSORS_DEFAULT_AXIS_MASK,
+               },
+               .fs = {
+-                      .addr = ST_GYRO_1_FS_ADDR,
+-                      .mask = ST_GYRO_1_FS_MASK,
++                      .addr = 0x23,
++                      .mask = 0x30,
+                       .fs_avl = {
+                               [0] = {
+                                       .num = ST_GYRO_FS_AVL_250DPS,
+-                                      .value = ST_GYRO_1_FS_AVL_250_VAL,
+-                                      .gain = ST_GYRO_1_FS_AVL_250_GAIN,
++                                      .value = 0x00,
++                                      .gain = IIO_DEGREE_TO_RAD(8750),
+                               },
+                               [1] = {
+                                       .num = ST_GYRO_FS_AVL_500DPS,
+-                                      .value = ST_GYRO_1_FS_AVL_500_VAL,
+-                                      .gain = ST_GYRO_1_FS_AVL_500_GAIN,
++                                      .value = 0x01,
++                                      .gain = IIO_DEGREE_TO_RAD(17500),
+                               },
+                               [2] = {
+                                       .num = ST_GYRO_FS_AVL_2000DPS,
+-                                      .value = ST_GYRO_1_FS_AVL_2000_VAL,
+-                                      .gain = ST_GYRO_1_FS_AVL_2000_GAIN,
++                                      .value = 0x02,
++                                      .gain = IIO_DEGREE_TO_RAD(70000),
+                               },
+                       },
+               },
+               .bdu = {
+-                      .addr = ST_GYRO_1_BDU_ADDR,
+-                      .mask = ST_GYRO_1_BDU_MASK,
++                      .addr = 0x23,
++                      .mask = 0x80,
+               },
+               .drdy_irq = {
+-                      .addr = ST_GYRO_1_DRDY_IRQ_ADDR,
+-                      .mask_int2 = ST_GYRO_1_DRDY_IRQ_INT2_MASK,
++                      .addr = 0x22,
++                      .mask_int2 = 0x08,
+                       /*
+                        * The sensor has IHL (active low) and open
+                        * drain settings, but only for INT1 and not
+@@ -192,11 +119,11 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                        */
+                       .addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
+               },
+-              .multi_read_bit = ST_GYRO_1_MULTIREAD_BIT,
++              .multi_read_bit = true,
+               .bootime = 2,
+       },
+       {
+-              .wai = ST_GYRO_2_WAI_EXP,
++              .wai = 0xd4,
+               .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+               .sensors_supported = {
+                       [0] = L3GD20_GYRO_DEV_NAME,
+@@ -208,18 +135,18 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+               },
+               .ch = (struct iio_chan_spec *)st_gyro_16bit_channels,
+               .odr = {
+-                      .addr = ST_GYRO_2_ODR_ADDR,
+-                      .mask = ST_GYRO_2_ODR_MASK,
++                      .addr = 0x20,
++                      .mask = 0xc0,
+                       .odr_avl = {
+-                              { 95, ST_GYRO_2_ODR_AVL_95HZ_VAL, },
+-                              { 190, ST_GYRO_2_ODR_AVL_190HZ_VAL, },
+-                              { 380, ST_GYRO_2_ODR_AVL_380HZ_VAL, },
+-                              { 760, ST_GYRO_2_ODR_AVL_760HZ_VAL, },
++                              { .hz = 95, .value = 0x00, },
++                              { .hz = 190, .value = 0x01, },
++                              { .hz = 380, .value = 0x02, },
++                              { .hz = 760, .value = 0x03, },
+                       },
+               },
+               .pw = {
+-                      .addr = ST_GYRO_2_PW_ADDR,
+-                      .mask = ST_GYRO_2_PW_MASK,
++                      .addr = 0x20,
++                      .mask = 0x08,
+                       .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
+                       .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+               },
+@@ -228,33 +155,33 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                       .mask = ST_SENSORS_DEFAULT_AXIS_MASK,
+               },
+               .fs = {
+-                      .addr = ST_GYRO_2_FS_ADDR,
+-                      .mask = ST_GYRO_2_FS_MASK,
++                      .addr = 0x23,
++                      .mask = 0x30,
+                       .fs_avl = {
+                               [0] = {
+                                       .num = ST_GYRO_FS_AVL_250DPS,
+-                                      .value = ST_GYRO_2_FS_AVL_250_VAL,
+-                                      .gain = ST_GYRO_2_FS_AVL_250_GAIN,
++                                      .value = 0x00,
++                                      .gain = IIO_DEGREE_TO_RAD(8750),
+                               },
+                               [1] = {
+                                       .num = ST_GYRO_FS_AVL_500DPS,
+-                                      .value = ST_GYRO_2_FS_AVL_500_VAL,
+-                                      .gain = ST_GYRO_2_FS_AVL_500_GAIN,
++                                      .value = 0x01,
++                                      .gain = IIO_DEGREE_TO_RAD(17500),
+                               },
+                               [2] = {
+                                       .num = ST_GYRO_FS_AVL_2000DPS,
+-                                      .value = ST_GYRO_2_FS_AVL_2000_VAL,
+-                                      .gain = ST_GYRO_2_FS_AVL_2000_GAIN,
++                                      .value = 0x02,
++                                      .gain = IIO_DEGREE_TO_RAD(70000),
+                               },
+                       },
+               },
+               .bdu = {
+-                      .addr = ST_GYRO_2_BDU_ADDR,
+-                      .mask = ST_GYRO_2_BDU_MASK,
++                      .addr = 0x23,
++                      .mask = 0x80,
+               },
+               .drdy_irq = {
+-                      .addr = ST_GYRO_2_DRDY_IRQ_ADDR,
+-                      .mask_int2 = ST_GYRO_2_DRDY_IRQ_INT2_MASK,
++                      .addr = 0x22,
++                      .mask_int2 = 0x08,
+                       /*
+                        * The sensor has IHL (active low) and open
+                        * drain settings, but only for INT1 and not
+@@ -262,29 +189,29 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                        */
+                       .addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
+               },
+-              .multi_read_bit = ST_GYRO_2_MULTIREAD_BIT,
++              .multi_read_bit = true,
+               .bootime = 2,
+       },
+       {
+-              .wai = ST_GYRO_3_WAI_EXP,
++              .wai = 0xd7,
+               .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
+               .sensors_supported = {
+                       [0] = L3GD20_GYRO_DEV_NAME,
+               },
+               .ch = (struct iio_chan_spec *)st_gyro_16bit_channels,
+               .odr = {
+-                      .addr = ST_GYRO_3_ODR_ADDR,
+-                      .mask = ST_GYRO_3_ODR_MASK,
++                      .addr = 0x20,
++                      .mask = 0xc0,
+                       .odr_avl = {
+-                              { 95, ST_GYRO_3_ODR_AVL_95HZ_VAL, },
+-                              { 190, ST_GYRO_3_ODR_AVL_190HZ_VAL, },
+-                              { 380, ST_GYRO_3_ODR_AVL_380HZ_VAL, },
+-                              { 760, ST_GYRO_3_ODR_AVL_760HZ_VAL, },
++                              { .hz = 95, .value = 0x00, },
++                              { .hz = 190, .value = 0x01, },
++                              { .hz = 380, .value = 0x02, },
++                              { .hz = 760, .value = 0x03, },
+                       },
+               },
+               .pw = {
+-                      .addr = ST_GYRO_3_PW_ADDR,
+-                      .mask = ST_GYRO_3_PW_MASK,
++                      .addr = 0x20,
++                      .mask = 0x08,
+                       .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE,
+                       .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE,
+               },
+@@ -293,33 +220,33 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                       .mask = ST_SENSORS_DEFAULT_AXIS_MASK,
+               },
+               .fs = {
+-                      .addr = ST_GYRO_3_FS_ADDR,
+-                      .mask = ST_GYRO_3_FS_MASK,
++                      .addr = 0x23,
++                      .mask = 0x30,
+                       .fs_avl = {
+                               [0] = {
+                                       .num = ST_GYRO_FS_AVL_250DPS,
+-                                      .value = ST_GYRO_3_FS_AVL_250_VAL,
+-                                      .gain = ST_GYRO_3_FS_AVL_250_GAIN,
++                                      .value = 0x00,
++                                      .gain = IIO_DEGREE_TO_RAD(8750),
+                               },
+                               [1] = {
+                                       .num = ST_GYRO_FS_AVL_500DPS,
+-                                      .value = ST_GYRO_3_FS_AVL_500_VAL,
+-                                      .gain = ST_GYRO_3_FS_AVL_500_GAIN,
++                                      .value = 0x01,
++                                      .gain = IIO_DEGREE_TO_RAD(17500),
+                               },
+                               [2] = {
+                                       .num = ST_GYRO_FS_AVL_2000DPS,
+-                                      .value = ST_GYRO_3_FS_AVL_2000_VAL,
+-                                      .gain = ST_GYRO_3_FS_AVL_2000_GAIN,
++                                      .value = 0x02,
++                                      .gain = IIO_DEGREE_TO_RAD(70000),
+                               },
+                       },
+               },
+               .bdu = {
+-                      .addr = ST_GYRO_3_BDU_ADDR,
+-                      .mask = ST_GYRO_3_BDU_MASK,
++                      .addr = 0x23,
++                      .mask = 0x80,
+               },
+               .drdy_irq = {
+-                      .addr = ST_GYRO_3_DRDY_IRQ_ADDR,
+-                      .mask_int2 = ST_GYRO_3_DRDY_IRQ_INT2_MASK,
++                      .addr = 0x22,
++                      .mask_int2 = 0x08,
+                       /*
+                        * The sensor has IHL (active low) and open
+                        * drain settings, but only for INT1 and not
+@@ -327,7 +254,7 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = {
+                        */
+                       .addr_stat_drdy = ST_SENSORS_DEFAULT_STAT_ADDR,
+               },
+-              .multi_read_bit = ST_GYRO_3_MULTIREAD_BIT,
++              .multi_read_bit = true,
+               .bootime = 2,
+       },
+ };
+-- 
+2.20.1
+
index 9e67e3c0c36961caa0de346c2f1f312d83b1428b..8bf6c5c819412875d0b472545dc2a9357410c159 100644 (file)
@@ -24,3 +24,6 @@ usb-storage-disable-uas-on-jmicron-sata-enclosure.patch
 net_sched-ematch-reject-invalid-tcf_em_simple.patch
 crypto-af_alg-use-bh_lock_sock-in-sk_destruct.patch
 vfs-fix-do_last-regression.patch
+crypto-pcrypt-fix-user-after-free-on-module-unload.patch
+iio-gyro-st_gyro-inline-per-sensor-data.patch
+iio-gyro-st_gyro-fix-l3gd20h-support.patch