diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-25 11:50:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-25 11:50:51 +0300 |
commit | bf402c08ebc286f613501f4d2dc00304aed47ceb (patch) | |
tree | 2f08c3c627f8e658d8893ceaa5365f1ecdb13fb4 /drivers/iio/accel | |
parent | 817de6b85914a3dda72b971c074d4d342965fba0 (diff) | |
parent | 447ccb4e0834a9f9f0dd5643e421c7f1a1649e6a (diff) | |
download | linux-bf402c08ebc286f613501f4d2dc00304aed47ceb.tar.xz |
Merge tag 'iio-for-5.2b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second set of IIO new device support, features and cleanup for the 5.2 cycle.
New device suport
* ad7606
- Support the AD7616 16 channel, 12bit ADC.
* fxas21002c
- New driver for this gyroscope with I2C and SPI support.
* lsm6dsx
- Support the lsm6dsr, new device information structure and dt bindings.
* srf04
- Addition device IDs for mb1000, mb1010, mb1020, mb1030 and mb1040 +
support of different required trigger pulse lengths.
* st-accel
- Support the ls2de12, new device info and dt bindings.
* ti-ads8344
- New driver for this 8 channel, 16 bit SPI ADC.
Binding conversions to yaml - we have started doing these in general for IIO.
* avia-hx711
* bmp085
Cleanups and minor fixes / additions
* ad5758
- Fixup for some changes between preproduction parts and final part.
* ad7606
- Refactor handling of oversampling to make it easy to vary between
supported devices.
* ad9832
- Organise includes.
- Clock framework to handle clocks.
* ad9834
- Drop unnecessary parenthesis.
* bmc150
- Use __func__ rather than hardcoding.
* dummy_evgen.
- Fix a memleak on error in probe.
* kxcjk1013
- Add KXCJ91008 ACPI ID as seen in the wild.
- Use __func__ rather than hardcoding.
* imx7d
- Local dev variable to simplify code a bit.
- dev_err replaces pr_err to give more info.
- devm_platform_ioremap_resource for small reduction in boilerplate.
- Simplify probe and remove by sharing suspend / resume logic.
- Devm for iio_device_register as remove only contains the unregister.
* lsm6dsx
- Remove a variable that was never read.
- Open code values where they are effectively described by what is assigned
to them rather than using uninformative defines.
* max31856
- Avoid an unintialized ret variable in a path that can't actually occur
but is hard for a static checker to know.
* max9611
- White space
* mpu3050
- Reduce a sleep worst case by switching from msleep to usleep_range.
* qcom-spmi-adc5
- Add MODULE_DEVICE_TABLE to assist autoloading of this as a module.
* stm32-dfsdm
- Fix missing dependencies.
* stm32-timer trigger
- Fix a build issue when disabled.
* ti-ads7950
- Fix mising dependency on CONFIG_GPIOLIB.
* tag 'iio-for-5.2b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (42 commits)
iio: adc: qcom-spmi-adc5: Fix of-based module autoloading
iio: dummy_evgen: fix possible memleak in evgen init
iio:accel:Switch hardcoded function name with a reference to __func__ making the code more maintainable
iio: adc: stm32-dfsdm: fix triggered buffer build dependency
iio: adc: stm32-dfsdm: fix unmet direct dependencies detected
iio: trigger: stm32-timer: fix build issue when disabled
iio: imx7d_adc: Use devm_iio_device_register()
iio: imx7d_adc: Simplify imx7d_adc_remove() with imx7d_adc_suspend()
iio: imx7d_adc: Simplify imx7d_adc_probe() with imx7d_adc_resume()
drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.
iio: dac: ad5758: Modifications for new revision
iio: imu: st_lsm6dsx: inline per-sensor data
iio: adc: Add driver for the TI ADS8344 A/DC chips
dt-bindings: iio: adc: Add bindings for TI ADS8344 A/DC chips
MAINTAINERS: add entry for fxas21002c gyro driver
iio: gyro: fxas21002c: add spi driver
iio: gyro: fxas21002c: add i2c driver
iio: gyro: add core driver for fxas21002c
iio: gyro: add DT bindings to fxas21002c
Kconfig: change configuration of srf04 ultrasonic iio sensor
...
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/Kconfig | 2 | ||||
-rw-r--r-- | drivers/iio/accel/bmc150-accel-core.c | 2 | ||||
-rw-r--r-- | drivers/iio/accel/kxcjk-1013.c | 3 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel.h | 2 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 76 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_i2c.c | 5 |
6 files changed, 87 insertions, 3 deletions
diff --git a/drivers/iio/accel/Kconfig b/drivers/iio/accel/Kconfig index 4a1f133538ba..62a970a20219 100644 --- a/drivers/iio/accel/Kconfig +++ b/drivers/iio/accel/Kconfig @@ -223,7 +223,7 @@ config IIO_ST_ACCEL_3AXIS Say yes here to build support for STMicroelectronics accelerometers: LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL, - LNG2DM, LIS3DE + LNG2DM, LIS3DE, LIS2DE12 This driver can also be built as a module. If so, these modules will be created: diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index b4e2d9b04e1d..44d7c49fe2a1 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -394,7 +394,7 @@ static int bmc150_accel_set_power_state(struct bmc150_accel_data *data, bool on) if (ret < 0) { dev_err(dev, - "Failed: bmc150_accel_set_power_state for %d\n", on); + "Failed: %s for %d\n", __func__, on); if (on) pm_runtime_put_noidle(dev); diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index a5c9d3d8613f..2922a2e88a1b 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -451,7 +451,7 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on) } if (ret < 0) { dev_err(&data->client->dev, - "Failed: kxcjk1013_set_power_state for %d\n", on); + "Failed: %s for %d\n", __func__, on); if (on) pm_runtime_put_noidle(&data->client->dev); return ret; @@ -1491,6 +1491,7 @@ static const struct acpi_device_id kx_acpi_match[] = { {"KXCJ1013", KXCJK1013}, {"KXCJ1008", KXCJ91008}, {"KXCJ9000", KXCJ91008}, + {"KIOX0008", KXCJ91008}, {"KIOX0009", KXTJ21009}, {"KIOX000A", KXCJ91008}, {"KIOX010A", KXCJ91008}, /* KXCJ91008 inside the display of a 2-in-1 */ diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h index fd53258656ca..9d25955af58e 100644 --- a/drivers/iio/accel/st_accel.h +++ b/drivers/iio/accel/st_accel.h @@ -34,6 +34,7 @@ enum st_accel_type { LIS3LV02DL, LIS2DW12, LIS3DHH, + LIS2DE12, ST_ACCEL_MAX, }; @@ -57,6 +58,7 @@ enum st_accel_type { #define LIS2DW12_ACCEL_DEV_NAME "lis2dw12" #define LIS3DHH_ACCEL_DEV_NAME "lis3dhh" #define LIS3DE_ACCEL_DEV_NAME "lis3de" +#define LIS2DE12_ACCEL_DEV_NAME "lis2de12" /** * struct st_sensors_platform_data - default accel platform data diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 9930edf423bf..5ff04d9755d5 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -831,6 +831,82 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = { .multi_read_bit = false, .bootime = 2, }, + { + .wai = 0x33, + .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, + .sensors_supported = { + [0] = LIS2DE12_ACCEL_DEV_NAME, + }, + .ch = (struct iio_chan_spec *)st_accel_8bit_channels, + .odr = { + .addr = 0x20, + .mask = 0xf0, + .odr_avl = { + { .hz = 1, .value = 0x01, }, + { .hz = 10, .value = 0x02, }, + { .hz = 25, .value = 0x03, }, + { .hz = 50, .value = 0x04, }, + { .hz = 100, .value = 0x05, }, + { .hz = 200, .value = 0x06, }, + { .hz = 400, .value = 0x07, }, + { .hz = 1620, .value = 0x08, }, + { .hz = 5376, .value = 0x09, }, + }, + }, + .pw = { + .addr = 0x20, + .mask = 0xf0, + .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, + }, + .enable_axis = { + .addr = ST_SENSORS_DEFAULT_AXIS_ADDR, + .mask = ST_SENSORS_DEFAULT_AXIS_MASK, + }, + .fs = { + .addr = 0x23, + .mask = 0x30, + .fs_avl = { + [0] = { + .num = ST_ACCEL_FS_AVL_2G, + .value = 0x00, + .gain = IIO_G_TO_M_S_2(15600), + }, + [1] = { + .num = ST_ACCEL_FS_AVL_4G, + .value = 0x01, + .gain = IIO_G_TO_M_S_2(31200), + }, + [2] = { + .num = ST_ACCEL_FS_AVL_8G, + .value = 0x02, + .gain = IIO_G_TO_M_S_2(62500), + }, + [3] = { + .num = ST_ACCEL_FS_AVL_16G, + .value = 0x03, + .gain = IIO_G_TO_M_S_2(187500), + }, + }, + }, + .drdy_irq = { + .int1 = { + .addr = 0x22, + .mask = 0x10, + }, + .addr_ihl = 0x25, + .mask_ihl = 0x02, + .stat_drdy = { + .addr = ST_SENSORS_DEFAULT_STAT_ADDR, + .mask = 0x07, + }, + }, + .sim = { + .addr = 0x23, + .value = BIT(0), + }, + .multi_read_bit = true, + .bootime = 2, + }, }; static int st_accel_read_raw(struct iio_dev *indio_dev, diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index de8ae4327094..4e54477ccf24 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_i2c.c @@ -102,6 +102,10 @@ static const struct of_device_id st_accel_of_match[] = { .compatible = "st,lis3de", .data = LIS3DE_ACCEL_DEV_NAME, }, + { + .compatible = "st,lis2de12", + .data = LIS2DE12_ACCEL_DEV_NAME, + }, {}, }; MODULE_DEVICE_TABLE(of, st_accel_of_match); @@ -140,6 +144,7 @@ static const struct i2c_device_id st_accel_id_table[] = { { LIS3LV02DL_ACCEL_DEV_NAME }, { LIS2DW12_ACCEL_DEV_NAME }, { LIS3DE_ACCEL_DEV_NAME }, + { LIS2DE12_ACCEL_DEV_NAME }, {}, }; MODULE_DEVICE_TABLE(i2c, st_accel_id_table); |