1
0
Fork 0
Commit Graph

198 Commits (redonkable)

Author SHA1 Message Date
Jonathan Cameron 829c0a9634 iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
commit 10ab7cfd55 upstream.

One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
to the size of the timestamp (8 bytes).  This is not guaranteed in
this driver which uses a 16 byte array of smaller elements on the stack.
This is fixed by using an explicit c structure. As there are no
holes in the structure, there is no possiblity of data leakage
in this case.

The explicit alignment of ts is not strictly necessary but potentially
makes the code slightly less fragile.  It also removes the possibility
of this being cut and paste into another driver where the alignment
isn't already true.

Fixes: 36e0371e77 ("iio:itg3200: Use iio_push_to_buffers_with_timestamp()")
Reported-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: <Stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200722155103.979802-6-jic23@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:43:30 +01:00
Andy Shevchenko 3811bd2b93 iio: st_gyro: Correct data for LSM9DS0 gyro
commit e825070f69 upstream.

The commit 41c128cb25 ("iio: st_gyro: Add lsm9ds0-gyro support")
assumes that gyro in LSM9DS0 is the same as others with 0xd4 WAI ID,
but datasheet tells slight different story, i.e. the first scale factor
for the chip is 245 dps, and not 250 dps.

Correct this by introducing a separate settings for LSM9DS0.

Fixes: 41c128cb25 ("iio: st_gyro: Add lsm9ds0-gyro support")
Depends-on: 45a4e4220b ("iio: gyro: st_gyro: fix L3GD20H support")
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-01 09:34:36 +00:00
Denis Ciocca e031d5f558 iio:st_sensors: remove buffer allocation at each buffer enable
This patch is removing the buffer allocation at each buffer enable.
We just allocate enough memory in the main structure during probe
to cover maximum size needed (that anyway is pretty small) [16bytes].

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-11 09:26:04 +01:00
Denis Ciocca 9cd15d521a iio: remove get_irq_data_ready() function pointer and use IRQ number directly
Not even sure why it was there since the beginning. Just use IRQ
number in the sensor_data struct.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-05 16:50:08 +01:00
Denis Ciocca 21b1ee3190 iio:gyro: preenable/postenable/predisable fixup for ST gyro buffer
This patch is trying to cleanup for good the buffers operation functions.
There is no need of using preenable, all can be done into
postenable. Let's also use logical sequence of operations as
already done in accel driver.
Finally also rename the goto label using operation to perform and not
where it fails.

Not stable material as not fixing a 'bug' but rather bringing the
driver in line with general 'patterns' to allow a subsystem wide
cleanup.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-08-05 15:49:12 +01:00
Denis Ciocca 062809ef77 iio: make st_sensors drivers use regmap
This patch is meant to replace the i2c/spi transfer functions with
regmap. SPI framework requires DMA safe buffers so let's add GFP_DMA
flag for memory allocation used by bulk_read functions.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 22:52:06 +01:00
Denis Ciocca 1ecd245e0e iio: move 3-wire spi initialization to st_sensors_spi
Some devices need to be configured with special bit in order to
use spi 3-wire. This was done during device identification phase.
Instead, let's move this part as spi specific.
Doing this the check_device_support function becomes a simple
device id check, so let's rename it.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 22:52:06 +01:00
Denis Ciocca 3c05484c79 iio:gyro: device settings are set immediately during probe
This patch set gyro settings right after probe start. This is
done in preparation of regmap that needs different configuration
based on multiread bit value.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 22:52:05 +01:00
Denis Ciocca 2acca26bba iio:gyro: introduce st_gyro_get_settings() function
The function is introduced to retrieve gyro device settings. It will be
used by probe in order to configure regmap.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-07-27 22:52:05 +01:00
Thomas Gleixner d2912cb15b treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-19 17:09:55 +02:00
Thomas Gleixner a61127c213 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms and conditions of the gnu general public license
  version 2 as published by the free software foundation this program
  is distributed in the hope it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not write to the free
  software foundation inc 51 franklin st fifth floor boston ma 02110
  1301 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 111 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.567572064@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:37:06 +02:00
Thomas Gleixner 2025cf9e19 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms and conditions of the gnu general public license
  version 2 as published by the free software foundation this program
  is distributed in the hope it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 263 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.208660670@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-05 17:36:37 +02:00
Thomas Gleixner fda8d26e61 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177
Based on 1 normalized pattern(s):

  licensed under the gpl 2

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 135 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Steve Winslow <swinslow@gmail.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.071193225@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:29:19 -07:00
Thomas Gleixner c942fddf87 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
Based on 3 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version this program is distributed in the
  hope that it will be useful but without any warranty without even
  the implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version [author] [kishon] [vijay] [abraham]
  [i] [kishon]@[ti] [com] this program is distributed in the hope that
  it will be useful but without any warranty without even the implied
  warranty of merchantability or fitness for a particular purpose see
  the gnu general public license for more details

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version [author] [graeme] [gregory]
  [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
  [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
  [hk] [hemahk]@[ti] [com] this program is distributed in the hope
  that it will be useful but without any warranty without even the
  implied warranty of merchantability or fitness for a particular
  purpose see the gnu general public license for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1105 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:26:37 -07:00
Thomas Gleixner 80503b23b2 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149
Based on 1 normalized pattern(s):

  licensed under the gpl 2 or later

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 82 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190524100845.150836982@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:25:18 -07:00
Thomas Gleixner ec8f24b7fa treewide: Add SPDX license identifier - Makefile/Kconfig
Add SPDX license identifiers to all Make/Kconfig files which:

 - Have no license information of any form

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 10:50:46 +02:00
Thomas Gleixner 09c434b8a0 treewide: Add SPDX license identifier for more missed files
Add SPDX license identifiers to all files which:

 - Have no license information of any form

 - Have MODULE_LICENCE("GPL*") inside which was used in the initial
   scan/conversion to ignore the file

These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:

  GPL-2.0-only

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 10:50:45 +02:00
Greg Kroah-Hartman bf402c08eb 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAlzAvGYRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FoiurRAAtP0JCVyeh1y7xLhJevl7pm3YZ5vdPPNw
 VlaB0zbjH9kJM3KehdZZDxgE+5ZZ66wVCtq4quLb7/kHhHCJ97kPPT1sqdVI/sfQ
 KnwOIJ7JSC+fXxmpBWDyDMvB1NXGWHmNJHAw7SGtJa1/lVdHxPnZ5bMmdfFMadh5
 eNOX5NOxTinafp2sX8M4LPeyOCp2mV4iIUNr14rl2TZruv+xP3Y4N9RTfJDclgCI
 iuK9f6wneSFQ6it48sBE0MGX76az1WvufOEbpl9hWYDoYKl721Yc9WoP2QzTtKMb
 +3Klq/rEMyJjrzm/mu1G/hkPDgnYwsPBAb24b4qSacv70tXlwbwzTEaPu/3avb5r
 22h+fsU61nU1m0GFtNjwwe6p0bm6H3UKHjRaspfq63tEZUUZfRdapmLLTDCRZfcK
 NNRJsqgRvUcqNgR5P/1PBSK+xvp2btgTDy7SrwnrC06RBQ6XY0vq3PpjpTXygH/z
 zbLmNiufIP3k0Z0g2o2PMmHl2tF3ue8LCq4p1FyU1iV8qn7qL40+8LkkZQihDpGT
 i2sMYxexO9qHmm2/GLxrwDTOnLacw2YZRIGthwtVCB8iA1NKkfVCxi1AfasSMJYc
 t5uGmNQKIdXMV0olzflXMoXJ1pTKncTlqKicgWwDeCLUcq4XhobKSoiE5VfCWL+V
 7UBlgLznT/o=
 =McKo
 -----END PGP SIGNATURE-----

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
  ...
2019-04-25 10:50:51 +02:00
Mohan Kumar 49deef1b1a drivers/iio/gyro/mpu3050-core.c: This patch fix the following checkpatch warning.
As per Documentation/timers/timers-howto.txt Msleep < 20ms can sleep for
up to 20ms. so use usleep_range.

Signed-off-by: Mohan Kumar <mohankumar718@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22 11:34:14 +01:00
Rui Miguel Silva 4da38f1be6 iio: gyro: fxas21002c: add spi driver
Add driver to talk over spi to a fxas21002c gyroscope device and use
the core as main controller.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22 11:34:12 +01:00
Rui Miguel Silva a034cbe1c4 iio: gyro: fxas21002c: add i2c driver
Add the real driver to talk over i2c and use the fxas21002c core
for the main tasks.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22 11:34:12 +01:00
Rui Miguel Silva a0701b6263 iio: gyro: add core driver for fxas21002c
Add core support for the NXP fxas21002c Tri-axis gyroscope,
using the iio subsystem. It supports PM operations, axis reading,
temperature, scale factor of the axis, high pass and low pass
filtering, and sampling frequency selection.

It will have extras modules to support the communication over i2c and
spi.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22 11:34:09 +01:00
Greg Kroah-Hartman 817de6b859 Merge 5.1-rc6 into staging-next
We want the fixes in here as well as this resolves an iio driver merge
issue.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-21 23:18:44 +02:00
H. Nikolaus Schaller 94bceb3cf5 iio: gyro: bmg160: add device tree compatibility table
Add of_match_table.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:20:52 +01:00
H. Nikolaus Schaller 70b5fdbb2e iio: gyro: itg3200: add mount matrix support
This patch allows to read a mount-matrix device tree
property and report to user-space or in-kernel iio
clients.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:19:47 +01:00
H. Nikolaus Schaller 3a6049f6db iio: gyro: bmg160: add mount matrix support
This patch allows to read a mount-matrix device tree
property and report to user-space or in-kernel iio
clients.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:19:47 +01:00
Andy Shevchenko fb1589710e iio: Allow to read mount matrix from ACPI
Currently mount matrix is allowed in Device Tree, though there is
no technical issue to extend it to support ACPI.

Convert the function to use device_property_read_string_array() and
thus allow to read mount matrix from ACPI if available.

Example of use in _DSD method:

  Name (_DSD, Package ()
  {
     ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
     Package ()
     {
        Package () { "mount-matrix", Package() {
                "1", "0",     "0",
                "0", "0.866", "0.5",
                "0", "-0.5",  "0.866",
        } },
     }
  })

At the same time drop the "of" prefix from its name and
convert current users.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:19:46 +01:00
Sergey Larin 409a51e0a4 iio: gyro: mpu3050: fix chip ID reading
According to the datasheet, the last bit of CHIP_ID register controls
I2C bus, and the first one is unused. Handle this correctly.

Note that there are chips out there that have a value such that
the id check currently fails.

Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-03-09 16:55:06 +00:00
Mike Looijmans 40a7198a4a iio/gyro/bmg160: Use millidegrees for temperature scale
Standard unit for temperature is millidegrees Celcius, whereas this driver
was reporting in degrees. Fix the scale factor in the driver.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-03-09 16:55:05 +00:00
Hans de Goede 0145b50566 iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers
Before this commit sensor_hub_input_attr_get_raw_value() failed to take
the signedness of 16 and 8 bit values into account, returning e.g.
65436 instead of -100 for the z-axis reading of an accelerometer.

This commit adds a new is_signed parameter to the function and makes all
callers pass the appropriate value for this.

While at it, this commit also fixes up some neighboring lines where
statements were needlessly split over 2 lines to improve readability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-16 11:42:12 +00:00
Rodrigo Siqueira 67464a54e5 iio: Replace occurrences of magic number 0 by IIO_CHAN_INFO_RAW
Usually, functions responsible for reading raw data typically relies on
values from iio_chan_info_enum to correctly identify the type of data to
be read. There is a set of a device driver that uses the magic number 0
instead of IIO_CHAN_INFO_RAW. This patch improves the readability by
replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW in six
devices driver in the IIO subsystem.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-03-07 20:14:36 +00:00
Venkat Prashanth B U 9aaea09b4c gyro:adis16136: fix debugfs_simple_attr.cocci warnings
Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
for debugfs files.

Semantic patch information:
Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
imposes some significant overhead as compared to
DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().

Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci

Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:44 +01:00
Pravin Shedge ef6cad920d drivers: iio: gyro: remove duplicate includes
These duplicate includes have been found with scripts/checkincludes.pl but
they have been removed manually to avoid removing false positives.

Signed-off-by: Pravin Shedge <pravin.shedge4linux@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:03:42 +01:00
Linus Torvalds 449fcf3ab0 Staging/IIO patches for 4.15-rc1
Here is the "big" staging and IIO driver update for 4.15-rc1.
 
 Lots and lots of little changes, almost all minor code cleanups as the
 Outreachy application process happened during this development cycle.
 Also happened was a lot of IIO driver activity, and the typec USB code
 moving out of staging to drivers/usb (same commits are in the USB tree
 on a persistent branch to not cause merge issues.)
 
 Overall, it's a wash, I think we added a few hundred more lines than
 removed, but really only a few thousand were modified at all.
 
 All of these have been in linux-next for a while.  There might be a
 merge issue with Al's vfs tree in the pi433 driver (take his changes,
 they are always better), and the media tree with some of the odd atomisp
 cleanups (take the media tree's version).
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWgnFrg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ymxbwCgtNlBkqD2JJYpLRKvI/C4w1vzZsEAnA2THRkt
 g3ioPBqmqC/2DSbldr2o
 =/ebw
 -----END PGP SIGNATURE-----

Merge tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO updates from Greg KH:
 "Here is the "big" staging and IIO driver update for 4.15-rc1.

  Lots and lots of little changes, almost all minor code cleanups as the
  Outreachy application process happened during this development cycle.
  Also happened was a lot of IIO driver activity, and the typec USB code
  moving out of staging to drivers/usb (same commits are in the USB tree
  on a persistent branch to not cause merge issues.)

  Overall, it's a wash, I think we added a few hundred more lines than
  removed, but really only a few thousand were modified at all.

  All of these have been in linux-next for a while. There might be a
  merge issue with Al's vfs tree in the pi433 driver (take his changes,
  they are always better), and the media tree with some of the odd
  atomisp cleanups (take the media tree's version)"

* tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (507 commits)
  staging: lustre: add SPDX identifiers to all lustre files
  staging: greybus: Remove redundant license text
  staging: greybus: add SPDX identifiers to all greybus driver files
  staging: ccree: simplify ioread/iowrite
  staging: ccree: simplify registers access
  staging: ccree: simplify error handling logic
  staging: ccree: remove dead code
  staging: ccree: handle limiting of DMA masks
  staging: ccree: copy IV to DMAable memory
  staging: fbtft: remove redundant initialization of buf
  staging: sm750fb: Fix parameter mistake in poke32
  staging: wilc1000: Fix bssid buffer offset in Txq
  staging: fbtft: fb_ssd1331: fix mirrored display
  staging: android: Fix checkpatch.pl error
  staging: greybus: loopback: convert loopback to use generic async operations
  staging: greybus: operation: add private data with get/set accessors
  staging: greybus: loopback: Fix iteration count on async path
  staging: greybus: loopback: Hold per-connection mutex across operations
  staging: greybus/loopback: use ktime_get() for time intervals
  staging: fsl-dpaa2/eth: Extra headroom in RX buffers
  ...
2017-11-13 20:53:28 -08:00
Greg Kroah-Hartman b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Lorenzo Bianconi 281dbadb5f iio: gyro: st_gyro: add SPI-3wire support to st_gyro framework
Add SPI Serial Interface Mode (SIM) register information
to STM gyroscope framework

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-10 20:32:28 +01:00
Lorenzo Bianconi 75d4c6d2e1 iio: st_sensors: decouple irq1 configuration parameters from the irq2 ones
Separate data-ready configuration parameters for INT1 and INT2 pins in
st_sensor_data_ready_irq data structure. That change will be use to
properly support LIS2DW12 accel sensor.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 21:04:22 +01:00
Lorenzo Bianconi e72a060151 iio: st_sensors: add register mask for status register
Introduce register mask for data-ready status register since
pressure sensors (e.g. LPS22HB) export just two channels
(BIT(0) and BIT(1)) and BIT(2) is marked reserved while in
st_sensors_new_samples_available() value read from status register
is masked using 0x7.
Moreover do not mask status register using active_scan_mask since
now status value is properly masked and if the result is not zero the
interrupt has to be consumed by the driver. This fix an issue on LPS25H
and LPS331AP where channel definition is swapped respect to status
register.
Furthermore that change allows to properly support new devices
(e.g LIS2DW12) that report just ZYXDA (data-ready) field in status register
to figure out if the interrupt has been generated by the device.

Fixes: 97865fe413 (iio: st_sensors: verify interrupt event to status)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-10-09 21:01:45 +01:00
Jonathan Cameron 227e8ef81d iio:gyro: drop assign iio_info.driver_module and iio_trigger_ops.owner
The equivalent of both of these are now done via macro magic when
the relevant register calls are made.  The actual structure
elements will shortly go away.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-08-22 21:28:56 +01:00
Lorenzo Bianconi 794694ce23 iio: gyro: st_gyro_spi: add OF capability to st_gyro_spi
Add device tree support for L3G4200D, LSM330D, LSM330DL, LSM330DLC,
L3GD20, L3GD20H, L3G4IS, LSM330, LSM9DS0 gyroscope sensors

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-02 10:24:56 +01:00
Linus Walleij b64a097af4 iio: gyro: mpu3050: Allow open drain with anything
Open drain should work fine with rising or high level IRQs,
this code was due to some misunderstanding on my part.

Reported-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-02 10:24:51 +01:00
Lorenzo Bianconi 250bbbdbed iio: common: st_sensors: move st_sensors_of_i2c_probe() in common code
Move st_sensors_of_i2c_probe() in st_sensors_core and rename it in
st_sensors_of_name_probe(). That change is necessary to add device-tree
support in spi code otherwise the rest of the autodetection will fail
since spi->modalias (and indio_dev->name) will be set using compatible
string value that differs from standard sensor name

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-01 10:16:56 +01:00
Lorenzo Bianconi 45a4e4220b iio: gyro: st_gyro: fix L3GD20H support
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: 9444a300c2 (IIO: Add support for L3GD20H gyroscope)
Fixes: a065771641 ("iio:gyro: bug on L3GD20H gyroscope support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-07-01 10:16:37 +01:00
Greg Kroah-Hartman d47e538235 Fourth set of IIO new device support, features and cleanups for the 4.12 cycle
New device support
 * max1117, 1118 and 1119
   - new ADC driver
 * max9611
   - new ADC driver
 * pm8xxx hk/xoadc
   - new driver with some shared features broken out from the SPMI vadc.
 * sun4i-gpadc
   - A33 thermal sensor support (with associated rework)
 * stm32-dac
   - new driver and bindings
 * stm32 trigger
   - enable support of quadrature encoder device and counter modes
 
 Features
 * apds9960
   - use the runtime pm for normal suspend
 * stm32-adc
   - add opition to sest resolution via devicetree
 * xoadc
   - augment DT bindings to deal with some weird mux cases
 
 Cleanups
 * ad5933
   - protect direct mode using claim and release helpers
 * ade7759
   - S_IRUGO and friends to octal in two goes
 * adis16203
   - drop unnecessary brackets
 * hid-sensor
   - fix unbalanced pm_runtieme_enable error when probing after remove
 * lsm6dsx
   - use actual part numbers for device name when known
   - simplify data read pin parsing
 * mpu3050
   - avoid double reporting errors
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAljxPf4RHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FojZfA//UUaFcaEiMJjoUwBQlOM49nueGcAlOOOz
 blMYe6JIIm3DYjEJnNhlA1Wn83JVitGQopQ4Tt9yrsxc3urt6GiAiRCK1Lwuyauw
 l1IrdsV9tzbPrauL8UxZYygIYHZx6ltKnpbSHCrXaA2BOTIYzgIBDGmRv+MPutwW
 iaW+dKJVW5G/5VV0aIaJc2w5wXujFcWkZoiTJgZBHhGJJ5AY6zyA3tBEOIY7K3KO
 z4EIY6V9pvVaSgvuWGVWQjtYwjqSSqp5J5Ih7ATpp4hPwi+XIudWqaiq1y2rHQKM
 Y/wqjz+W/NyAJGSFEnub7gE4wGauQtxMiOLTenrfDWkFxF0YRkunylY8Kwcgvmhh
 +TdHhazlfIHca5z/MJ0dg/4UPj75o2CtB+N1NyNMjx/K7Juu2MmcKNShLa/l68jT
 rYEuNQUyhTvNuhlYPTcYmGbL7VbyXJzgbVbk9/Dd1hcS+p/oqn18ulGsWxcj5kEI
 ME+vHOakq02GTAQEG2FLvE604fTt/dHyXdYFsDY0RCm9ZSURvRqFLYpkxyrQFe+P
 yhC9b6ouW+dPGez0RmwPZTWnH0E6eN5b13yR3ILewj/NUVA6cjlm0inhnck1IwFe
 NWVQiMz1a2DsXfk5VjBQVlsipHxW9rs8SArdWnndDpbSErQJT/KrCxantmkNciYw
 oXf1eFCo/MQ=
 =zHqs
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.12d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Fourth set of IIO new device support, features and cleanups for the 4.12 cycle

New device support
* max1117, 1118 and 1119
  - new ADC driver
* max9611
  - new ADC driver
* pm8xxx hk/xoadc
  - new driver with some shared features broken out from the SPMI vadc.
* sun4i-gpadc
  - A33 thermal sensor support (with associated rework)
* stm32-dac
  - new driver and bindings
* stm32 trigger
  - enable support of quadrature encoder device and counter modes

Features
* apds9960
  - use the runtime pm for normal suspend
* stm32-adc
  - add opition to sest resolution via devicetree
* xoadc
  - augment DT bindings to deal with some weird mux cases

Cleanups
* ad5933
  - protect direct mode using claim and release helpers
* ade7759
  - S_IRUGO and friends to octal in two goes
* adis16203
  - drop unnecessary brackets
* hid-sensor
  - fix unbalanced pm_runtieme_enable error when probing after remove
* lsm6dsx
  - use actual part numbers for device name when known
  - simplify data read pin parsing
* mpu3050
  - avoid double reporting errors
2017-04-18 17:13:31 +02:00
Greg Kroah-Hartman f78a8236c6 Merge 4.11-rc6 into staging-next
We want the staging and iio fixes in here to handle merging easier.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-10 15:21:55 +02:00
Peter Rosin 6a95d825f6 iio: gyro: mpu3050: stop double error reporting
i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-03 20:40:51 +01:00
Quentin Schulz 4bdc902968 iio: bmg160: reset chip when probing
The gyroscope chip might need to be reset to be used.

Without the chip being reset, the driver stopped at the first
regmap_read (to get the CHIP_ID) and failed to probe.

The datasheet of the gyroscope says that a minimum wait of 30ms after
the reset has to be done.

This patch has been checked on a BMX055 and the datasheet of the BMG160
and the BMI055 give the same reset register and bits.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-25 16:36:25 +00:00
Javier Martinez Canillas 91b4b16617 iio: gyro: itg3200: Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-03-19 10:58:31 +00:00
Wei Yongjun 752d01d990 iio: common: ssp_sensors: gyro: use devm_iio_device_register()
Use devm_iio_device_register() for IIO subsystem device
registration and delete the remove function since there
is no need after this change.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-01-28 12:16:17 +00:00
Jonathan Cameron 8abd5ba539 iio:kfifo_buf header include push down.
As a precursor to splitting buffer.h, lets make sure all drivers
include the relevant headers rather than relying on picking them
up from kfifo_buf.h.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-01-10 19:54:53 +00:00