mbox series

[v2,0/9] add i2c controller support to st_lsm6dsx driver

Message ID cover.1541945612.git.lorenzo.bianconi@redhat.com (mailing list archive)
Headers show
Series add i2c controller support to st_lsm6dsx driver | expand

Message

Lorenzo Bianconi Nov. 11, 2018, 2:15 p.m. UTC
Introduce i2c controller support to st_lsm6dsx driver for lsm6dso sensor.
st_lsm6dsx sensor-hub supports up to 3 concurrent slave devices.
Add register map for lis2mdl magnetometer sensor.
Add hw FIFO support to st_lsm6dsx sensorhub driver.

Changes since v1:
- move back st_lsm6dsx_set_fifo_mode routine in fifo_lock critical section
  in st_lsm6dsx_flush_fifo
- improve documentation
- move st_lsm6dsx_sensor_set_enable definition in a separated patch
- move st_lsm6dsx_push_tagged_data definition in a separated patch
- use proper ts_ref for ext devices in st_lsm6dsx_push_tagged_data
- fix invalid iio_dev identification in st_lsm6dsx_push_tagged_data
  when ST_LSM6DSX_EXT1_TAG is read from the FIFO
- refactor st_lsm6dsx_shub_probe moving wai check in a dedicated routine
- fix abi issue in scale_available definition

Lorenzo Bianconi (9):
  iio: imu: st_lsm6dsx: introduce locked read/write utility routines
  iio: imu: st_lsm6dsx: reload trimming parameter at bootstrap
  iio: imu: st_lsm6dsx: remove static from st_lsm6dsx_set_watermark
  iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor ids
  iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routine
  iio: imu: st_lsm6dsx: add i2c embedded controller support
  iio: imu: st_lsm6dsx: add st_lsm6dsx_push_tagged_data routine
  iio: imu: st_lsm6dsx: add hw FIFO support to i2c controller
  dt-bindings: iio: imu: st_lsm6dsx: add support to i2c pullup resistors

 .../bindings/iio/imu/st_lsm6dsx.txt           |   1 +
 drivers/iio/imu/st_lsm6dsx/Makefile           |   3 +-
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h       | 167 +++-
 .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c    | 165 ++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c  | 283 +++++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c  | 777 ++++++++++++++++++
 .../linux/platform_data/st_sensors_pdata.h    |   2 +
 7 files changed, 1263 insertions(+), 135 deletions(-)
 create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c

Comments

Jonathan Cameron Nov. 11, 2018, 4:46 p.m. UTC | #1
On Sun, 11 Nov 2018 15:15:27 +0100
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:

> Introduce i2c controller support to st_lsm6dsx driver for lsm6dso sensor.
> st_lsm6dsx sensor-hub supports up to 3 concurrent slave devices.
> Add register map for lis2mdl magnetometer sensor.
> Add hw FIFO support to st_lsm6dsx sensorhub driver.
Hi Lorenzo.

A very nice series in general, though I did make a small change in patch 6
so please check I didn't mess that up.  It seemed fairly obvious but I've
been wrong on obvious things many times before :)

Thanks,

Jonathan

> 
> Changes since v1:
> - move back st_lsm6dsx_set_fifo_mode routine in fifo_lock critical section
>   in st_lsm6dsx_flush_fifo
> - improve documentation
> - move st_lsm6dsx_sensor_set_enable definition in a separated patch
> - move st_lsm6dsx_push_tagged_data definition in a separated patch
> - use proper ts_ref for ext devices in st_lsm6dsx_push_tagged_data
> - fix invalid iio_dev identification in st_lsm6dsx_push_tagged_data
>   when ST_LSM6DSX_EXT1_TAG is read from the FIFO
> - refactor st_lsm6dsx_shub_probe moving wai check in a dedicated routine
> - fix abi issue in scale_available definition
> 
> Lorenzo Bianconi (9):
>   iio: imu: st_lsm6dsx: introduce locked read/write utility routines
>   iio: imu: st_lsm6dsx: reload trimming parameter at bootstrap
>   iio: imu: st_lsm6dsx: remove static from st_lsm6dsx_set_watermark
>   iio: imu: st_lsm6dsx: introduce ST_LSM6DSX_ID_EXT sensor ids
>   iio: imu: st_lsm6dsx: introduce st_lsm6dsx_sensor_set_enable routine
>   iio: imu: st_lsm6dsx: add i2c embedded controller support
>   iio: imu: st_lsm6dsx: add st_lsm6dsx_push_tagged_data routine
>   iio: imu: st_lsm6dsx: add hw FIFO support to i2c controller
>   dt-bindings: iio: imu: st_lsm6dsx: add support to i2c pullup resistors
> 
>  .../bindings/iio/imu/st_lsm6dsx.txt           |   1 +
>  drivers/iio/imu/st_lsm6dsx/Makefile           |   3 +-
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h       | 167 +++-
>  .../iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c    | 165 ++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c  | 283 +++++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c  | 777 ++++++++++++++++++
>  .../linux/platform_data/st_sensors_pdata.h    |   2 +
>  7 files changed, 1263 insertions(+), 135 deletions(-)
>  create mode 100644 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
>
Lorenzo Bianconi Nov. 11, 2018, 5:35 p.m. UTC | #2
>
> On Sun, 11 Nov 2018 15:15:27 +0100
> Lorenzo Bianconi <lorenzo.bianconi@redhat.com> wrote:
>
> > Introduce i2c controller support to st_lsm6dsx driver for lsm6dso sensor.
> > st_lsm6dsx sensor-hub supports up to 3 concurrent slave devices.
> > Add register map for lis2mdl magnetometer sensor.
> > Add hw FIFO support to st_lsm6dsx sensorhub driver.
> Hi Lorenzo.

Hi Jonathan,

>
> A very nice series in general, though I did make a small change in patch 6
> so please check I didn't mess that up.  It seemed fairly obvious but I've
> been wrong on obvious things many times before :)
>

Thx for the fast review :) Looking at the code I think it is fine.
Moreover I guess we
can generalize it taking into account different channel lengths (e.g. if we want
to connect a pressure sensor). I will send a follow-up patch.

Regards,
Lorenzo

> Thanks,
>
> Jonathan
>