Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15, v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4, v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48, v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39 |
|
#
6811694e |
| 14-Jul-2023 |
Alejandro Tafalla <atafalla@dnyon.com> |
iio: imu: lsm6dsx: Fix mount matrix retrieval
The function lsm6dsx_get_acpi_mount_matrix should return an error when ACPI support is not enabled to allow executing iio_read_mount_matrix in the probe
iio: imu: lsm6dsx: Fix mount matrix retrieval
The function lsm6dsx_get_acpi_mount_matrix should return an error when ACPI support is not enabled to allow executing iio_read_mount_matrix in the probe function.
Fixes: dc3d25f22b88 ("iio: imu: lsm6dsx: Add ACPI mount matrix retrieval") Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20230714153132.27265-1-atafalla@dnyon.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29, v6.1.28, v6.1.27, v6.1.26, v6.3, v6.1.25, v6.1.24, v6.1.23, v6.1.22, v6.1.21, v6.1.20, v6.1.19, v6.1.18, v6.1.17, v6.1.16, v6.1.15, v6.1.14, v6.1.13, v6.2, v6.1.12, v6.1.11, v6.1.10, v6.1.9 |
|
#
dc3d25f2 |
| 30-Jan-2023 |
Jonathan Cameron <Jonathan.Cameron@huawei.com> |
iio: imu: lsm6dsx: Add ACPI mount matrix retrieval
DSDT ROTM method seen in the wild with SMO8B30 _HID. Making assumption it is similar to that used for bmc150 plus information from Darrell that the
iio: imu: lsm6dsx: Add ACPI mount matrix retrieval
DSDT ROTM method seen in the wild with SMO8B30 _HID. Making assumption it is similar to that used for bmc150 plus information from Darrell that the rotation is out by 90 degrees at boot.
Method (ROTM, 0, NotSerialized) { Name (RBUF, Package (0x03) { "0 -1 0", "1 0 0", "0 0 1" }) Return (RBUF) /* \_SB_.PCI0.I2C5.DEV_.ROTM.RBUF */ }
Reported-by: Darrell Kavanagh <darrell.kavanagh@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Tested-by: Darrell Kavanagh <darrell.kavanagh@gmail.org> Link: https://lore.kernel.org/r/20230130201018.981024-3-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
18462d08 |
| 06-Mar-2023 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to ASM330LHB
Add support to STM ASM330LHB (acc + gyro) automotive Mems sensor. The ASM330LHB sensor can use ASM330LHH as fallback device since it implements all the
iio: imu: st_lsm6dsx: add support to ASM330LHB
Add support to STM ASM330LHB (acc + gyro) automotive Mems sensor. The ASM330LHB sensor can use ASM330LHH as fallback device since it implements all the ASM330LHB features currently implemented in st_lsm6dsx.
Datasheet: https://www.st.com/resource/en/datasheet/asm330lhb.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/a1d675457da7aa9e979d8cabea410e942e015e71.1678100533.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
db3c4905 |
| 27-Feb-2023 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: discard samples during filters settling time
During digital filters settling time the driver is expected to drop samples since they can be corrupted. Introduce the capability t
iio: imu: st_lsm6dsx: discard samples during filters settling time
During digital filters settling time the driver is expected to drop samples since they can be corrupted. Introduce the capability to drop a given number of samples according to the configured ODR. Add sample_to_discard for LSM6DSM-like sensors since new generation devices (e.g. LSM6DSO) support DRDY mask where corrupted samples are masked in hw with values greather than 0x7ffd so the driver can easily discard them. I have not added sample_to_discard support for LSM6DS3 or LSM6DS3H since I do not have any sample for testing at the moment.
Reported-by: Philippe De Muyter <phdm@macqel.be> Tested-by: Philippe De Muyter <phdm@macqel.be> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/21dcd94935c147ef9b1da4984b3da6264ee9609e.1677496295.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.1.8, v6.1.7, v6.1.6, v6.1.5, v6.0.19, v6.0.18, v6.1.4, v6.1.3, v6.0.17, v6.1.2, v6.0.16, v6.1.1, v6.0.15, v6.0.14, v6.0.13, v6.1, v6.0.12, v6.0.11, v6.0.10, v5.15.80 |
|
#
3a042fda |
| 24-Nov-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to ISM330IS
Add support to STM ISM330IS (accelerometer and gyroscope) Mems sensor. The ISM330IS sensor can use LSM6DSO16IS as fallback device since it implements al
iio: imu: st_lsm6dsx: add support to ISM330IS
Add support to STM ISM330IS (accelerometer and gyroscope) Mems sensor. The ISM330IS sensor can use LSM6DSO16IS as fallback device since it implements all the ISM330IS features currently implemented in st_lsm6dsx.
Datasheet: https://www.st.com/resource/en/datasheet/ism330is.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/4cd1614060e06f49cd92f5930d8fd40117c07920.1669279604.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
f35e1ee9 |
| 16-Nov-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to LSM6DSO16IS
Add support to STM LSM6DSO16IS (accelerometer and gyroscope) Mems sensor.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dso16is.pdf Tested
iio: imu: st_lsm6dsx: add support to LSM6DSO16IS
Add support to STM LSM6DSO16IS (accelerometer and gyroscope) Mems sensor.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dso16is.pdf Tested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/df6a9d4653cd69f7204190f8b6a9b618fd48bd23.1668605631.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.0.9, v5.15.79 |
|
#
d94fbd92 |
| 14-Nov-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: fix LSM6DSV sensor description
Fix sensor ODR description for LSM6DSV/LSM6DSVX
Fixes: a1c6d631ff12 ("iio: imu: st_lsm6dsx: add support to LSM6DSV") Signed-off-by: Lorenzo Bian
iio: imu: st_lsm6dsx: fix LSM6DSV sensor description
Fix sensor ODR description for LSM6DSV/LSM6DSVX
Fixes: a1c6d631ff12 ("iio: imu: st_lsm6dsx: add support to LSM6DSV") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/653e14bf79bb88d8581d2bc42da2f784caaf3776.1668417770.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.0.8, v5.15.78 |
|
#
46975081 |
| 06-Nov-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to LSM6DSV16X
Add support to STM LSM6DSV16X (accelerometer and gyroscope) Mems sensor. The LSM6DSV16X sensor can use LSM6DSV as fallback device since it implements
iio: imu: st_lsm6dsx: add support to LSM6DSV16X
Add support to STM LSM6DSV16X (accelerometer and gyroscope) Mems sensor. The LSM6DSV16X sensor can use LSM6DSV as fallback device since it implements all the LSM6DSV16X features currently implemented in st_lsm6dsx.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dsv16x.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/284b251f861dff30c399e5736a843c8e3a497249.1667745215.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.0.7, v5.15.77 |
|
#
a1c6d631 |
| 31-Oct-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to LSM6DSV
Add support to STM LSM6DSV (accelerometer and gyroscope) Mems sensor.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dsv.pdf Signed-off-by: Lor
iio: imu: st_lsm6dsx: add support to LSM6DSV
Add support to STM LSM6DSV (accelerometer and gyroscope) Mems sensor.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dsv.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/aad879e7af0fe583bbf043a2b93e32fade79fa19.1667216004.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v5.15.76, v6.0.6 |
|
#
2cfb2180 |
| 28-Oct-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: introduce sw trigger support
There are some hw configuration where irq0 and/or irq1 pins are not connected to the SPI or I2C/I3C controller. In order to avoid polling the outpu
iio: imu: st_lsm6dsx: introduce sw trigger support
There are some hw configuration where irq0 and/or irq1 pins are not connected to the SPI or I2C/I3C controller. In order to avoid polling the output register introduce iio-sw trigger support when irq line is not available (or hw FIFO is not supported).
Suggested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/93ae6ff1150b531a9d7a4d3d1b1adb8383613717.1666955685.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v6.0.5, v5.15.75, v6.0.4, v6.0.3, v6.0.2, v5.15.74, v5.15.73, v6.0.1, v5.15.72, v6.0, v5.15.71, v5.15.70, v5.15.69, v5.15.68, v5.15.67, v5.15.66, v5.15.65, v5.15.64, v5.15.63, v5.15.62 |
|
#
6900cdbf |
| 19-Aug-2022 |
Matti Vaittinen <mazziesaccount@gmail.com> |
iio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get, bulk-enable, add-action-to-disable-at-detach - pattern.
A func
iio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get, bulk-enable, add-action-to-disable-at-detach - pattern.
A functional change (which seems like a bugfix) is that if regulator_bulk_get fails, the enable is not attempted.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Link: https://lore.kernel.org/r/876e58428cec056d51070e49eff559e2d7c23b12.1660934107.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
cd83c5c1 |
| 10-Oct-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: introduce st_lsm6dsx_device_set_enable routine
Introduce st_lsm6dsx_device_set_enable utility routine and remove duplicated code used to enable/disable sensors
Signed-off-by:
iio: imu: st_lsm6dsx: introduce st_lsm6dsx_device_set_enable routine
Introduce st_lsm6dsx_device_set_enable utility routine and remove duplicated code used to enable/disable sensors
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/e3fbe5d4a3bed41130908669f745f78c8505cf47.1665399959.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
186b9e38 |
| 15-Sep-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to LSM6DSTX
Add support to STM LSM6DSTX (acc + gyro) Mems sensor. The LSM6DSTX sensor can use LSM6DST as fallback device since it implements all the LSM6DSTX featur
iio: imu: st_lsm6dsx: add support to LSM6DSTX
Add support to STM LSM6DSTX (acc + gyro) Mems sensor. The LSM6DSTX sensor can use LSM6DST as fallback device since it implements all the LSM6DSTX features currently implemented in st_lsm6dsx.
Datasheet: https://www.st.com/resource/en/datasheet/lsm6dstx.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/573a232b0f320b2ec92c56fa24393cfb275183fb.1663262890.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v5.15.61, v5.15.60, v5.15.59, v5.19, v5.15.58, v5.15.57, v5.15.56, v5.15.55, v5.15.54, v5.15.53, v5.15.52, v5.15.51, v5.15.50, v5.15.49, v5.15.48, v5.15.47, v5.15.46, v5.15.45, v5.15.44, v5.15.43, v5.15.42, v5.18, v5.15.41, v5.15.40, v5.15.39, v5.15.38, v5.15.37, v5.15.36, v5.15.35, v5.15.34, v5.15.33, v5.15.32, v5.15.31, v5.17, v5.15.30, v5.15.29, v5.15.28, v5.15.27, v5.15.26, v5.15.25, v5.15.24, v5.15.23, v5.15.22, v5.15.21, v5.15.20, v5.15.19, v5.15.18, v5.15.17, v5.4.173, v5.15.16 |
|
#
9e5b4cd2 |
| 17-Jan-2022 |
Paul Cercueil <paul@crapouillou.net> |
iio: imu: st_lsm6dsx: Limit requested watermark value to hwfifo size
Instead of returning an error if the watermark value is too high, which the core will silently ignore anyway, limit the value to
iio: imu: st_lsm6dsx: Limit requested watermark value to hwfifo size
Instead of returning an error if the watermark value is too high, which the core will silently ignore anyway, limit the value to the hardware FIFO size; a lower-than-requested value is still better than using the default, which is usually 1.
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20220117102512.31725-1-paul@crapouillou.net Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
2b059449 |
| 04-Jun-2022 |
Jonathan Cameron <Jonathan.Cameron@huawei.com> |
iio: imu: lsm6dsx: Move exported symbols to the IIO_LSM6DSX namespace
Avoid unnecessary pollution of the global symbol namespace by moving library functions in to a specific namespace and import tha
iio: imu: lsm6dsx: Move exported symbols to the IIO_LSM6DSX namespace
Avoid unnecessary pollution of the global symbol namespace by moving library functions in to a specific namespace and import that into the drivers that make use of the functions.
For more info: https://lwn.net/Articles/760045/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220220181522.541718-9-jic23@kernel.org Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20220604161223.461847-6-jic23@kernel.org
show more ...
|
#
acc416ff |
| 04-Jun-2022 |
Jonathan Cameron <Jonathan.Cameron@huawei.com> |
iio: imu: lsm6dsx: Use new pm_sleep_ptr() and EXPORT_SIMPLE_DEV_PM_OPS()
These new functions move the burden of removing unused code when CONFIG_PM_SLEEP is not defined onto the compiler rather than
iio: imu: lsm6dsx: Use new pm_sleep_ptr() and EXPORT_SIMPLE_DEV_PM_OPS()
These new functions move the burden of removing unused code when CONFIG_PM_SLEEP is not defined onto the compiler rather than requiring the use of CONFIG_PM guards and similar.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/20220220181522.541718-8-jic23@kernel.org Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20220604161223.461847-5-jic23@kernel.org
show more ...
|
#
fdd70d7a |
| 04-Apr-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add support to ASM330LHHX
Add support to STM ASM330LHHX (acc + gyro) automotive Mems sensor. The ASM330LHHX sensor can use LSM6DSR as fallback device since it implements all th
iio: imu: st_lsm6dsx: add support to ASM330LHHX
Add support to STM ASM330LHHX (acc + gyro) automotive Mems sensor. The ASM330LHHX sensor can use LSM6DSR as fallback device since it implements all the ASM330LHHX features currently implemented in st_lsm6dsx.
Datasheet: https://www.st.com/resource/en/datasheet/asm330lhhx.pdf Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/04e2644772a6761a25c36bb9679979567fdebda3.1649100168.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
6270bf1f |
| 24-Feb-2022 |
Haibo Chen <haibo.chen@nxp.com> |
iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct
dev_get_drvdata() on iio_dev->dev no longer returns the iio_dev. Use dev_to_iio_dev() to get iio_dev struct.
Fixes: 8b7651f25962 ("i
iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct
dev_get_drvdata() on iio_dev->dev no longer returns the iio_dev. Use dev_to_iio_dev() to get iio_dev struct.
Fixes: 8b7651f25962 ("iio: iio_device_alloc(): Remove unnecessary self drvdata") Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Link: https://lore.kernel.org/r/1645702191-9400-1-git-send-email-haibo.chen@nxp.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
ea85bf90 |
| 05-Feb-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
We need to wait for sensor settling time (~ 3/ODR) before reading data in st_lsm6dsx_read_oneshot routine in order to avoid co
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
We need to wait for sensor settling time (~ 3/ODR) before reading data in st_lsm6dsx_read_oneshot routine in order to avoid corrupted samples.
Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver") Reported-by: Mario Tesi <mario.tesi@st.com> Tested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/b41ebda5535895298716c76d939f9f165fcd2d13.1644098120.git.lorenzo@kernel.org Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v5.15.15, v5.16, v5.15.10, v5.15.9, v5.15.8, v5.15.7, v5.15.6, v5.15.5, v5.15.4, v5.15.3 |
|
#
35619155 |
| 13-Nov-2021 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: add dts property to disable sensor-hub
Introduce the capability to disable sensorhub through a device-tree property since there are some configurations where users want to expl
iio: imu: st_lsm6dsx: add dts property to disable sensor-hub
Introduce the capability to disable sensorhub through a device-tree property since there are some configurations where users want to explicitly disable sensor-hub auto-probing at bootstrap. A typical configuration is when the sensorhub clock/data lines are connected to a pull-up resistor since no slave sensors are connected to the i2c master. If SDO/SA0 line is connected to the same pull-up resistor, when the driver tries to probe slave devices connected on sensor-hub, it will force SDO/SA0 line to low, modifying the device i2c address.
Tested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/ad7894e7b1c6fb3427fab3f623bb942860ad45cf.1636816719.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v5.15.2, v5.15.1, v5.15, v5.14.14, v5.14.13, v5.14.12 |
|
#
94be878c |
| 11-Oct-2021 |
Teng Qi <starmiku1207184332@gmail.com> |
iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
The length of hw->settings->odr_table is 2 and ref_sensor->id is an enum variable whose value is between 0 and 5. However
iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
The length of hw->settings->odr_table is 2 and ref_sensor->id is an enum variable whose value is between 0 and 5. However, the value ST_LSM6DSX_ID_MAX (i.e. 5) is not caught properly in switch (sensor->id) {
If ref_sensor->id is ST_LSM6DSX_ID_MAX, an array overflow will ocurrs in function st_lsm6dsx_check_odr(): odr_table = &sensor->hw->settings->odr_table[sensor->id];
and in function st_lsm6dsx_set_odr(): reg = &hw->settings->odr_table[ref_sensor->id].reg;
To avoid this array overflow, handle ST_LSM6DSX_ID_GYRO explicitly and return -EINVAL for the default case.
The enum value ST_LSM6DSX_ID_MAX is only present as an easy way to check the limit and as such is never used, however this is not locally obvious.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Teng Qi <starmiku1207184332@gmail.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20211011114003.976221-1-starmiku1207184332@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
Revision tags: v5.14.11, v5.14.10, v5.14.9 |
|
#
1b7da2fa |
| 26-Sep-2021 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: move max_fifo_size in st_lsm6dsx_fifo_ops
Move max_fifo_size in st_lsm6dsx_fifo_ops in order to have all FIFO configuration parameters in st_lsm6dsx_fifo_ops structure. This pa
iio: imu: st_lsm6dsx: move max_fifo_size in st_lsm6dsx_fifo_ops
Move max_fifo_size in st_lsm6dsx_fifo_ops in order to have all FIFO configuration parameters in st_lsm6dsx_fifo_ops structure. This patch does not introduce any logic change, just small code rearrangement.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/3262ad9d9d1497e19ea1bab208c495c2b9a98994.1632664866.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|
#
1f05c756 |
| 05-Feb-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
commit ea85bf906466191b58532bb19f4fbb4591f0a77e upstream.
We need to wait for sensor settling time (~ 3/ODR) before reading d
iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot
commit ea85bf906466191b58532bb19f4fbb4591f0a77e upstream.
We need to wait for sensor settling time (~ 3/ODR) before reading data in st_lsm6dsx_read_oneshot routine in order to avoid corrupted samples.
Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver") Reported-by: Mario Tesi <mario.tesi@st.com> Tested-by: Mario Tesi <mario.tesi@st.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/b41ebda5535895298716c76d939f9f165fcd2d13.1644098120.git.lorenzo@kernel.org Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
#
a9d2d23b |
| 11-Oct-2021 |
Teng Qi <starmiku1207184332@gmail.com> |
iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
[ Upstream commit 94be878c882d8d784ff44c639bf55f3b029f85af ]
The length of hw->settings->odr_table is 2 and ref_sensor->
iio: imu: st_lsm6dsx: Avoid potential array overflow in st_lsm6dsx_set_odr()
[ Upstream commit 94be878c882d8d784ff44c639bf55f3b029f85af ]
The length of hw->settings->odr_table is 2 and ref_sensor->id is an enum variable whose value is between 0 and 5. However, the value ST_LSM6DSX_ID_MAX (i.e. 5) is not caught properly in switch (sensor->id) {
If ref_sensor->id is ST_LSM6DSX_ID_MAX, an array overflow will ocurrs in function st_lsm6dsx_check_odr(): odr_table = &sensor->hw->settings->odr_table[sensor->id];
and in function st_lsm6dsx_set_odr(): reg = &hw->settings->odr_table[ref_sensor->id].reg;
To avoid this array overflow, handle ST_LSM6DSX_ID_GYRO explicitly and return -EINVAL for the default case.
The enum value ST_LSM6DSX_ID_MAX is only present as an easy way to check the limit and as such is never used, however this is not locally obvious.
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Teng Qi <starmiku1207184332@gmail.com> Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://lore.kernel.org/r/20211011114003.976221-1-starmiku1207184332@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v5.14.8, v5.14.7, v5.14.6, v5.10.67, v5.10.66, v5.14.5, v5.14.4, v5.10.65, v5.14.3, v5.10.64, v5.14.2, v5.10.63, v5.14.1, v5.10.62, v5.14, v5.10.61, v5.10.60, v5.10.53, v5.10.52, v5.10.51, v5.10.50, v5.10.49, v5.13, v5.10.46, v5.10.43, v5.10.42, v5.10.41, v5.10.40, v5.10.39 |
|
#
b892770a |
| 18-May-2021 |
Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
iio: Drop Duplicated "mount-matrix" parameter
All of the users of iio_read_mount_matrix() are using the very same property name. Moreover, the property name is hard coded in the API documentation.
iio: Drop Duplicated "mount-matrix" parameter
All of the users of iio_read_mount_matrix() are using the very same property name. Moreover, the property name is hard coded in the API documentation.
Make this clear and avoid duplication now and in the future.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210518112546.44592-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
show more ...
|