linux-2.6-microblaze.git
5 years agodt-bindings: iio: vadc: Fix documentation of 'reg'
Matthias Kaehlcke [Thu, 6 Sep 2018 21:04:52 +0000 (14:04 -0700)]
dt-bindings: iio: vadc: Fix documentation of 'reg'

The documentation of Qualcomm's SPMI PMIC voltage ADC claims that the
'reg' property consists of two values, the SPMI address and the length
of the controller's registers. However the SPMI bus to which it is added
specifies "#size-cells = <0>;". Remove the controller register length
from the documentation of the field and the example.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: pressure: ms5611: switch to SPDX identifier
Tomasz Duszynski [Sat, 1 Sep 2018 19:52:14 +0000 (21:52 +0200)]
iio: pressure: ms5611: switch to SPDX identifier

Drop boilerplate license text and use SPDX identifier instead.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: bh1750: switch to SPDX identifier
Tomasz Duszynski [Sat, 1 Sep 2018 19:51:44 +0000 (21:51 +0200)]
iio: light: bh1750: switch to SPDX identifier

Drop boilerplate license text and use SPDX identifier instead.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: imu: st_lsm6dsx: add LSM6DSO device bindings
Lorenzo Bianconi [Thu, 30 Aug 2018 20:52:59 +0000 (22:52 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: add LSM6DSO device bindings

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: st_lsm6dsx: add support to LSM6DSO
Lorenzo Bianconi [Thu, 30 Aug 2018 20:52:58 +0000 (22:52 +0200)]
iio: imu: st_lsm6dsx: add support to LSM6DSO

Add support to STM LSM6DSO 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/lsm6dso.pdf

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: st_lsm6dsx: add addr/max_word_len to st_lsm6dsx_read_block()
Lorenzo Bianconi [Thu, 30 Aug 2018 20:52:57 +0000 (22:52 +0200)]
iio: imu: st_lsm6dsx: add addr/max_word_len to st_lsm6dsx_read_block()

Add reg addr and max_word_len parameters to st_lsm6dsx_read_block
since LSM6DSO will use a different register address to read samples
from the FIFO and a different sample len

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: st_lsm6dsx: make st_lsm6dsx_check_odr() non-static
Lorenzo Bianconi [Thu, 30 Aug 2018 20:52:56 +0000 (22:52 +0200)]
iio: imu: st_lsm6dsx: make st_lsm6dsx_check_odr() non-static

Remove static qualifier from st_lsm6dsx_check_odr() definition in order to
use it for the support of new devices

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: st_lsm6dsx: add read_fifo callback to fifo_ops
Lorenzo Bianconi [Thu, 30 Aug 2018 20:52:55 +0000 (22:52 +0200)]
iio: imu: st_lsm6dsx: add read_fifo callback to fifo_ops

Remove static qualifier from st_lsm6dsx_read_fifo definition and
introduce read_fifo function pointer in fifo_ops data structure
in order to run the proper read_fifo routine since other compliant
devices will use a different FIFO queueing scheme.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: ad5758: Add support for hard reset
Stefan Popa [Wed, 29 Aug 2018 14:58:42 +0000 (17:58 +0300)]
iio: dac: ad5758: Add support for hard reset

The ad5758 has a hardware reset active low input pin. This patch adds a
devicetree entry for a reset GPIO and a new ad5758_reset() function.
During
initialization, it is checked if the reset property is specified and the
the GPIO is being asserted, therefore the device will become active.

When the reset function is called, if the gpio_reset var is set, then
the
GPIO will be toggled, otherwise a software reset is performed.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: Convert to using %pOFn instead of device_node.name
Rob Herring [Tue, 28 Aug 2018 01:52:23 +0000 (20:52 -0500)]
iio: Convert to using %pOFn instead of device_node.name

In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: qcom-spmi-adc5: Verify channel numbers from DT
Matthias Kaehlcke [Mon, 27 Aug 2018 21:14:53 +0000 (14:14 -0700)]
iio: adc: qcom-spmi-adc5: Verify channel numbers from DT

The driver only defines a subset of all possible ADC channels. Channel
numbers read from the device tree are accepted as long as they don't
exceed a max value, even when no channel definition exists. Add a
check to abort initialization in this case.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: fix position relative kernel version
Eugen Hristev [Tue, 28 Aug 2018 10:30:34 +0000 (13:30 +0300)]
iio: fix position relative kernel version

Position relative channel type was added in 4.19 kernel version

Fixes: "3055a6cfa04ba" ("iio: Add channel for Position Relative")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: light: isl29501: Simplify code to kill compiler warning
Geert Uytterhoeven [Thu, 23 Aug 2018 21:24:35 +0000 (23:24 +0200)]
iio: light: isl29501: Simplify code to kill compiler warning

With gcc 4.1.2:

    drivers/iio/proximity/isl29501.c: In function ‘isl29501_register_write’:
    drivers/iio/proximity/isl29501.c:235: warning: ‘msb’ may be used uninitialized in this function

While this is a false positive, it can easily be avoided by removing the
"msb" intermediate variable.
Remove the "lsb" intermediate variable for consistency.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: sc27xx: Add ADC scale calibration
Baolin Wang [Wed, 29 Aug 2018 06:04:05 +0000 (14:04 +0800)]
iio: adc: sc27xx: Add ADC scale calibration

This patch adds support to read calibration values from the eFuse
controller to calibrate the ADC channel scales, which can make ADC
sample data more accurate.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: sc27xx: Add raw data support
Baolin Wang [Wed, 29 Aug 2018 06:04:04 +0000 (14:04 +0800)]
iio: adc: sc27xx: Add raw data support

The headset device will use channel 20 of ADC controller to detect events,
but it needs the raw ADC data to do conversion according to its own formula.

Thus we should configure the channel mask separately and configure channel
20 as IIO_CHAN_INFO_RAW, as well as adding raw data read support.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: ti-dac5571: provide of_match_table to driver
Marcus Folkesson [Fri, 24 Aug 2018 20:24:59 +0000 (22:24 +0200)]
iio: dac: ti-dac5571: provide of_match_table to driver

Use the created list of of_device_id's as a match table.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: mcp4922: fix error handling in mcp4922_write_raw
Marcus Folkesson [Fri, 24 Aug 2018 20:24:40 +0000 (22:24 +0200)]
iio: dac: mcp4922: fix error handling in mcp4922_write_raw

Do not try to write negative values and make sure that the write goes well.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoMAINTAINERS: add entry for ltc1660 DAC driver
Marcus Folkesson [Tue, 21 Aug 2018 19:31:26 +0000 (21:31 +0200)]
MAINTAINERS: add entry for ltc1660 DAC driver

Add entry for ltc1660 DAC driver and add myself as
maintainer of this driver.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: dac: add bindings for ltc1660
Marcus Folkesson [Tue, 21 Aug 2018 19:31:25 +0000 (21:31 +0200)]
dt-bindings: iio: dac: add bindings for ltc1660

LTC1665/LTC1660 is a 8/10-bit Digital-to-Analog Converter (DAC)
with eight individual channels.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: add support for ltc1660
Marcus Folkesson [Tue, 21 Aug 2018 19:31:24 +0000 (21:31 +0200)]
iio: dac: add support for ltc1660

LTC1665/LTC1660 is a 8/10-bit Digital-to-Analog Converter
(DAC) with eight individual channels.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:adxl372: Add filter bandwidth support
Stefan Popa [Mon, 20 Aug 2018 14:54:55 +0000 (17:54 +0300)]
iio:adxl372: Add filter bandwidth support

This patch adds the option for the user to select the filter bandwidth. The
user can also read the available bandwidths which are always adjusted to be
at most half of the sampling frequency. Furthermore, the currently selected
bandwidth can be read via the read_raw function, while the write_raw sets a
new bandwidth value.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:adxl372: Add sampling frequency support
Stefan Popa [Mon, 20 Aug 2018 14:54:27 +0000 (17:54 +0300)]
iio:adxl372: Add sampling frequency support

This patch adds the option for the user to select the sampling frequency.
Also, the user can read the available frequencies and read the currently
set frequency via the read_raw function. The frequency can be set via the
write_raw function.

When the frequency is set, the bandwidth is also checked and ensured
that it is constrained to at most half of the sampling frequency. Also, the
activity and inactivity timers have to be updated because they depend on
the selected ODR.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adxl372: Provide validate_trigger and validate_device callbacks
Stefan Popa [Mon, 20 Aug 2018 14:53:43 +0000 (17:53 +0300)]
iio: adxl372: Provide validate_trigger and validate_device callbacks

This patch provides a validate_device callback for the trigger which makes
sure that other devices are rejected.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: Remove field value defines
David Frey [Mon, 20 Aug 2018 17:39:59 +0000 (10:39 -0700)]
iio: chemical: bme680: Remove field value defines

Remove BME680_RUN_GAS_EN_BIT and BME680_NB_CONV_0_VAL field value
definitions because the fields are simply boolean and integer
respectively.

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: multiplexer: switch to SPDX license identifier
Peter Rosin [Mon, 20 Aug 2018 10:01:14 +0000 (12:01 +0200)]
iio: multiplexer: switch to SPDX license identifier

Drop the boilerplate license text.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dpot-dac: switch to SPDX license identifier
Peter Rosin [Mon, 20 Aug 2018 10:01:13 +0000 (12:01 +0200)]
iio: dpot-dac: switch to SPDX license identifier

Drop the boilerplate license text.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: envelope-detector: switch to SPDX license identifier
Peter Rosin [Mon, 20 Aug 2018 10:01:12 +0000 (12:01 +0200)]
iio: envelope-detector: switch to SPDX license identifier

Drop the boilerplate license text.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: potentiometer: mcp4531: switch to SPDX license identifier
Peter Rosin [Mon, 20 Aug 2018 10:01:11 +0000 (12:01 +0200)]
iio: potentiometer: mcp4531: switch to SPDX license identifier

Drop the boilerplate license text and use the correct MODULE_LICENSE.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: potentiometer: mcp4018: use the correct MODULE_LICENSE
Peter Rosin [Mon, 20 Aug 2018 10:01:10 +0000 (12:01 +0200)]
iio: potentiometer: mcp4018: use the correct MODULE_LICENSE

The file is GPL v2 only.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: potentiometer: merge calls to of_match_device and of_device_get_match_data
Julia Lawall [Mon, 21 May 2018 09:49:10 +0000 (11:49 +0200)]
iio: potentiometer: merge calls to of_match_device and of_device_get_match_data

Drop call to of_match_device, which is subsumed by the subsequent
call to of_device_get_match_data.  The code becomes simpler, and a
temporary variable can be dropped.

The semantic match that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
local idexpression match;
identifier i;
expression x, dev, e, e1;
@@
-        match@i = of_match_device(x, dev);
-        if (match) e = of_device_get_match_data(dev);
-        else e = e1;
+        e = of_device_get_match_data(dev);
+        if (!e) e = e1;

@@
identifier r.i;
@@
- const struct of_device_id *i;
... when != i
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: Add check for val2 in the write_raw function
Himanshu Jha [Sat, 11 Aug 2018 10:26:36 +0000 (15:56 +0530)]
iio: chemical: bme680: Add check for val2 in the write_raw function

val2 is responsible for the floating part of the number to be
written to the device. We don't need the floating part
while writing the oversampling ratio for BME680 since the
available oversampling ratios are pure natural numbers.

So, add a sanity check to make sure val2 is 0.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoMAINTAINERS: Add entry for mcp3911 ADC driver
Marcus Folkesson [Wed, 8 Aug 2018 08:09:17 +0000 (10:09 +0200)]
MAINTAINERS: Add entry for mcp3911 ADC driver

Add an entry for mcp3911 ADC driver and add myself and
Kent Gustavsson as maintainers of this driver.

Co-Developed-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: adc: add bindings for mcp3911
Marcus Folkesson [Wed, 8 Aug 2018 08:09:16 +0000 (10:09 +0200)]
dt-bindings: iio: adc: add bindings for mcp3911

MCP3911 is a dual channel Analog Front End (AFE) containing two
synchronous sampling delta-sigma Analog-to-Digital Converters (ADC).

Co-Developed-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: add support for mcp3911
Marcus Folkesson [Wed, 8 Aug 2018 08:09:15 +0000 (10:09 +0200)]
iio: adc: add support for mcp3911

MCP3911 is a dual channel Analog Front End (AFE) containing two
synchronous sampling delta-sigma Analog-to-Digital Converters (ADC).

Co-developed-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adxl345: move null check for i2c id at start of probe
Alexandru Ardelean [Tue, 7 Aug 2018 14:06:05 +0000 (17:06 +0300)]
iio: adxl345: move null check for i2c id at start of probe

Fixes ef89f4b96a2 ("iio: adxl345: Add support for the ADXL375").

This was found via static checker.
After looking into the code a bit, it's unlikely that there will be a NULL
dereference if the `id` object in that specific code path.
However, it's safe to add a NULL (paranoid) check just to make sure and
remove any uncertainties.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: max44000: remove unused variable max44000_alstim_shift
Colin Ian King [Thu, 9 Aug 2018 13:53:38 +0000 (14:53 +0100)]
iio: max44000: remove unused variable max44000_alstim_shift

Variable max44000_alstim_shift is defined but is never used hence it is
redundant and can be removed. This variable has been like this since
the driver was added back in 2016.

Cleans up clang warning:
warning: 'max44000_alstim_shift' defined but not used [-Wunused-const-variable=]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio:adxl372: Add FIFO and interrupts support
Stefan Popa [Fri, 10 Aug 2018 08:46:21 +0000 (11:46 +0300)]
iio:adxl372: Add FIFO and interrupts support

This patch adds support for the adxl372 FIFO. In order to accomplish this,
triggered buffers were used.

The number of FIFO samples which trigger the watermark interrupt can be
configured by using the buffer watermark. The FIFO format is determined by
configuring the scan elements for each axis. The FIFO data is pushed to the
IIO device's buffer.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoMerge tag 'regmap-noinc-read' into togreg
Jonathan Cameron [Sun, 19 Aug 2018 17:06:59 +0000 (18:06 +0100)]
Merge tag 'regmap-noinc-read' into togreg

regmap: Support non-incrementing registers

Some devices have individual registers that don't autoincrement the
register address during bulk reads but instead repeatedly read the same
value, for example for monitoring GPIOs or ADCs.  Add support for these.

5 years agodt-bindings: iio: accel: Add docs for ADXL372
Stefan Popa [Fri, 10 Aug 2018 08:46:19 +0000 (11:46 +0300)]
dt-bindings: iio: accel: Add docs for ADXL372

Add the device tree binding documentation for the ADXL372 3-axis digital
accelerometer.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adxl372: New driver for Analog Devices ADXL372 Accelerometer
Stefan Popa [Fri, 10 Aug 2018 08:46:18 +0000 (11:46 +0300)]
iio: adxl372: New driver for Analog Devices ADXL372 Accelerometer

This patch adds basic support for Analog Devices ADXL372 SPI-Bus
Three-Axis Digital Accelerometer.

The device is probed and configured the with some initial default
values. With this basic driver, it is possible to read raw acceleration
data.

Datasheet:
http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL372.pdf

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list
Matthias Kaehlcke [Fri, 10 Aug 2018 19:47:02 +0000 (12:47 -0700)]
iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list

Add ADC5_AMUX_THM2_100K_PU and ADC5_AMUX_THM4_100K_PU to the list of
rev2 ADC channels.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: max9611: explicitly cast gain_selectors
Stefan Agner [Sat, 11 Aug 2018 09:12:19 +0000 (11:12 +0200)]
iio: adc: max9611: explicitly cast gain_selectors

After finding a reasonable gain, the function converts the configured
gain to a gain configuration option selector enum max9611_csa_gain.
Make the conversion clearly visible by using an explicit cast. This
also avoids a warning seen with clang:
  drivers/iio/adc/max9611.c:292:16: warning: implicit conversion from
      enumeration type 'enum max9611_conf_ids' to different enumeration
      type 'enum max9611_csa_gain' [-Wenum-conversion]
                        *csa_gain = gain_selectors[i];
                                  ~ ^~~~~~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: mcp4725: avoid using CONFIG_PM_SLEEP
Marcus Folkesson [Sat, 11 Aug 2018 08:47:25 +0000 (10:47 +0200)]
iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP

This is already handled by SIMPLE_DEV_PM_OPS().

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: max5821: avoid using CONFIG_PM_SLEEP
Marcus Folkesson [Sat, 11 Aug 2018 08:47:18 +0000 (10:47 +0200)]
iio: dac: max5821: avoid using CONFIG_PM_SLEEP

This is already handled by SIMPLE_DEV_PM_OPS().

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: dac: max517: avoid using CONFIG_PM_SLEEP
Marcus Folkesson [Sat, 11 Aug 2018 08:47:09 +0000 (10:47 +0200)]
iio: dac: max517: avoid using CONFIG_PM_SLEEP

This is already handled by SIMPLE_DEV_PM_OPS().

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodrivers: iio: Update MODULE AUTHOR email address
Michael Hennerich [Tue, 14 Aug 2018 11:23:17 +0000 (13:23 +0200)]
drivers: iio: Update MODULE AUTHOR email address

no functional changes

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: health: max30102: Mark expected switch fall-throughs
Gustavo A. R. Silva [Wed, 15 Aug 2018 16:23:49 +0000 (11:23 -0500)]
iio: health: max30102: Mark expected switch fall-throughs

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Notice that in this particular case, I placed the "fall through"
annotation at the bottom of the case, which is what GCC is expecting
to find.

Addresses-Coverity-ID: 1458342 ("Missing break in switch")
Addresses-Coverity-ID: 1458345 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: pressure: ms5611: remove deprecated compatible strings
Tomasz Duszynski [Thu, 16 Aug 2018 18:49:15 +0000 (20:49 +0200)]
iio: pressure: ms5611: remove deprecated compatible strings

Compatible strings tend to follow manufacturer,model format.
In case one wants to do a matching with manufacturer stripped
off he can still do so since SPI/I2C core will try id_table
based matching anyway.

Signed-off-by: Tomasz Duszynski <tduszyns@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: simplify oversampling handling
David Frey [Fri, 17 Aug 2018 19:03:19 +0000 (12:03 -0700)]
iio: chemical: bme680: simplify oversampling handling

Temperature, pressure and humidity all expose and oversampling setting
that works in the same way.  Provide common handling for the
oversampling sysfs attributes.

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: use FIELD_GET macro
David Frey [Fri, 17 Aug 2018 19:03:18 +0000 (12:03 -0700)]
iio: chemical: bme680: use FIELD_GET macro

Use the FIELD_GET macro instead of explicit mask and shift.

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: use GENMASK macro
David Frey [Fri, 17 Aug 2018 19:03:17 +0000 (12:03 -0700)]
iio: chemical: bme680: use GENMASK macro

Replace hardcoded bit masks with GENMASK macro

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: change MSK->MASK in #defines
David Frey [Fri, 17 Aug 2018 19:03:16 +0000 (12:03 -0700)]
iio: chemical: bme680: change MSK->MASK in #defines

Convert all defines to use "MASK" instead of a mix of "MSK" and "MASK"

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: indent #defines consistently
David Frey [Fri, 17 Aug 2018 19:03:15 +0000 (12:03 -0700)]
iio: chemical: bme680: indent #defines consistently

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: cleanup bme680_read_calib formatting
David Frey [Fri, 17 Aug 2018 19:03:14 +0000 (12:03 -0700)]
iio: chemical: bme680: cleanup bme680_read_calib formatting

Use the full 80 char width to reduce the number of lines taken
by function calls.

Remove blank lines where it aids clarity by bringing together related
code blocks (such as read hi and low bytes and then combine them into
one value).

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: bme680: use clamp macro
David Frey [Fri, 17 Aug 2018 19:03:13 +0000 (12:03 -0700)]
iio: chemical: bme680: use clamp macro

Signed-off-by: David Frey <dpfrey@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Tested-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: tsl2772: add support for regulator framework
Brian Masney [Fri, 3 Aug 2018 00:18:56 +0000 (20:18 -0400)]
iio: tsl2772: add support for regulator framework

This patch adds support for the regulator framework to the tsl2772
driver. Driver was tested using a LG Nexus 5 (hammerhead) phone with
the two regulators and on a Raspberry Pi 2 without any regulators
controlling the power to the sensor.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: tsl2772: add support for avago,apds9930
Brian Masney [Fri, 3 Aug 2018 00:18:58 +0000 (20:18 -0400)]
iio: tsl2772: add support for avago,apds9930

The Avago APDS9930 has the same register set as the TAOS/AMS TSL2772 so
this patch adds the correct bindings and the appropriate LUX table
values derived from the values in the datasheet. Driver was tested on a
LG Nexus 5 (hammerhead) phone.

avago,apds9930 datasheet:
https://www.mouser.com/datasheet/2/678/avago_AV02-3190EN_DS_APDS-9930_2014-03-25[1]-1217273.pdf

tsl2772 datasheet:
https://ams.com/eng/content/download/291503/1066377/file/TSL2772_DS000181_2-00.pdf

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: tsl2772: add binding for avago,apds9930
Brian Masney [Fri, 3 Aug 2018 00:18:59 +0000 (20:18 -0400)]
dt-bindings: iio: tsl2772: add binding for avago,apds9930

This patch adds avago,apds9930 to the tsl2772 bindings.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: tsl2772: add support for reading proximity led settings from device tree
Brian Masney [Fri, 3 Aug 2018 00:18:54 +0000 (20:18 -0400)]
iio: tsl2772: add support for reading proximity led settings from device tree

This patch adds support for optionally reading the proximity led diode
and current settings from device tree. This was tested using a LG
Nexus 5 (hammerhead) which requires a different diode than the driver
default for the IR LED.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agodt-bindings: iio: tsl2772: add new bindings
Brian Masney [Fri, 3 Aug 2018 00:18:55 +0000 (20:18 -0400)]
dt-bindings: iio: tsl2772: add new bindings

This patch adds the new properties amstaos,proximity-diodes and
led-max-microamp to the tsl2772 driver. This patch also removes the
driver from the trivial-devices.txt.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: imu: mpu6050: add support for regulator framework
Brian Masney [Fri, 3 Aug 2018 00:18:52 +0000 (20:18 -0400)]
iio: imu: mpu6050: add support for regulator framework

This patch adds support for the regulator framework to the mpu6050
driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: Update QCOM ADC license to SPDX format
Siddartha Mohanadoss [Fri, 3 Aug 2018 01:44:06 +0000 (18:44 -0700)]
iio: adc: Update QCOM ADC license to SPDX format

Update QCOM ADC header file to SPDX format.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: adc: Add QCOM SPMI PMIC5 ADC driver
Siddartha Mohanadoss [Fri, 3 Aug 2018 01:43:53 +0000 (18:43 -0700)]
iio: adc: Add QCOM SPMI PMIC5 ADC driver

This patch adds support for QCOM SPMI PMIC5 family
of ADC driver that supports hardware based offset and
gain compensation. The ADC peripheral can measure both
voltage and current channels whose input signal is
connected to the PMIC ADC AMUX.

The register set and configuration has been refreshed
compared to the prior QCOM PMIC ADC family. Register
ADC5 as part of the IIO framework.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoregmap: Add regmap_noinc_read API
Crestez Dan Leonard [Tue, 7 Aug 2018 14:52:17 +0000 (17:52 +0300)]
regmap: Add regmap_noinc_read API

The regmap API usually assumes that bulk read operations will read a
range of registers but some I2C/SPI devices have certain registers for
which a such a read operation will return data from an internal FIFO
instead. Add an explicit API to support bulk read without range semantics.

Some linux drivers use regmap_bulk_read or regmap_raw_read for such
registers, for example mpu6050 or bmi150 from IIO. This only happens to
work because when caching is disabled a single regmap read op will map
to a single bus read op (as desired). This breaks if caching is enabled and
reg+1 happens to be a cacheable register.

Without regmap support refactoring a driver to enable regmap caching
requires separate I2C and SPI paths. This is exactly what regmap is
supposed to help avoid.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
5 years agodt-bindings: iio: adc: Add DT binding document for PMIC5 ADC
Siddartha Mohanadoss [Fri, 3 Aug 2018 01:43:38 +0000 (18:43 -0700)]
dt-bindings: iio: adc: Add DT binding document for PMIC5 ADC

PMIC5 ADC has support for clients to measure voltage and current
on inputs connected to the PMIC. Clients include reading voltage
phone power and on board system thermistors for thermal management.
ADC5 on certain PMIC has support to read battery current.

This change adds documentation.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agoiio: chemical: fix spelling mistake "failted" -> "failed"
Colin Ian King [Fri, 3 Aug 2018 11:55:51 +0000 (12:55 +0100)]
iio: chemical: fix spelling mistake "failted" -> "failed"

fix spelling mistake in dev_err error message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
5 years agostaging: erofs: disable compiling temporarile
Chao Yu [Thu, 2 Aug 2018 09:39:17 +0000 (17:39 +0800)]
staging: erofs: disable compiling temporarile

As Stephen Rothwell reported:

"After merging the staging tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/staging/erofs/super.c: In function 'erofs_read_super':
drivers/staging/erofs/super.c:343:17: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
  sb->s_flags |= MS_RDONLY | MS_NOATIME;
                 ^~~~~~~~~
                 IS_RDONLY
drivers/staging/erofs/super.c:343:17: note: each undeclared identifier is reported only once for each function it appears in
drivers/staging/erofs/super.c:343:29: error: 'MS_NOATIME' undeclared (first use in this function); did you mean 'S_NOATIME'?
  sb->s_flags |= MS_RDONLY | MS_NOATIME;
                             ^~~~~~~~~~
                             S_NOATIME
drivers/staging/erofs/super.c: In function 'erofs_mount':
drivers/staging/erofs/super.c:501:10: warning: passing argument 5 of 'mount_bdev' makes integer from pointer without a cast [-Wint-conversion]
   &priv, erofs_fill_super);
          ^~~~~~~~~~~~~~~~
In file included from include/linux/buffer_head.h:12:0,
                 from drivers/staging/erofs/super.c:14:
include/linux/fs.h:2151:23: note: expected 'size_t {aka long unsigned int}' but argument is of type 'int (*)(struct super_block *, void *, int)'
 extern struct dentry *mount_bdev(struct file_system_type *fs_type,
                       ^~~~~~~~~~
drivers/staging/erofs/super.c:500:9: error: too few arguments to function 'mount_bdev'
  return mount_bdev(fs_type, flags, dev_name,
         ^~~~~~~~~~
In file included from include/linux/buffer_head.h:12:0,
                 from drivers/staging/erofs/super.c:14:
include/linux/fs.h:2151:23: note: declared here
 extern struct dentry *mount_bdev(struct file_system_type *fs_type,
                       ^~~~~~~~~~
drivers/staging/erofs/super.c: At top level:
drivers/staging/erofs/super.c:518:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .mount          = erofs_mount,
                    ^~~~~~~~~~~
drivers/staging/erofs/super.c:518:20: note: (near initialization for 'erofs_fs_type.mount')
drivers/staging/erofs/super.c: In function 'erofs_remount':
drivers/staging/erofs/super.c:630:12: error: 'MS_RDONLY' undeclared (first use in this function); did you mean 'IS_RDONLY'?
  *flags |= MS_RDONLY;
            ^~~~~~~~~
            IS_RDONLY
drivers/staging/erofs/super.c: At top level:
drivers/staging/erofs/super.c:640:16: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .remount_fs = erofs_remount,
                ^~~~~~~~~~~~~

Caused by various commits creating erofs in the staging tree interacting
with various commits redoing the mount infrastructure in the vfs tree.

I have disabed CONFIG_EROFS_FS for now:"

The reason of compiling error is:

Since -next collects and merges developing patches including common vfs
stuff from multi-trees, but those patches didn't cover erofs, such as:

('vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled")
https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=109b45090d7d3ce2797bb1ef7f70eead5bfe0ff3

("vfs: Require specification of size of mount data for internal mounts")
https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git/commit/?h=for-next&id=0a191e4505a4f255e6513b49426213da69bf0e80

Above vfs related patches has not been merged in staging tree, if we
submit those erofs patches to staging mailing list and after including
them in staging-{test,nexts} tree, it can easily cause compiling error.

We worked out some patches to adjust those vfs change, but now we just
submit them to -next tree temporarily to avoid compiling error.

For potentail conflict in between erofs and vfs changes in incoming
merge window, Stephen suggested that we can disable CONFIG_EROFS_FS
temporarily to pass merge window, and after that we can do restore by
reenabling CONFIG_EROFS_FS and applying those fixing patches. Also
Greg confirmed this solution.

So, let's disable compiling erofs for a while.

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: gasket: apex: enable power save mode by default
Todd Poynor [Thu, 2 Aug 2018 08:42:38 +0000 (01:42 -0700)]
staging: gasket: apex: enable power save mode by default

Set default value of allow_power_save parameter to enable power save
mode, which is expected to be the state usually desired.

Signed-off-by: Marty Faltesek <mfaltesek@google.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: gasket: apex: drop reset type param
Todd Poynor [Thu, 2 Aug 2018 08:42:44 +0000 (01:42 -0700)]
staging: gasket: apex: drop reset type param

Apex doesn't implement different types of resets based on the reset type
param passed through the gasket layer or from userspace via the
gasket_reset ioctl.  The reset type is dropped from the gasket framework
in a previous patch due to a lack of present need and non-conforming use
of this parameter by the framework.  Drop the parameter from the apex
driver as well.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: gasket: remove "reset type" param from framework
Todd Poynor [Thu, 2 Aug 2018 08:42:43 +0000 (01:42 -0700)]
staging: gasket: remove "reset type" param from framework

The "type of reset" parameter to the gasket device reset APIs isn't
required by the only gasket device submitted upstream, apex.

The framework documents the param as private to the device driver and a
pass-through at the gasket layer, but the gasket core calls the device
driver with a hardcoded reset type of zero, which is not documented as
having a predefined meaning.

In light of all this, remove the reset type parameter from the
framework.  Remove the reset ioctl reset type parameter, and bump the
framework version number to reflect the interface change.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Change clock comment - Style
John Whitmore [Tue, 31 Jul 2018 21:00:05 +0000 (22:00 +0100)]
staging:rtl8192u: Change clock comment - Style

A number of block comments have been changed to comply with the coding
standard. These are coding style changes which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Rename IsACValid and add parenthesis - Style
John Whitmore [Tue, 31 Jul 2018 21:00:04 +0000 (22:00 +0100)]
staging:rtl8192u: Rename IsACValid and add parenthesis - Style

The macro IsACValid is renamed to resolve the checkpatch issue with
CamelCase naming. In addition the parameter has parenthesis added to
clear the checkpatch issue with precedence issues.

These changes are coding style changes and as such should have not
impact on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Remove unused UP2AC - Style
John Whitmore [Tue, 31 Jul 2018 21:00:03 +0000 (22:00 +0100)]
staging:rtl8192u: Remove unused UP2AC - Style

The macro UP2AC is commented out of the header file so the macro and its
associated comment are removed.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Rename octet_string members - Style
John Whitmore [Tue, 31 Jul 2018 21:00:02 +0000 (22:00 +0100)]
staging:rtl8192u: Rename octet_string members - Style

Rename the structure octet_string's member variables Octet to octet and
Length to length. This change clears the checkpatch issue with CamelCase
naming of variables.

This is purely a coding style change which should have no impact on
runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: rename OCTET_STRING - Style
John Whitmore [Tue, 31 Jul 2018 21:00:01 +0000 (22:00 +0100)]
staging:rtl8192u: rename OCTET_STRING - Style

Rename the structure OCTET_STRING to octet_string. This is to comply
with the coding style of using lowercase for types. In addition the
typedef directive is removed to clear the checkpatch issue with
defining new types.

These are coding style changes which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Move QOS_TCLAS to rtl819x_TS.h - Style
John Whitmore [Tue, 31 Jul 2018 21:00:00 +0000 (22:00 +0100)]
staging:rtl8192u: Move QOS_TCLAS to rtl819x_TS.h - Style

Move the union QOS_TCLAS from the header file rtl819x_Qos.h to header
file rtl819x_TS.h, where the structure is actually used, as the member
of another structure.

This is a coding style change, which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Remove commented out code - Style
John Whitmore [Tue, 31 Jul 2018 20:59:59 +0000 (21:59 +0100)]
staging:rtl8192u: Remove commented out code - Style

A number of structures have been commented out of code. Obviously they
are not used and as a result have been removed from the code.

This is a coding style change which should have no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Rename tspec_body members - Style
John Whitmore [Tue, 31 Jul 2018 20:59:58 +0000 (21:59 +0100)]
staging:rtl8192u: Rename tspec_body members - Style

The member variables of the tspec_body have been renamed to clear the
checkpatch issue with CamelCase naming. As these member variables are
never used in the code the changes are combined into this single
patch.

These changes are coding style changes which should have no impact on
runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Rename TSInfo - Style
John Whitmore [Tue, 31 Jul 2018 20:59:57 +0000 (21:59 +0100)]
staging:rtl8192u: Rename TSInfo - Style

Rename TSInfo, the memeber variable of struct tspec_body to ts_info.
This change clears the checkpatch issue with CamelCase naming.

This is a coding style change which should not impact runtime code
execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Refactor union TSPEC_BODY - Style
John Whitmore [Tue, 31 Jul 2018 20:59:56 +0000 (21:59 +0100)]
staging:rtl8192u: Refactor union TSPEC_BODY - Style

The union TSPEC_BODY is never used as a union. The union comprises an
array of bytes and a bitfield structure, both of which are 55 bytes in
length, but the byte array is never used. As a result the union has
been truncated to the bitfield struct, which is actually used.

Additionally the typedef has been removed from the structure to clear
the checkpatch issue with defining new types. Additionally the name has
been changed to lowercase to comply with coding style.

These changes are all coding style changes which should have no impact
on runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Rename members of struct qos_tsinfo - Style
John Whitmore [Tue, 31 Jul 2018 20:59:55 +0000 (21:59 +0100)]
staging:rtl8192u: Rename members of struct qos_tsinfo - Style

The member variables of struct qos_tsinfo all cause checkpatch issues
with CamelCase naming. As the variables are used in so few places the
changes are combined into this single patch.

Additionally the member variable usReserved is never used in code so
has been removed.

These are all coding style changes which should have no impact on
runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Remove union from qos_tsinfo - Style
John Whitmore [Tue, 31 Jul 2018 20:59:54 +0000 (21:59 +0100)]
staging:rtl8192u: Remove union from qos_tsinfo - Style

The union is never used as a union but only as a bitfield struct.
One side of the union (u8 charData[3];) Only seems to be present to
ensure that the structures size is 3 bytes in length. That length, of
the structure is dictated by the largest element of the union, so the
byte array only dictates size if it's the largest element of the union.
The byte array and union add nothing.

The union has therefore been removed and the structure and access to
the structure simplified.

Additionally since one of the bitfield variables (ucAccessPolicy)
spans a byte boundary the base type of the bitfield has been changed
from u8 to u16. Compilers have probably moved on from having an issue
with this, call it OCD.

The changes are coding style in nature and should not impact runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Remove union from aci_aifsn - Style
John Whitmore [Tue, 31 Jul 2018 20:59:53 +0000 (21:59 +0100)]
staging:rtl8192u: Remove union from aci_aifsn - Style

The union aci_aifsn is not used as a union, but only as a struct.
The union seems to have been used to ensure that the size of the
structure was only a single byte. That size is set by the bitfield
structure, adding a union with an unused byte adds nothing.

The union has been removed. This is a coding style change and
should not impact runtime code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging:rtl8192u: Clean cmpk_counttxstatistic() comments - Style
John Whitmore [Tue, 31 Jul 2018 20:59:52 +0000 (21:59 +0100)]
staging:rtl8192u: Clean cmpk_counttxstatistic() comments - Style

The only useful piece of information in the header comment of this
static function was the name of the function and parameters. That
is not useful information, given that they are in the C Source of
the function declaration, a few lines below the comment. The block
comment has been removed.

This is a coding style change, there should be no impact on runtime
code execution.

Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: rename odm_RTL8188E - style
Michael Straube [Tue, 31 Jul 2018 11:34:15 +0000 (13:34 +0200)]
staging: rtl8188eu: rename odm_RTL8188E - style

Rename source and header file to avoid CamelCase.
odm_RTL8188E.c -> odm_rtl8188e.c
odm_RTL8188E.h -> odm_rtl8188e.h

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unused rtw_remove_bcn_ie()
Michael Straube [Tue, 31 Jul 2018 11:34:14 +0000 (13:34 +0200)]
staging: rtl8188eu: remove unused rtw_remove_bcn_ie()

The function rtw_remove_bcn_ie() is never used, so remove it.
Discovered by cppcheck.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unused rtw_add_bcn_ie()
Michael Straube [Tue, 31 Jul 2018 11:34:13 +0000 (13:34 +0200)]
staging: rtl8188eu: remove unused rtw_add_bcn_ie()

The function rtw_add_bcn_ie() is never used, so remove it.
Discovered by cppcheck.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: remove unnecessary parentheses - style
Michael Straube [Tue, 31 Jul 2018 11:34:12 +0000 (13:34 +0200)]
staging: rtl8188eu: remove unnecessary parentheses - style

Remove unnecessary parentheses to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: fix comparsions to NULL - style
Michael Straube [Tue, 31 Jul 2018 11:34:11 +0000 (13:34 +0200)]
staging: rtl8188eu: fix comparsions to NULL - style

Use x instead of x != NULL.
Use !x instead of x == NULL.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: fix indentation - style
Michael Straube [Tue, 31 Jul 2018 11:34:10 +0000 (13:34 +0200)]
staging: rtl8188eu: fix indentation - style

Fix indentation to clear checkpatch warnings.
WARNING: suspect code indent for conditional statements

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: use is_broadcast_ether_addr
Michael Straube [Tue, 31 Jul 2018 11:34:09 +0000 (13:34 +0200)]
staging: rtl8188eu: use is_broadcast_ether_addr

Use is_broadcast_ether_addr instead of checking each byte of the
address array for 0xff. Shortens the code and improves readability.

As required by is_broadcast_ether_addr, the address array sta_addr
is properly aligned in all uses. Thanks to Joe Perches.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: rtl8188eu: use is_multicast_ether_addr
Michael Straube [Wed, 1 Aug 2018 19:10:50 +0000 (21:10 +0200)]
staging: rtl8188eu: use is_multicast_ether_addr

Use is_multicast_ether_addr instead of custom IS_MCAST.
The variable for the result of IS_MCAST was only used in the
if conditional. So remove the extra variable and move the call
to is_multicast_ether_addr into the conditional.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: Merge header files
Ioana Radulescu [Wed, 1 Aug 2018 16:09:51 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Merge header files

File net.h contains definitions that are exclusively used by
the key generator/classification API. Merge its contents with
dpkg.h in order to reduce the number of private headers.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: Use BIT() macro
Ioana Radulescu [Wed, 1 Aug 2018 16:09:50 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Use BIT() macro

File net.h has several bitmask defines that could be implemented
more clearly using the BIT() macro.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: Remove dead code
Ioana Radulescu [Wed, 1 Aug 2018 16:09:49 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Remove dead code

File net.h contains unused defines, so remove them.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: Cleanup comments
Ioana Radulescu [Wed, 1 Aug 2018 16:09:48 +0000 (11:09 -0500)]
staging: fsl-dpaa2/eth: Cleanup comments

Comments in file net.h are too fancy for their own good,
so convert them to the regular format.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: add SPDX license identifiers
Ioana Ciornei [Tue, 31 Jul 2018 17:02:47 +0000 (12:02 -0500)]
staging: fsl-dpaa2/eth: add SPDX license identifiers

The DPAA2 Ethernet driver files use a GPL-2.0+ OR BSD-3-Clause
license. Add SPDX tags and delete the full license text,
keeping the existing licenses for each file.
Add a GPL-2.0 tag for the Makefile.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: fsl-dpaa2/eth: convert documentation to .rst format
Ioana Ciornei [Tue, 31 Jul 2018 17:02:46 +0000 (12:02 -0500)]
staging: fsl-dpaa2/eth: convert documentation to .rst format

Convert the DPAA2 Ethernet driver documentation to .rst format
and rename the file accordingly.
Also add a SPDX tag to the new rst file.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: fix endianness warnings reported by sparse
Ajay Singh [Wed, 1 Aug 2018 11:11:00 +0000 (16:41 +0530)]
staging: wilc1000: fix endianness warnings reported by sparse

This patch fixes the sparse warnings by making use of le32_to_cpus() &
cpu_to_le32s() conversion API's.
Remove the unnecessary byte-order conversion in
wilc_wlan_parse_response_frame() as the data is copied using individual
byte operation.

Also added the byte-order conversion for 'header' in
wilc_wfi_monitor_rx() & wilc_wfi_p2p_rx() as received in LE byte-order.

The link [1] contains the details of discussion related to this patch.

[1]. https://patchwork.kernel.org/patch/10436791/

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5 years agostaging: wilc1000: use 'u16' data type for config id parameter
Ajay Singh [Wed, 1 Aug 2018 11:10:59 +0000 (16:40 +0530)]
staging: wilc1000: use 'u16' data type for config id parameter

Cleanup patch to use the correct data type 'u16' for keeping the WID
value in 'wilc_cfg_word' & 'wilc_cfg_str' structure.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>