Commit graph

664324 commits

Author SHA1 Message Date
Martin Blumenstingl c1c2de37c7 iio: adc: meson-saradc: mark all meson_sar_adc_data static and const
These are only passed as of_device_id.data and never modified. Thus we
can mark them as static const, just like the of_device_id instances
where they are used.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 12:22:40 +01:00
Song Hongyan a78587d338 iio: hid-sensor-rotation: Add "scale" and "offset" properties parse support
Add orientation sensor "scale" and "offset" parse support.
These two properties are needed for exponent data conversion.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Xu Even <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 12:22:36 +01:00
Song Hongyan 00907c7a32 iio: hid-sensor-rotation: Add geomagnetic orientation sensor hid support.
Geomagnetic orientation(AM) sensor is one kind of orientation 6dof sensor.
It gives the device rotation in respect to the earth center and the
magnetic north. The sensor is implemented through use of an accelerometer
and magnetometer do not use gyroscope. It is a standard HID sensor.

More information can be found in:
http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf

Geomagnetic orientation(AM) sensor and dev rotation sensor have same
channel and share channel usage id. So the most of the code for relative
orientation sensor can be reused.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 12:22:33 +01:00
Song Hongyan 9ff88edc5e iio: hid-sensor-rotation: Add relative orientation sensor hid support
Relative orientation(AG) sensor is a 6dof orientation sensor,
it depends on acceleration and gyroscope sensor data. It gives
a quaternion describing the orientation of the device relative
to an initial orientation. It is a standard HID sensor.

More information can be found in:
http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf

Relative orientation(AG) sensor and dev rotation sensor have same
channels and share channel usage id. So the most of the code for
relative orientation sensor can be reused.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Xu Even <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-07 12:22:27 +01:00
Quentin Swain b46c39a098 iio: ade7854: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal to fix
warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:07:41 +01:00
Quentin Swain 78425b3290 iio: ade7758: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal permissions to
fix warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:06:24 +01:00
Quentin Swain 37cbe596e2 iio: ade7754: Convert symbolic permissions to octal
Convert symbolic S_IRUGO and S_IWUSR macros to octal permissions
to resolve warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:05:17 +01:00
Quentin Swain 3e8eae9079 iio: ade7753 Convert: symbolic permissions to octal
Convert S_IRUGO and S_IWUSR macros to octal permissions to resolve
warnings reported by checkpatch.pl

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 01:01:44 +01:00
Quentin Swain 2451c5dda4 iio: ad9834 convert symbolic permissions to octal
Remove checkpatch warnings by converting symbolic S_IRUGO and S_IWUSR
permissions to octal

Signed-off-by: Quentin Swain <dudebrobro179@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-05-01 00:59:21 +01:00
Lorenzo Bianconi d3f770582a iio: imu: st_lsm6dsx: add system power management support
Add system sleep power management support to st_lsm6dsx driver.
In particular during suspend phase each sensor is disabled and
hw fifo is configured in bypass in order to avoid subsequent
I/O operations. The patch has been tested on HiKey board device

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30 17:55:15 +01:00
Lorenzo Bianconi 535de397b2 iio: imu: st_lsm6dsx: modify st_lsm6dsx_flush_fifo and st_lsm6dsx_set_fifo_mode scope
Remove static qualifier from st_lsm6dsx_flush_fifo() and
st_lsm6dsx_set_fifo_mode() in order to use them in system sleep pm support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30 17:55:12 +01:00
Sebastian Reichel e530cc8408 iio: isl29028: add isl29030 support
isl29030 is basically the same chip. The only difference
is the chip's first pin. For isl29028 its named ADDR0 and
can be used to change the chip's i2c address. For isl29030
on the other hand that pin is named Ials and is an analog
current output proportional to ALS/IR. This change is
irrelevant for the Linux driver.

This has been tested on Motorola Droid 4.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-30 17:26:04 +01:00
Matt Ranostay d532e5b2bc iio: proximity: as3935: move storm out of range check
Move out of storm check to apply to IIO_CHAN_INFO_RAW so the reported
results are constant between the former and the IIO_CHAN_INFO_PROCESSED

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 07:22:46 +01:00
Colin Ian King c894acc7bf iio: hid-sensor: fix return of -EINVAL on invalid values in ret or value
Ensure that when an invalid value in ret or value is found -EINVAL
is returned. A previous commit broke the way the return error is
being returned and instead caused the return code in ret to be
re-assigned rather than be returned.

Fixes: 5d9854eaea ("iio: hid-sensor: Store restore poll and hysteresis on S3")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 07:16:45 +01:00
Sekhar Nori c36662193b tools/iio: Use include/uapi with __EXPORTED_HEADERS__
Use the local uapi headers to keep in sync with "recently" added enum
values like IIO_UVINDEX.

Build tested using:
$ make -C <kernelsrcdir> tools/iio
$ make -C <kernelsrcdir>/tools iio
$ make -C <kernelsrcdir>/tools/iio

This follows a strategy similar to that used by tools/hv, tools/net and
tools/leds among others.

Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 06:33:12 +01:00
Orson Zhai 1016d56765 iio: core: Fix suspicious sizeof usage
Pointer size is variours in different system, say 32bit for 4 and 64bit
for 8. The 'sizeof(infomask)' may lead to wrong bit numbers.

Signed-off-by: Orson Zhai <orson.zhai@spreadtrum.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 06:30:52 +01:00
Marek Vasut 80a49fd824 iio: adc: rcar-gyroadc: Drop if clock from Renesas GyroADC bindings
The "if" interface clock speed is actually derived from the "fck"
block clock, as in the hardware they are the same clock. Drop the
incorrect second "if" clock and retain only the "fck" clock.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Rob Herring <robh@kernel.org>
Cc: linux-renesas-soc@vger.kernel.org
To: devicetree@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 06:00:19 +01:00
Marek Vasut 1a732f4211 iio: adc: rcar-gyroadc: Derive interface clock speed from fck clock
The "if" interface clock speed is actually derived from the "fck"
block clock, as in the hardware they are the same clock. Drop the
incorrect second "if" clock and get the clock speed from "fck".

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-27 05:58:03 +01:00
Shrirang Bagul 7383d44b84 iio: st_pressure: st_accel: Initialise sensor platform data properly
This patch fixes the sensor platform data initialisation for st_pressure
and st_accel device drivers. Without this patch, the driver fails to
register the sensors when the user removes and re-loads the driver.

1. Unload the kernel modules for st_pressure
$ sudo rmmod st_pressure_i2c
$ sudo rmmod st_pressure

2. Re-load the driver
$ sudo insmod st_pressure
$ sudo insmod st_pressure_i2c

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2017-04-26 06:37:53 +01:00
Brian Masney 105c3de1eb staging: iio: isl29028: move out of staging
Move ISL29028 ALS / Proximity Sensor out of staging and into mainline.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:28:25 +01:00
Brian Masney e4ff6c1b41 staging: iio: isl29028: correct proximity sleep times
The sysfs attribute in_proximity_sampling_frequency_available currently
shows the values 1 3 5 10 13 20 83 100. These values are supposed to
correspond to the sleep values 800 400 200 100 75 50 12.5 0 (all in ms).
When passing in a sampling frequency of 3, it actually uses a sleep
time of 200ms instead of the expected 400ms value. This patch changes
the value shown by this sysfs attribute to use fixed-point numbers so
that the correct sampling frequency is shown to the user. This patch
also changes the code that updates the proximity sampling frequency to
only allow values that are shown in the _available sysfs attribute.

The original code showed the value 83 that corresponds to the sleep
time 12 ms. The data sheet actually lists 12.5 ms as the sleep time,
so the proximity frequency was updated to 80.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:26:09 +01:00
Paolo Cretaro d6d0014c6b staging: iio: tsl2x7x: Replace deprecated macros (S_IRUGO, S_IWUSR)
Use octal digits as suggested by checkpatch instead of deprecated macros.

Signed-off-by: Paolo Cretaro <melko@frugalware.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:04:47 +01:00
Peter Rosin c773f70015 iio: inkern: fix a static checker error
Avoid this smatch error:
drivers/iio/inkern.c:751 iio_read_avail_channel_raw() error: double unlock 'mutex:&chan->indio_dev->info_exist_lock'

Fixes: 00c5f80c2f ("iio: inkern: add helpers to query available values from channels")
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-26 06:04:06 +01:00
Peter Meerwald-Stadler 9a043b0bf2 iio: pressure: Fix name of BME280 part in Kconfig
Bosch BME280 is a combined pressure and humidity sensor

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2017-04-23 12:38:47 +01:00
Laura Abbott e44adf05b8 staging/android: Update Ion TODO list
Most of the items have been taken care of by a clean up series. Remove
the completed items and add a few new ones.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott 804ca94a98 staging: android: ion: Set query return value
This never got set in the ioctl. Properly set a return value of 0 on
success.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott 15c6098cfe staging: android: ion: Remove ion_handle and ion_client
ion_handle was introduced as an abstraction to represent a reference to
a buffer via an ion_client. As frameworks outside of Ion evolved, the dmabuf
emerged as the preferred standard for use in the kernel. This has made
the ion_handle an unnecessary abstraction and prone to race
conditions. ion_client is also now only used internally. We have enough
mechanisms for race conditions and leaks already so just drop ion_handle
and ion_client. This also includes ripping out most of the debugfs
infrastructure since much of that was tied to clients and handles.
The debugfs infrastructure was prone to give confusing data (orphaned
allocations) so it can be replaced with something better if people
actually want it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott e3b914bc7e staging: android: ion: Drop ion_map_kernel interface
Nobody uses this interface externally. Drop it.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott 2f87f50b23 staging: android: ion: Rework heap registration/enumeration
The current model of Ion heap registration  is based on the outdated
model of board files. The replacement for board files (devicetree)
isn't a good replacement for what Ion wants to do. In actuality, Ion
wants to show what memory is available in the system for something else
to figure out what to use. Switch to a model where Ion creates its
device unconditionally and heaps are registed as available regions.
Currently, only system and CMA heaps are converted over to the new
model. Carveout and chunk heaps can be converted over when someone wants
to figure out how.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott eb9751dbe6 staging: android: ion: Collapse internal header files
Ion current has ion_priv.h and ion.h as header files. ion.h was intended
to be used for public APIs but Ion never ended up really having anything
public. Combine the two headers so there is only one internal header.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott ddeb587b94 staging: android: ion: Get rid of ion_phys_addr_t
Once upon a time, phys_addr_t was not everywhere in the kernel. These
days it is used enough places that having a separate Ion type doesn't
make sense. Remove the extra type and just use phys_addr_t directly.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott b0c7cb2623 staging: android: ion: Break the ABI in the name of forward progress
Several of the Ion ioctls were designed in such a way that they
necessitate compat ioctls. We're breaking a bunch of other ABIs and
cleaning stuff up anyway so let's follow the ioctl guidelines and clean
things up while everyone is busy converting things over anyway. As part
of this, also remove the useless alignment field from the allocation
structure.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott 62b3a094cb staging: android: ion: Stop butchering the DMA address
Now that we have proper caching, stop setting the DMA address manually.
It should be set after properly calling dma_map.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:43:14 +02:00
Laura Abbott 204f672255 staging: android: ion: Use CMA APIs directly
When CMA was first introduced, its primary use was for DMA allocation
and the only way to get CMA memory was to call dma_alloc_coherent. This
put Ion in an awkward position since there was no device structure
readily available and setting one up messed up the coherency model.
These days, CMA can be allocated directly from the APIs. Switch to using
this model to avoid needing a dummy device. This also mitigates some of
the caching problems (e.g. dma_alloc_coherent only returning uncached
memory).

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:41:12 +02:00
Laura Abbott e4231bcda7 cma: Introduce cma_for_each_area
Frameworks (e.g. Ion) may want to iterate over each possible CMA area to
allow for enumeration. Introduce a function to allow a callback.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:41:12 +02:00
Laura Abbott f318dd083c cma: Store a name in the cma structure
Frameworks that may want to enumerate CMA heaps (e.g. Ion) will find it
useful to have an explicit name attached to each region. Store the name
in each CMA structure.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 20:41:12 +02:00
Greg Kroah-Hartman df47c0a638 Fifth set of IIO fixes for the 4.11 cycle.
As these are rather late in the cycle, they may sneak over into 4.12.
 There is a fix for a regression caused by another fix (hid sensors
 hardware seems to vary a lot in how various corner cases are handled).
 
 * ad7303
   - fix channel description. Numeric values were being passed as characters
   presumably leading to garbage from the userspace interface.
 * as3935
   - the write data macro was wrong so fix it.
 * bmp280
   - incorrect handling of negative values as being unsigned broke humidity
   calculation.
 * hid-sensor
   - Restore the poll and hysteresis values after resume as some hardware
   doesn't do it.
 * stm32-trigger
   - buglet in reading the sampling frequency
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAljw8ScRHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FojZvBAAh8K9e+3ObpS6/0wj26/XsakiFn4v2ah0
 xKUnafxAVVxU3AU01IJ3CtNdIMyqMwpnB+PvnpgDzZw749QrYKPsBIzheK64eabe
 fzA34X5MWGLwUdOXpfEB0xvsylWjJrqsf1rahgZjiUKkPeZe9EwzPM/fP1sEl5gu
 p+vfSMckboFaKheoQwnWMUTBp0HK+nbFpcSBzljX68u+epiXpDGrjuZC8NJ3JuBn
 Bloz9AhDliIn477H7mIUTXBbt3ixLIDiJ7haQuTNlagosPoUtCBpwY2O9mZ7VRVs
 wM62h7/F170077ReQJRjlfck+7uHoIgDeS46w5UYTzA1HJLxs+veO5xv3VOtHIUg
 BZ+mibQyIUBrFeyYDVbeUpBTffiU6rA+yiM4WFwUFabl7t7rlG0NhLEx7OIQcFMm
 l8u/5JUoJcoykaO8c9Jx5XtrgkXq+rCWVAmhjHqUDAlvsMa6pJWEyqgaVcQeIbdw
 ns9ppJRlOmEst7lMab9TI7BJp3oCIH6uRmctbme42Rw8XgDFdltxqkxmjB8d+cDC
 Q0INhNJN1jRgz6rT6lkxVhAYKtaP5T8qZeliT4MO1E59ggOVSSf8zuhjrEMUK397
 Tu/k7fmATtiKSG+blwYZVRC3+ixh/oKZsvfwZ4O+mFJyhQ616nKMYAywoaZcM8WT
 Z1ABipUDwsE=
 =H5KS
 -----END PGP SIGNATURE-----

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

Jonathan writes:

Fifth set of IIO fixes for the 4.11 cycle.

As these are rather late in the cycle, they may sneak over into 4.12.
There is a fix for a regression caused by another fix (hid sensors
hardware seems to vary a lot in how various corner cases are handled).

* ad7303
  - fix channel description. Numeric values were being passed as characters
  presumably leading to garbage from the userspace interface.
* as3935
  - the write data macro was wrong so fix it.
* bmp280
  - incorrect handling of negative values as being unsigned broke humidity
  calculation.
* hid-sensor
  - Restore the poll and hysteresis values after resume as some hardware
  doesn't do it.
* stm32-trigger
  - buglet in reading the sampling frequency
2017-04-18 19:38:38 +02: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
Martin Karamihov 18125dc003 staging: rtl8192u: fix incorrect type in assignment in ieee80211_tx.c
This patch fixes the following sparse warning:
ieee80211_tx.c:174:36: incorrect type in assignment (different base types)
ieee80211_tx.c:174:36: expected unsigned short [unsigned] [short] [usertype] <noident>
ieee80211_tx.c:174:36: got restricted __be16 [usertype] <noident>

by adding left side cast to __be16.

Signed-off-by: Martin Karamihov <martinowar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:57:05 +02:00
Aishwarya Pant df93c720e1 staging: rtl8188eu: fix sparse signedness warnings in rtw_generate_ie
Changed the type of wpa_ie_len from (int *) to (unsigned int *) in the
function rtw_get_wpa_ie(..) to suppress signedness mismatch warnings in
rtw_generate_ie of the type-

drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60: warning: incorrect
type in argument 2 (different signedness)
drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60:    expected int
*wpa_ie_len
drivers/staging/rtl8188eu//core/rtw_ieee80211.c:1009:60:    got unsigned
int *<noident>

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:25 +02:00
Aishwarya Pant 8321643ccc staging: rtl8188eu: fix sparse signedness warnings in rtw_set_ie
Changed the type of sz from (int) to (unsigned int) to suppress
signedness mismatch warnings of the type-

drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97: warning:
incorrect type in argument 5 (different signedness)
drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97:    expected
unsigned int [usertype] *frlen
drivers/staging/rtl8188eu//core/rtw_ieee80211.c:258:97:    got int
*<noident>

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:25 +02:00
Aishwarya Pant af27bea462 staging: rtl8188eu: fix sparse signedness warnings in rtw_get_ie
Changed the type of len from (int *) to (unsigned int *) in the
function rtw_get_ie(..) and wherever this function is called to
suppress signedness mismatch warnings of the type-

drivers/staging/rtl8188eu//core/rtw_ap.c:78:60: warning: incorrect type
in argument 3 (different signedness)
drivers/staging/rtl8188eu//core/rtw_ap.c:78:60:    expected int *len
drivers/staging/rtl8188eu//core/rtw_ap.c:78:60:    got unsigned int
*<noident>

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:25 +02:00
Colin Ian King d9c7dd5db1 staging: rtl8723bs: clean up identical code on an if statement
The two different paths for an if statement are identical and hence
we can just replace it with the single statement.

Detected by CoverityScan, CID#1428443 ("Identical code for
different branches")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:25 +02:00
Colin Ian King ff8d351d71 staging: rtl8723bs: remove redundant comparisons of unsigned ints with >= 0
The comparison of mode >= 0 is redundant as mode is a u32 and this
is always true.  Remove this redundant code.

Detected with CoverityScan ("Unsigned compared against 0")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:25 +02:00
Kevin Wern baa7a586b5 staging: media/platform/bcm2835: remove gstreamer workaround
Gstreamer's v4l2src reacted poorly to certain outputs from the bcm2835
video driver's ioctl ops function vidioc_enum_framesizes, so a
workaround was created that could be activated by user input. This
workaround would replace the driver's ioctl ops struct with another,
similar struct--only with no function pointed to by
vidioc_enum_framesizes. With no response, gstreamer would attempt to
continue with some default settings that happened to work better.

However, this bug has been fixed in gstreamer since 2014, so we
shouldn't include this workaround in the stable version of the driver.

Signed-off-by: Kevin Wern <kevin.m.wern@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:54:24 +02:00
Tobin C. Harding 7c1c43615d staging: ks7010: fix checkpatch SPLIT_STRING
Checkpatch emits WARNING: quoted string split across lines.

Concatenate string onto single line.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:47:31 +02:00
Tobin C. Harding f1e79f4b96 staging: ks7010: refactor SDIO read/write helpers
Driver SDIO code uses helper functions to do IO to the SDIO
device. Current helpers handle IO of a single byte as well as
multi-byte. Driver predominately uses single byte IO. If the
common case is made simple it simplifies the whole driver. The common
case can be made simple by splitting the multi-byte and single byte
calls into separate functions, i.e 4 functions in total, read single
byte, read multi-byte, write single byte, write multi-byte.

Also, we need to handle the debug code. Currently debug calls after
read/write fail access the IO buffer. This buffer, at best, does not hold
useful data on the error path, at worst is uninitialized and holds
garbage.

Split read/write helper functions into two functions each, one for
single byte IO and one for multi-byte IO. Fix all call sites. Do not
change the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:47:31 +02:00
Tobin C. Harding a9d58d9ad8 staging: ks7010: fix checkpatch LINE_SPACING
Checkpatch emits CHECK: Please don't use multiple blank lines.

Remove multiple blank lines.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:47:31 +02:00
Tobin C. Harding 132f541532 staging: ks7010: fix checkpatch SPACE_BEFORE_TAB
Checkpatch emits WARNING: please, no space before tabs.

Remove space before tabs.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:47:31 +02:00
Tobin C. Harding 0dd30a74b9 staging: ks7010: remove err_ from non-error path label
goto label includes 'err_' suffix but is executed on non-error paths.

Remove err_ suffix from goto label.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18 13:47:31 +02:00