Commit Graph

113 Commits

Author SHA1 Message Date
Mario Tesi
6efdd65453 drivers:iio:stm:magnetometer: add support to ST MEMS MAG 3D
This driver adds support to the family of magnetometric sensors
having the common whoami 0x3d. The following devices belong to
this family:
LIS3MDL - 3 axis Magnetometer
LSM9DS1 - 6 axis IMU + 3 axis Magnetometer

Tested on Kernel <= 5.4 and 5.10 where trigger ops structure
differs.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: If7d7b82333592fdb5a888bf53dfafc8382cce9a6
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265990
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-09-28 18:27:39 +02:00
Mario Tesi
106dbf45da drivers:iio:stm:imu:st_lsm6dsrx: add embedded function event sensors
The LSM6DSRx IMU sensor family also supports the following embedded
low power hw feature:
 - tilt
 - pedometer

so the following new IIO sensors were exported by the lsm6dsrx driver:
 - tilt event detection (tilt)
 - step detection (stepd)
 - step counter (stepc)
 - significant motion (sigmot)

all sensors are managed by interrupt pin and can be individually enabled.

The step counter is managed as a continuous data sensor and uses the
internal hw fifo to save the number of steps detected, it is also possible
to reset this counter via sysfs.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I05ddf62effbd0831012b987d3e185bf209f0cee6
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265866
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-16 04:02:44 +02:00
Mario Tesi
92e5f15d7e drivers:iio:stm:imu:st_lsm6dsox: fix fsm only support
Solve the issue that occurs when one of the devices that
only supports fsm is probed, in this case the support of
only fsm must be guaranteed even if there is no mlc.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I7d15c3c6f94da731279a8aa92900a1de1d98223a
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265326
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:44:50 +02:00
Mario Tesi
ae6cd950fd drivers:iio:stm:imu:st_lsm6dsrx: add page lock during mlc load/flush
During the loading of the MLC / FSM fw the register page can be
changed randomly and repeatedly by the firmware itself, for this
reason it is necessary to protect the access to allow the MLC
event handler to read the status register page and output register
value in an exclusive mode.
Same possible issue for mlc flush operation which in turn invoke
the main sensor enable function that is not protected by any register
page switch.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I1146fbc3a58dfec1e241fd379e2d82d72f0d3861
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265496
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
5e03faba46 drivers:iio:stm:imu:st_lsm6dsrx: add locked read to event handler
The event handler detection function reads the status register
without using the page lock which may have been modified by MLC/FSM
handler function.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I05f7b7ad8d55ee93fc184c2d7ce0a9a27ac47263
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265495
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
1a056b0aa2 drivers:iio:stm:imu:st_lsm6dsrx: improves documentation and alignment of structures
Some fields of the driver structures were partially or incorrectly documented,
also the initialization part was messy.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I06b7c7db6dea9a10e47203a7a4ee3c3b92aadf2e
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265494
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
d2f0b595c4 drivers:iio:stm:imu:st_lsm6dsrx: fix mlc verify operation
The mlc verification function does not work correctly, the
modification rework the parsing procedure of the fw code that
is used to program the MLC / FSM block.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ic83d7c40dddea931bfa47e18f15d17a2c33b229d
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265342
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
01db942edf drivers:iio:stm:imu:st_lsm6dsrx: fix mlc flush operation
During flush operation the st_lsm6dsrx_mlc_flush_all function
loop on all iio_dev, also for the non MLC/FSM devices, this loop
could be very slow.
Furthermore, the return value of the st_lsm6dsrx_mlc_enable_sensor
function must be ignored for unallocated devices otherwise the
loop does not terminate and some devices may remain allocated.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I05c3a05d539c364c6314ba343643adbe97907b60
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265269
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
81e2395f32 drivers:iio:stm:imu:st_lsm6dsrx: reworks struct and documentation
Simplify st_lsm6dsrx_sensor structure and complete the documentation.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I34c05474547004d1066235d20d77791a5f93d820
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265268
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
2b1dae6730 drivers:iio:stm:imu:st_lsm6dsrx: leaves MLC enabled by default (II)
Permanently deletes the MLC defines left in the interface part and in
the default config of the driver.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I168a8675ca8ecbadce6d1156cf9fd2e03697e2af
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265267
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
4226e3529d drivers:iio:stm:imu:st_lsm6dsrx: add tap embedded low-power features
LSM6DSRx family support tap and double tap detection embedded low-power
features. This patch configures the tap and double tap engine with a
basic configuration and enables the generation of interrupts in case of
acknowledgment of a tap or double tap event.
Each IIO event detection for tap and double tap can be individually enabled
as for the other basic embedded events.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Id0b2a6c149e18b266e90b1cc37cfced01187ba99
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265161
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
8a18acfed5 drivers:iio:stm:imu:st_asm330lhhx: update registers name
The names of the registers have been updated in accordance with the
data sheet.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: If558dcf85d5a40e42098342d063328b02ef40d04
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265160
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
93349806c0 drivers:iio:stm:imu:st_lsm6dsrx: removed internal driver version
Removed the internal version of the driver no longer managed.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I1371d23d9c71faf93605a51c37dae1f5f799399c
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265159
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Mario Tesi
fff3310f9a drivers:iio:stm:imu:st_lsm6dsrx: fix missing trigger enable event
Missing registration when enabling the trigger which in turn generates
a kernel oops caused by an undersizing and misalignment of the buffer
structure in the handler_threads of the triggers.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I6183134a3366a102647d969cb26e7b293c42c3ce
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/265112
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-10 00:37:05 +02:00
Denis Ciocca
2fe7442b35 drivers:iio:stm:imu:st_asm330lhhx: replace FIELD_PREP with custom SHIFT
This patch is fixing a compilation error while building the driver as
built-in.

Compilation error:

compiler_types.h:315:38: error: call to '__compiletime_assert_307'
declared with attribute error: FIELD_PREP: mask is not constant

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I062df2a0e31b288d4448cf8cd6ee3ba98904920a
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264550
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-09-02 21:27:34 +02:00
Mario Tesi
9b23907059 drivers:iio:stm:imu:st_lsm6dsrx: add basic embedded low-power features
LSM6DSRx family support basic embedded low-power features for the
following IIO event-detection configurable interrupts:
 - Free-fall
     configurable free fall threshold
 - Wake-up
     configurable wake-up threshols and duration
 - 6D orientation
     configurable 6D threshols degrees
 - Stationary/motion detection

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I6b47e98f96774355bbccaaecf6b99f43c515bc73
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264567
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
e007898e4b drivers:iio:stm:imu:st_lsm6dsrx: extends enable mask to 64 bits
The number of iio devices supported by st_lsm6dsrx driver could
exceed 32 devices in the future, extends the enable mask to 64 bit.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I92fe526c047b01709decd3905e679e8e5cfcf34b
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264566
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
a33f14a393 drivers:iio:stm:imu:st_lsm6dsrx: save irq config
Store irq pin configuration into hw structure for future use.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I6ece0389f898fc0b9d5209c04780b78342f66905
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264565
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
bb025ca6e3 drivers:iio:stm:imu:st_lsm6dsrx: move preload mlc/fsm array
Move the preload mlc/fsm array to a separate file, include also
a free fall detection sample for lsm6dsr (FSM only).

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I5cffc921590914f1d6c4bcbd2f83636fa2bf3395
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264564
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
cb3e879754 drivers:iio:stm:imu:st_lsm6dsrx: added support to lsm6dsr
Extend support to lsm6dsr IMU of the same family group. This
device implements in HW only FSM and not support MLC.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ie541b2e17135e8683ba34670c0fb87a9ba6d28fd
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264563
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
85e0f8c053 drivers:iio:stm:imu:st_lsm6dsrx: manage device compatibility with MLC/FSM
Added FSM and MLC flags in order to check device compatibility with
MLC/FSM configuration file.
This check has been added as not all devices of LSM6DSRx family
support the hw functions of FSM and MLC and therefore to avoid the
programming of an invalid configuration files a compatibility check
must be made in advance.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I9acb30f677db516f294f730b3c12b904f6d73812
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264562
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
181903fb9f drivers:iio:stm:imu:st_lsm6dsrx: manage multiple device id
Preparing the st_lsm6dsrx driver to extend support to devices of the
same family group.
The device ID managed through the compatible string has been introduced
in order to define which device to support through the device tree.
At the moment only lsm6dsrx which supports MLC is available.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ib290fc4ffafab0a89fc171b26c6bddb5cab8ce95
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264561
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
4fd2d9f091 drivers:iio:stm:imu:st_lsm6dsrx: leaves MLC enabled by default
Always leaves the MLC function support active in the driver to minimize
configuration parameters in Kconfig.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I4db9e3cb22daf0598bc9ddae358731fdde875afc
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264560
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
b13f51bb3c drivers:iio:stm:imu:st_lsm6dsrx: replace FIELD_PREP with custom SHIFT
This patch is fixing a compilation error while building the driver as
built-in.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I84f52c37629bf10da97d3b17624c2166c31073b7
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264559
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
c37ebd1df6 drivers:iio:stm:imu:st_lsm6dsrx: fix typo in enum
Removed all wrong references to devices not related to the
driver family in object.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I6ff920537fc1493ae973137b025ea4e9b1c61407
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264558
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-09-02 18:22:31 +02:00
Mario Tesi
71b8b2da0c drivers:iio:stm:imu:st_asm330lhhx: Add support to MLC/FSM
ASM330LHHX device include Finite State Machine (FSM) and Machine
Learning Core (MLC) HW block features which can be programmed through
binary ucf files generated by the "Unico" STmicroelectronics tool.
Through this patch the possibility to exploit the new features with
the following characteristics:
  - Preload a test configuration for MLC / FSM during probe.
  - Dynamically upload a new configuration via firmware upload.
  - Individually enable and disable IIO devices generated by the ucf
    configuration.
  - Max number of contemporary MLC 8 and FSM 16 supported.
  - Configurable MLC/FSM interrupt pin.
  - Management of MLC and FSM events as IIO_ACTIVITY type including output
    register data and timestamp.
  - Possibility to dynamically flush a configuration.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I17ff5a9133e93a75774f4b193d50cd23706d1237
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/262550
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-30 19:33:25 +02:00
Mario Tesi
b8f9b5b21b drivers:iio:stm:imu:st_asm330lhhx: Use common regmap api
Replace custom trasmission layer with regmap api.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I256d1a5a9ad7ab4b3141c9988145ae1861eee26e
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261335
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-29 19:33:14 +02:00
Mario Tesi
67ff9456be drivers:iio:stm:imu:st_asm330lhhx: Fix aesthetics and documentation
Complete documentation in sensor and hw structures and align
space and tab into sensor settings structure.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I34b7b4b7247aa09de874db5afb10c8ee2727ee8b
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261203
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-29 19:33:14 +02:00
Mario Tesi
728c7c0a9c drivers:iio:stm:imu:st_asm330lhhx: Use device name in irq
Pass device name to request threaded irq function instead the
generic driver name, in this way it will be possible to individuate
the device that requested the interrupt.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I4a5c43452079b2174cec4128fddf0bf2283bb495
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261202
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-29 19:33:14 +02:00
Mario Tesi
fe21d98000 drivers:iio:stm:imu:st_asm330lhhx: Add SHUB feature
ASM330LHHX embed a master I2C interface with sensor hub (SHUB) feature.
This patch add support to SHUB including the following features:
 1) Maximum of 2 device supported to be chosen from the following part
    numbers

   - LIS2MDL 3-axis magnetometer
   - LIS3MDL 3-axis magnetometer
   - LPS22HB pressure
   - LPS22HH pressure

 2) Sensor hub leverage on HW FIFO to store samples
 3) Possibility to configure pull up on I2C master interface through device
    tree
 4) Self scan on I2C master interface of supported device, including multi
    address devices
 5) ODR setting

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ia470e5798296d4517113c072f994b8518360cfa8
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261198
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-29 19:33:14 +02:00
Mario Tesi
9c79399fd7 drivers:iio:stm:imu:st_asm330lhhx: Add support to Power Mode
Some device support also Low Power Mode setting for the primary
sensors (temperature is no a primary). This patch add support to read
and set power mode for acc and gyro sensors.
By default the Power Mode is set to High Performance.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I3db25f2cc9e6004b18be24039ce6983f7fa8afab
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261197
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-29 19:33:14 +02:00
Denis Ciocca
c1109ec321 stm: add pathes for building kernel 5.15.y as WIP
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Id2a475953bb61b397eb3d9d3875b813554282319
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/264074
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-08-27 02:36:21 +02:00
Mario Tesi
f74934464e drivers:iio:stm:imu:st_asm330lhhx: Switch to base register bank
If the kernel is restarted while the driver was reading in the configuration
register page without turning off the power to the device, it could happen that
the bank regster 0 will be not accessible, so the first thing to do is to make
sure we are on the correct page before probe the whoami register.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ie732a5fa7a3230fd46ba044c7daa21d2e338a6dd
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261196
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-16 00:46:19 +02:00
Mario Tesi
273bf351b7 drivers:iio:stm:imu:st_asm330lhhx: Remove useless iio free
IIO free device is already managed by devm iio device rollback function.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I3977a13e79fbee31b3cf58981d244fee8391edd7
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261195
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
2022-08-15 18:45:16 +02:00
Mario Tesi
54163caea0 drivers:iio:stm:imu:st_asm330lhhx: Use octal permission bits format
Checkpatch report error when using Unix permission bits format.
Permission bits in the octal form are more readable and easier to
understand than their symbolic counterparts because many command-line
tools use this notation.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Ifa44a53fa8ba46464097dcfc59f7200402102c05
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261194
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-12 21:25:12 +02:00
Mario Tesi
d5251c1ad2 drivers:iio:stm:imu:st_asm330lhhx: Enable temperature sensor
Enable internal temperature sensor by default.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: Id5e1b40957a13db670074cd574070d91ed7f6c9d
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/261192
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-08-12 00:02:58 +02:00
Matteo Dameno
176587d492 stm: README.md fix typo
Signed-off-by: Matteo Dameno <matteo.dameno@st.com>
Change-Id: I4c2c8beb47de4dd7ac35d73551b3304632bcc1eb
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/260817
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-07-20 18:11:20 +02:00
Mario Tesi
5e0a12fc21 drivers:iio:stm:imu:st_asm330lhhx: Add driver info management
Since st_asm330lhhx driver supports more devices, the recognition
of the device name has been included in the probe phase so that
the sensor name is referred to the device name. Discrimination
of the device has the purpose of verifying the presence or absence
of the mlc and the sensor hub features.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I0239d1b7d27be360f8918ec0db4b765fb543fb93
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/260651
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-07-19 19:43:46 +02:00
Mario Tesi
c8055e7d00 drivers:iio:stm:imu:st_asm330lhhx: Starting support asm330lhhx STMEMS IMU
Renamed st_asm330lhh driver to st_asm330lhhx, in order to include all
asm330lhh IMU device sensor family.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I98355a2050269eac4576d3e0a2d6243284c37387
Reviewed-on: https://gerrit.st.com/c/linuxandroidopen/stm-ldd-iio/+/260376
Tested-by: CITOOLS <MDG-smet-aci-reviews@list.st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
2022-07-19 19:43:46 +02:00
Denis Ciocca
3f13ee31e8 drivers:iio:stm:imu:lsm6dsm: fix fifo watermark calculation
This patch is fixing the calculation of the fifo watermark that was causing
wrong amount of fifo usage. In particular, highest 3 bits were always
reset to 0.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Id55eb114b9165a8a239fd5dff57a20c53e30714b
2022-05-31 11:05:52 -07:00
Denis Ciocca
ecd3dc6b0d drivers:iio:stm:imu:lsm6ds3h: fix misleadingly indented block warning
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I05ee6c42bfb8f51f0f9b853180253b22ca79a51d
2022-05-18 11:09:15 -07:00
Denis Ciocca
3666c12571 drivers:iio:stm:imu:lsm6ds3: fix misleadingly indented block warning
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I27daa7c4184b22c03df48806ebb990b7134b8974
2022-05-18 11:08:15 -07:00
Denis Ciocca
1d12a56ddc stm: update README.md for master branch
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Ib43cd92cd380dc8ee396ddb07078738fd9a86653
2022-05-17 16:12:49 -07:00
Denis Ciocca
47e8a3e277 stm: fix uncorrect uses of config macro from string to bool
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: If3259c06f5eefac72ad38ae2b0ffe04a98f2d2e3
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/652
Tested-by: CI STM MSD <aosp-ger@st.com>
2022-05-17 10:26:14 -07:00
Denis Ciocca
607fde8354 include:linux:p_d:stm: add missing platform data file for ism303dac driver
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I6f7a381d0424b9511ee9069649d7a56d1902b0b9
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/654
Tested-by: CI STM MSD <aosp-ger@st.com>
2022-05-17 10:26:14 -07:00
Denis Ciocca
8ea12dbfb1 include:linux:p_d:stm: add missing platform data file for lis2hh12 driver
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Ica8b378319783fbb95c97f50a55c1c9c231caa26
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/653
Tested-by: CI STM MSD <aosp-ger@st.com>
2022-05-17 10:26:14 -07:00
Denis Ciocca
d55fe0e4b8 include:linux:p_d:stm: add missing platform data file for lis2ds12 driver
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I4753f38435dcd06e12f05e0edae966dddced31a8
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/651
Tested-by: CI STM MSD <aosp-ger@st.com>
2022-05-17 10:26:14 -07:00
Denis Ciocca
bbfee1973c drivers:iio:stm: add missing include for kfree and kzalloc
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Iae711eaa896dfdd0c6e9765ab1170b671f8eb4e7
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/649
Tested-by: CI STM MSD <aosp-ger@st.com>
Reviewed-by: Matteo DAMENO <matteo.dameno@st.com>
Reviewed-by: Mario TESI <mario.tesi@st.com>
2022-05-11 17:47:45 -07:00
Denis Ciocca
1c30ff7ef3 drivers:iio:stm: use buffer_impl.h only for kernel >= 4.11
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: I6421d1e259953a9a65b3dc5bc440be95fcefbec2
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/648
Tested-by: CI STM MSD <aosp-ger@st.com>
Reviewed-by: Mario TESI <mario.tesi@st.com>
2022-05-11 17:47:45 -07:00
Denis Ciocca
26a4fd3b5c drivers:iio:stm: introduce old of_iio_read_ for kernels < 5.2.0
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Change-Id: Ib23c817e74e85374a7c499a26a937d766aadad7e
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/647
Tested-by: CI STM MSD <aosp-ger@st.com>
Reviewed-by: Matteo DAMENO <matteo.dameno@st.com>
Reviewed-by: Mario TESI <mario.tesi@st.com>
2022-05-11 17:47:45 -07:00