GitHub/LineageOS/android_kernel_motorola_exynos9610.git
7 years agoiio: adc: New driver for Cirrus Logic EP93xx ADC
Alexander Sverdlin [Mon, 24 Jul 2017 20:51:45 +0000 (22:51 +0200)]
iio: adc: New driver for Cirrus Logic EP93xx ADC

New driver adding support for ADC found on Cirrus Logic EP93xx series of SoCs.
Board specific code must take care to create plaform device with all necessary
resources.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: Convert to using %pOF instead of full_name
Rob Herring [Tue, 18 Jul 2017 21:43:08 +0000 (16:43 -0500)]
iio: Convert to using %pOF instead of full_name

Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: linux-iio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoStaging: iio: adc: ad7280a.c: Fixed Macro argument reuse
Jaya Durga [Wed, 19 Jul 2017 12:25:57 +0000 (17:55 +0530)]
Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse

CHECK: Macro argument reuse 'addr' - possible side-effects?

convert AD7280A_DEVADDR to ad7280a_devaddr static function
to fix checkpath check

v3: small style changes

Signed-off-by: Jaya Durga <rjdurga@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agodt-bindings: iio: humidity: hts221: support active-low interrupts
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:02 +0000 (19:39 +0200)]
dt-bindings: iio: humidity: hts221: support active-low interrupts

Update hts221 device binding with active-low interrupts support
(IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING).

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: support active-low interrupts
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:01 +0000 (19:39 +0200)]
iio: humidity: hts221: support active-low interrupts

Add support for active low interrupts (IRQF_TRIGGER_LOW and
IRQF_TRIGGER_FALLING). Configure the device as active high or low
according to the requested irq line.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable
Lorenzo Bianconi [Mon, 17 Jul 2017 17:39:00 +0000 (19:39 +0200)]
iio: humidity: hts221: squash hts221_power_on/off in hts221_set_enable

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: avoid useless ODR reconfiguration
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:59 +0000 (19:38 +0200)]
iio: humidity: hts221: avoid useless ODR reconfiguration

Configure sensor ODR just in hts221_write_raw() in order to avoid
to set device sample rate multiple times.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: do not overwrite reserved data during power-down
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:58 +0000 (19:38 +0200)]
iio: humidity: hts221: do not overwrite reserved data during power-down

GENMASK(6, 3) in CTRL_REG1 and GENMASK(6, 2) in CTRL_REG2 are marked
reserved. Do not changed the original value (not declared in the
datasheet) during power-down/suspend routines.

Fixes: e4a70e3e7d84 (iio: humidity: add support to hts221 rh/temp device)
Fixes: b7079eeac5da (iio: humidity: hts221: add power management support)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: move BDU configuration in probe routine
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:57 +0000 (19:38 +0200)]
iio: humidity: hts221: move BDU configuration in probe routine

Enable Block Data Update in hts221_probe() in order to avoid to reconfigure
it every time the sensor is enabled

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: humidity: hts221: refactor write_with_mask code
Lorenzo Bianconi [Mon, 17 Jul 2017 17:38:56 +0000 (19:38 +0200)]
iio: humidity: hts221: refactor write_with_mask code

Move bit-shift in hts221_write_with_mask() instead of coding
the shift depth in the configured value. That change will be necessary
to fix an issue in device power-down procedure.
Simplify hts221_avg_list table management

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: chemical: ccs811: Add support for AMS CCS811 VOC sensor
Narcisa Ana Maria Vasile [Mon, 17 Jul 2017 19:28:03 +0000 (22:28 +0300)]
iio: chemical: ccs811: Add support for AMS CCS811 VOC sensor

Add support for CCS811 VOC sensor. This patch adds support
for reading current and voltage across the sensor and TVOC
and equivalent CO2 values.

Scale and offset values have been computed according to datasheet:
    - For current: raw value is in microamps
        => 0.001 scale to convert to milliamps
    - For voltage: 1.65V = 1023, therefore 1650mV = 1023
        => 1650.0/1023 = 1.612903 scale to convert to millivolts
    - For eCO2: raw value range is from 400ppm to 8192ppm.
        => (val - 400) * (100 - 0) / (8192 - 400) + 0 =
           (val - 400) * 0.01283367 => offset: -400, scale = 0.012834
           to get a percentage value
    -For TVOC: raw value range is from 0ppb to 1187ppb.
        => (val - 0) * 100 / (1187 - 0) + 0 = val * 0.0842459 =>
            scale = 0.084246 for getting a percentage value

Cc: Daniel Baluta <daniel.baluta@gmail.com>
Cc: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: Documentation: Add missing documentation for power attribute
Stefan Brüns [Sun, 16 Jul 2017 23:34:09 +0000 (01:34 +0200)]
iio: Documentation: Add missing documentation for power attribute

Commit c43a102e67db ("iio: ina2xx: add support for TI INA2xx Power Monitors")
introduced the in_powerY_raw attribute, but omitted the corresponding
documentation.

The description is correct for the INA2xx and the MAX9611 IIO drivers.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: ad7766: Remove unneeded gpiod NULL check
Fabio Estevam [Sun, 16 Jul 2017 21:26:03 +0000 (18:26 -0300)]
iio: adc: ad7766: Remove unneeded gpiod NULL check

The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: orientation: hid-sensor-rotation: Drop unnecessary static
Julia Lawall [Sat, 15 Jul 2017 20:07:44 +0000 (22:07 +0200)]
iio: orientation: hid-sensor-rotation: Drop unnecessary static

Drop static on a local variable, when the variable is initialized before
any possible use.  Thus, the static has no benefit.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@bad exists@
position p;
identifier x;
type T;
@@
static T x@p;
...
x = <+...x...+>

@@
identifier x;
expression e;
type T;
position p != bad.p;
@@
-static
 T x@p;
 ... when != x
     when strict
?x = e;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: core: Fix mapping of iio channels to entry numbers
Gaurav Gupta [Tue, 27 Jun 2017 16:46:01 +0000 (09:46 -0700)]
iio: core: Fix mapping of iio channels to entry numbers

When adding maps to the list, they were added using list_add, which adds
them in LIFO order. When parsing using iio_channel_get_all(), these
elements are hence returned in reverse order. As a result, the iio_hwmon
mapping maps the first entry to the last channel and so on.

Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: dac: stm32: add support for stm32f4
Fabrice Gasnier [Mon, 10 Jul 2017 13:23:59 +0000 (15:23 +0200)]
iio: dac: stm32: add support for stm32f4

This adds support for STM32F4 Digital-To-Analog converter.
Add compatible configuration data to handle hfsel (not present
in stm32f4).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: dac: stm32: fix error message
Fabrice Gasnier [Mon, 10 Jul 2017 13:23:58 +0000 (15:23 +0200)]
iio: dac: stm32: fix error message

Fix error message, there's no 'st,dac-channel' property, but 'reg'
(see https://lkml.org/lkml/2017/4/3/567).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agodt-bindings: iio: stm32-dac: add support for STM32F4
Fabrice Gasnier [Mon, 10 Jul 2017 13:23:57 +0000 (15:23 +0200)]
dt-bindings: iio: stm32-dac: add support for STM32F4

Introduce new compatible to support STM32F4 DAC (Digital-To-Analog
converter) variant.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: at91: make array startup_lookup static
Colin Ian King [Mon, 10 Jul 2017 17:46:54 +0000 (18:46 +0100)]
iio: adc: at91: make array startup_lookup static

Don't populate array startup_lookup on the stack but instead make
it static.  Makes the object code smaller.

Before:
   text    data     bss     dec     hex filename
  21754    5440     128   27322    6aba drivers/iio/adc/at91_adc.o

After:
   text    data     bss     dec     hex filename
  21613    5496     128   27237    6a65 drivers/iio/adc/at91_adc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: accel: st_accel: rename H3LIS331DL_DRIVER_NAME in H3LIS331DL_ACCEL_DEV_NAME
Lorenzo Bianconi [Sat, 8 Jul 2017 11:00:18 +0000 (13:00 +0200)]
iio: accel: st_accel: rename H3LIS331DL_DRIVER_NAME in H3LIS331DL_ACCEL_DEV_NAME

In order to use the standard name convention rename H3LIS331DL_DRIVER_NAME
macro in H3LIS331DL_ACCEL_DEV_NAME

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: accel: st_accel_spi: add support to H3LIS331DL, LIS331DL, LIS3LV02DL
Lorenzo Bianconi [Sat, 8 Jul 2017 11:00:17 +0000 (13:00 +0200)]
iio: accel: st_accel_spi: add support to H3LIS331DL, LIS331DL, LIS3LV02DL

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: accel: st_accel_i2c: fix i2c_device_id table
Lorenzo Bianconi [Sat, 8 Jul 2017 11:00:16 +0000 (13:00 +0200)]
iio: accel: st_accel_i2c: fix i2c_device_id table

Add H3LIS331DL, LIS331DL and LIS3LV02DL entries in st_accel_id_table

Fixes: 1e52fefc9b0c (iio: accel: Add support for the h3lis331dl accel)
Fixes: bbf5f037fad4 (iio: st_accel: support the LIS331DL sensor)
Fixes: 3acddf74f807 (iio: st-sensors: add support for lis3lv02d accel)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio:adc:at91-sama5d2: make array startup_lookup static to reduce code size
Colin Ian King [Fri, 7 Jul 2017 16:08:35 +0000 (17:08 +0100)]
iio:adc:at91-sama5d2: make array startup_lookup static to reduce code size

Making the const array startup_lookup static rather having it on the
stack saves 69 bytes. Add in missing int specifier to clean up a
checkpatch warning.

Before:
   text    data     bss     dec     hex filename
  10297    2800     128   13225    33a9 drivers/iio/adc/at91-sama5d2_adc.o

After:
   text    data     bss     dec     hex filename
  10140    2888     128   13156    3364 drivers/iio/adc/at91-sama5d2_adc.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: accel: make array init_data static to reduce code size
Colin Ian King [Fri, 7 Jul 2017 15:55:19 +0000 (16:55 +0100)]
iio: accel: make array init_data static to reduce code size

Making the const array init_data static rather having it on the
stack saves us a couple hundreds of bytes:

Before:
   text    data     bss     dec     hex filename
   3175     848       0    4023     fb7 drivers/iio/accel/da311.o

After:
   text    data     bss     dec     hex filename
   2860     936       0    3796     ed4 drivers/iio/accel/da311.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: rockchip_saradc: add NULL check on of_match_device() return value
Gustavo A. R. Silva [Fri, 7 Jul 2017 06:51:31 +0000 (01:51 -0500)]
iio: adc: rockchip_saradc: add NULL check on of_match_device() return value

Check return value from call to of_match_device()
in order to prevent a NULL pointer dereference.

In case of NULL print error message and return -ENODEV

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: meson-saradc: add NULL check on of_match_device() return value
Gustavo A. R. Silva [Fri, 7 Jul 2017 06:46:30 +0000 (01:46 -0500)]
iio: adc: meson-saradc: add NULL check on of_match_device() return value

Check return value from call to of_match_device()
in order to prevent a NULL pointer dereference.

In case of NULL print error message and return -ENODEV

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: check return value from tsl2x7x_invoke_change()
Brian Masney [Thu, 6 Jul 2017 22:56:26 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: check return value from tsl2x7x_invoke_change()

The return value from tsl2x7x_invoke_change() was not checked in most
places in the driver. This patch adds the proper error checks. The
return values inside tsl2x7x_invoke_change() are now checked by
this patch as well.

Previously, if there was an error turning the chip back on, then the
driver would attempt to turn the chip off and incorrectly return
success. The code to power off the chip is removed by this patch
since we should fail fast.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: use usleep_range() instead of mdelay()
Brian Masney [Thu, 6 Jul 2017 22:56:24 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: use usleep_range() instead of mdelay()

This driver in some cases can busy wait for upwards of 15ms. Since the
kernel at this point is not running in atomic context, and is running in
process context, we can safely use usleep_range() instead. This patch
changes the two occurrences of mdelay() to usleep_range().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: refactor {read,write}_event_value to allow handling multiple...
Brian Masney [Thu, 6 Jul 2017 22:56:23 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: refactor {read,write}_event_value to allow handling multiple iio_event_infos

tsl2x7x_read_thresh() and tsl2x7x_write_thresh() currently assumes
that IIO_EV_INFO_VALUE is the only iio_event_info that will be
passed in.  This patch refactors these two functions so that
additional iio_event_infos can be passed in. The functions are
renamed from tsl2x7x_{read,write}_thresh() to
tsl2x7x_{read,write}_event_value(). This patch also adds the
missing return value check to tsl2x7x_invoke_change() since this
was previously missing. This patch is in preparation for moving
the in_intensity0_thresh_period and in_proximity0_thresh_period sysfs
attributes to be created by iio_event_spec.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()
Brian Masney [Thu, 6 Jul 2017 22:56:22 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: cleaned up i2c calls in tsl2x7x_als_calibrate()

The calibration function calls i2c_smbus_write_byte() and
i2c_smbus_read_byte(). These two function calls are replaced with a
single call to i2c_smbus_read_byte_data() by this patch. This patch
also removes an unnecessary call that reads the CNTRL register
a second time. One of the error paths returned -1 if the ADC was not
enabled and this patch changes that return value to -EINVAL.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: remove tsl2x7x_i2c_read()
Brian Masney [Thu, 6 Jul 2017 22:56:21 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: remove tsl2x7x_i2c_read()

tsl2x7x_i2c_read() would call i2c_smbus_write_byte() and
i2c_smbus_read_byte(). These two i2c functions can be replaced with a
single call to i2c_smbus_read_byte_data(). This patch removes the
tsl2x7x_i2c_read() function and replaces all occurrences with a call to
i2c_smbus_read_byte_data().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: remove redundant power_state sysfs attribute
Brian Masney [Thu, 6 Jul 2017 22:56:20 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: remove redundant power_state sysfs attribute

The TSL2X7X driver has a custom power_state sysfs attribute. Remove this
attribute since the runtime power management code provides a sysfs
attribute to control the power state of the device.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agostaging: iio: tsl2x7x: add of_match table for device tree support
Brian Masney [Thu, 6 Jul 2017 22:56:18 +0000 (18:56 -0400)]
staging: iio: tsl2x7x: add of_match table for device tree support

Add device tree support for the tsl2x7x IIO driver with no custom
properties. The device tree documentation is in a separate commit so
that the changes to trivial-devices.txt can go in via the device
tree subsystem.

Signed-off-by: Brian Masney <masneyb@onstation.org>
CC: Rob Herring <robh+dt@kernel.org>
CC: Mark Rutland <mark.rutland@arm.com>
CC: devicetree@vger.kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: adc: Add support for DLN2 ADC
Jack Andersen [Thu, 6 Jul 2017 22:39:33 +0000 (12:39 -1000)]
iio: adc: Add support for DLN2 ADC

This patch adds support for Diolan DLN2 ADC via IIO's ADC interface.
ADC is the fourth and final component of the DLN2 for the kernel.

Signed-off-by: Jack Andersen <jackoalan@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
7 years agoiio: pressure: zpa2326: Add newlines to logging macros
Joe Perches [Wed, 5 Jul 2017 10:25:58 +0000 (03:25 -0700)]
iio: pressure: zpa2326: Add newlines to logging macros

Add newlines to the macro definitions and use a more common style.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: Add LTC2471/LTC2473 driver
Mike Looijmans [Mon, 3 Jul 2017 06:25:57 +0000 (08:25 +0200)]
iio: Add LTC2471/LTC2473 driver

The LTC2741 and LTC2473 are single voltage ADC chips. The LTC2473
is similar to the LTC2471 but outputs a signed differential value.

Datasheet:
  http://cds.linear.com/docs/en/datasheet/24713fb.pdf

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: rpr0521 triggered buffer
Mikko Koivunen [Mon, 3 Jul 2017 12:50:13 +0000 (15:50 +0300)]
iio: light: rpr0521 triggered buffer

Set up and use triggered buffer if there is irq defined for device in
device tree. Trigger producer triggers from rpr0521 drdy interrupt line.
Trigger consumer reads rpr0521 data to scan buffer.
Depends on previous commits of _scale and _offset.

Signed-off-by: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adis16400: Change unsigned to unsigned int
Reno Farnesi [Sat, 1 Jul 2017 21:54:08 +0000 (17:54 -0400)]
iio: adis16400: Change unsigned to unsigned int

This patch fixes the following checkpatch warnings:

Prefer 'unsigned int' to bare use of 'unsigned

Signed-off-by: Reno Farnesi <nfarnesi4@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: pressure: st_pressure_spi: add OF capability to st_pressure_spi
Lorenzo Bianconi [Mon, 26 Jun 2017 22:53:46 +0000 (00:53 +0200)]
iio: pressure: st_pressure_spi: add OF capability to st_pressure_spi

Add device tree support for LPS22HB, LPS25H, LPS331AP, LPS001WP
pressure 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>
7 years agoiio: gyro: st_gyro_spi: add OF capability to st_gyro_spi
Lorenzo Bianconi [Mon, 26 Jun 2017 22:53:45 +0000 (00:53 +0200)]
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>
7 years agoiio: magnetometer: st_magn_spi: add OF capability to st_magn_spi
Lorenzo Bianconi [Mon, 26 Jun 2017 22:53:44 +0000 (00:53 +0200)]
iio: magnetometer: st_magn_spi: add OF capability to st_magn_spi

Add device tree support for LIS3MDL and LSM303AGR magnetometer 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>
7 years agoiio: accel: st_accel_spi: add OF capability to st_accel_spi
Lorenzo Bianconi [Mon, 26 Jun 2017 22:53:43 +0000 (00:53 +0200)]
iio: accel: st_accel_spi: add OF capability to st_accel_spi

Add device tree support for LIS3DH, LSM330D, LSM330DL, LSM330DLC,
LIS331DLH, LSM330, LSM303AGR, LIS2DH12, LIS3L02DQ, LNG2DM accel sensors.
Fix LIS302DL support defining of_device_id data field in st_accel_of_match
table

Fixes: 762227721fe6 (iio: accel: st_accel: handle deprecated bindings)
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>
7 years agoiio: magnetometer: Only declare ACPI table when ACPI is enable
Matthias Kaehlcke [Tue, 27 Jun 2017 00:25:33 +0000 (17:25 -0700)]
iio: magnetometer: Only declare ACPI table when ACPI is enable

Don't inflate the kernel size with data that isn't used. The conditional
declaration also fixes the following warning when building with clang:

drivers/iio/magnetometer/ak8975.c:704:36: error: variable 'ak_acpi_match'
  is not needed and will not be emitted
  [-Werror,-Wunneeded-internal-declaration]

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: sca3000: Remove trailing whitespace
Reno Farnesi [Tue, 27 Jun 2017 01:45:22 +0000 (21:45 -0400)]
iio: sca3000: Remove trailing whitespace

Removes trailing whitespace to fix checkpatch errors

Signed-off-by: Reno Farnesi <nfarnesi4@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:adc:ltc2497: Add support for board file based iio consumer mapping.
Gaurav Gupta [Tue, 27 Jun 2017 18:59:56 +0000 (11:59 -0700)]
iio:adc:ltc2497: Add support for board file based iio consumer mapping.

Add missing hooks in the LTC2497 IIO driver to allow hwmon mapping.

Signed-off-by: Gaurav Gupta <gauragup@cisco.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: stm32: make array stm32h7_adc_ckmodes_spec static
Colin Ian King [Wed, 28 Jun 2017 13:06:50 +0000 (14:06 +0100)]
iio: adc: stm32: make array stm32h7_adc_ckmodes_spec static

The array stm32h7_adc_ckmodes_spec does not need to be in global scope, so
make it static.

Cleans up sparse warning:
"symbol 'stm32h7_adc_ckmodes_spec' was not declared. Should it be static?"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: mcp3422: Checking for error on probe
Angelo Compagnucci [Wed, 28 Jun 2017 21:53:10 +0000 (23:53 +0200)]
iio: adc: mcp3422: Checking for error on probe

Some part of the configuration are not touched after the probe
and if something goes wrong on writing the initial one,
the chip will misbehave.
Adding an error checking ensures that the inital configuration will
be written correctly. Moreover ensures that a sensible configuration
will be saved in driver data and used subsequently as intended.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Reported-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: mcp3422: Changing initial channel
Angelo Compagnucci [Wed, 28 Jun 2017 21:53:09 +0000 (23:53 +0200)]
iio: adc: mcp3422: Changing initial channel

Initial channel should be the first available channel on
all configurations, so changing to channel 0 available on
all supported chips.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Reported-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: gyro: mpu3050: Allow open drain with anything
Linus Walleij [Thu, 29 Jun 2017 11:57:04 +0000 (13:57 +0200)]
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>
7 years agoiio: light: tcs3472: add link to datasheet
Akinobu Mita [Mon, 26 Jun 2017 15:44:54 +0000 (00:44 +0900)]
iio: light: tcs3472: add link to datasheet

Add a link to the TCS3472 datasheet in the AMS's website.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: mt7622: Add compatible node for mt7622.
Zhiyong Tao [Mon, 26 Jun 2017 06:11:42 +0000 (14:11 +0800)]
iio: adc: mt7622: Add compatible node for mt7622.

This commit adds mt7622 compatible node.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: mt7622: add support for suspend/resume.
Zhiyong Tao [Mon, 26 Jun 2017 06:11:41 +0000 (14:11 +0800)]
iio: adc: mt7622: add support for suspend/resume.

This patch supports auxadc suspend/resume flow.
Disable auxadc clk and power in suspend function.
Enable axuadc clk and power in resume function.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: adc: mt7622: add binding document
Zhiyong Tao [Mon, 26 Jun 2017 06:11:40 +0000 (14:11 +0800)]
dt-bindings: adc: mt7622: add binding document

The commit adds mt7622 compatible node in binding document.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: accel: add LIS3L02DQ sensor device binding
Lorenzo Bianconi [Sun, 25 Jun 2017 15:50:50 +0000 (17:50 +0200)]
dt-bindings: iio: accel: add LIS3L02DQ sensor device binding

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: imu: st_lsm6dsx: support open drain mode
Lorenzo Bianconi [Wed, 21 Jun 2017 19:21:29 +0000 (21:21 +0200)]
dt-bindings: iio: imu: st_lsm6dsx: support open drain mode

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: imu: st_lsm6dsx: support open drain mode
Lorenzo Bianconi [Wed, 21 Jun 2017 19:21:28 +0000 (21:21 +0200)]
iio: imu: st_lsm6dsx: support open drain mode

Add open drain support in order to share requested IRQ line between
st_lsm6dsx device and other peripherals

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: pressure: Add bindings for MS5637, MS5805, MS5837 and MS8607 sensors
Manivannan Sadhasivam [Tue, 13 Jun 2017 17:21:32 +0000 (22:51 +0530)]
dt-bindings: iio: pressure: Add bindings for MS5637, MS5805, MS5837 and MS8607 sensors

Add device tree bindings for Measurement-Specialties MS5637, MS5805, MS5837 and MS8607 pressure & temperature sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: pressure: ms5637: Add OF match table
Manivannan Sadhasivam [Tue, 13 Jun 2017 17:21:13 +0000 (22:51 +0530)]
iio: pressure: ms5637: Add OF match table

Add of_match_table for Measurement-Specialties MS5637, MS5805, MS5837 and MS8607 pressure & temperature sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: humidity: Add bindings for HTU21 and MS8607 sensors
Manivannan Sadhasivam [Tue, 13 Jun 2017 17:20:43 +0000 (22:50 +0530)]
dt-bindings: iio: humidity: Add bindings for HTU21 and MS8607 sensors

Add device tree bindings for Measurement-Specialties HTU21 temperature & humidity sensor and humidity part of MS8607 sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: htu21: Add OF match table
Manivannan Sadhasivam [Tue, 13 Jun 2017 17:20:05 +0000 (22:50 +0530)]
iio: humidity: htu21: Add OF match table

Add of_match_table for Measurement-Specialties htu21 temperature & humidity sensor and humidity part of MS8607 sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: update STM32 timers clock names
Fabrice Gasnier [Wed, 14 Jun 2017 15:13:15 +0000 (17:13 +0200)]
dt-bindings: iio: update STM32 timers clock names

Clock name has been updated during driver/DT binding review:
https://lkml.org/lkml/2016/12/13/718
Update DT binding doc to reflect this.

Fixes: bf2d8581b1b3 (iio: Add bindings for STM32 timer trigger driver)
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: at91-sama5d2_adc: add support for suspend/resume functionality
Eugen Hristev [Fri, 23 Jun 2017 12:54:57 +0000 (15:54 +0300)]
iio: adc: at91-sama5d2_adc: add support for suspend/resume functionality

Added support for suspend/resume functionality for the ADC IP
in sama5d2 SoC.
In order to enter Suspend to ram mode (backup + self refresh mode for
memory), in which the ADC IP is no longer powered, we need to reset the
pins to default state, for the scenario when they are also used for I2C
bus to communicate with the PMIC.
On resume, we need to reconfigure the ADC IP registers and reconfigure the
trigger registers in the case when the suspend procedure is done while
sysfs has the buffer and trigger enabled.
In the case the suspend happens exactly during a software triggered
conversion, the request will time out, because we reset and power down
the ADC.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: accel: st_accel_spi: rename of_device_id table in st_accel_of_match
Lorenzo Bianconi [Tue, 20 Jun 2017 19:52:09 +0000 (21:52 +0200)]
iio: accel: st_accel_spi: rename of_device_id table in st_accel_of_match

In order to add proper device tree support give a more general name
to of_device_id table

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: common: st_sensors: move st_sensors_of_i2c_probe() in common code
Lorenzo Bianconi [Tue, 20 Jun 2017 19:52:08 +0000 (21:52 +0200)]
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>
7 years agoiio: magnetometer: st_magn_core: enable multiread by default for LIS3MDL
Lorenzo Bianconi [Tue, 20 Jun 2017 17:42:45 +0000 (19:42 +0200)]
iio: magnetometer: st_magn_core: enable multiread by default for LIS3MDL

Enable multiread by default for LIS3MDL since using I2C interface
the subaddr Msb is used to automatically increase the slave address
during multiple data read/write. In the same way, using SPI interface,
bit 1 in register address is used to enable auto-increment of the slave
address in multiple read/write.

Fixes: 872e79add756 (iio:magn: Add STMicroelectronics magn driver)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: tcs3472: fix ATIME register write
Akinobu Mita [Mon, 12 Jun 2017 15:05:08 +0000 (00:05 +0900)]
iio: light: tcs3472: fix ATIME register write

The integration time is controlled by the ATIME register only.  However,
this register is written by i2c_smbus_write_word_data() in write_raw().

We actually don't need to write a subsequent register.  So just use
i2c_smbus_write_byte_data() instead.

Cc: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: Fix polling of INA219 conversion ready flag
Stefan Brüns [Wed, 24 May 2017 00:09:07 +0000 (02:09 +0200)]
iio: adc: Fix polling of INA219 conversion ready flag

While the INA226 has a conversion ready flag (CVRF) in the R/W Mask/Enable
register with read-to-clear semantics, the corresponding bit of the INA219
(CNVR) is part of the bus voltage register. The flag is cleared by reading
the power register.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: temperature: Add bindings for TSYS01 temperature sensor
Manivannan Sadhasivam [Tue, 13 Jun 2017 15:53:13 +0000 (21:23 +0530)]
dt-bindings: iio: temperature: Add bindings for TSYS01 temperature sensor

Add device tree bindings for Measurement Specialties TSYS01 temperature sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: temperature: tsys01: Add OF match table
Manivannan Sadhasivam [Tue, 13 Jun 2017 15:52:22 +0000 (21:22 +0530)]
iio: temperature: tsys01: Add OF match table

Add of_match_table for Measurement Specialties TSYS01 temperature sensor

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: at91-sama5d2_adc: add hw trigger and buffer support
Eugen Hristev [Thu, 15 Jun 2017 13:24:57 +0000 (16:24 +0300)]
iio: adc: at91-sama5d2_adc: add hw trigger and buffer support

Added support for the external hardware trigger on pin ADTRG,
integrated the three possible edges into the driver
and created buffer management for data retrieval

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt: iio: at91-sama5d2_adc: add hw trigger edge binding
Eugen Hristev [Thu, 15 Jun 2017 13:24:55 +0000 (16:24 +0300)]
Documentation: dt: iio: at91-sama5d2_adc: add hw trigger edge binding

Add property for the edge type of the hardware trigger pin ADTRG

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: Kconfig: Append vendor name for IMX7D_ADC
Fabio Estevam [Sat, 17 Jun 2017 21:00:16 +0000 (18:00 -0300)]
iio: adc: Kconfig: Append vendor name for IMX7D_ADC

To keep IMX7D_ADC text consistent with other iio/adc entries, add
the vendor name to the driver menu text.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: hdc100x: add match table and device id's
Michael Stecklein [Mon, 19 Jun 2017 16:01:06 +0000 (11:01 -0500)]
iio: humidity: hdc100x: add match table and device id's

Add of_match_table and point it to a list of compatible device tree
device id's.

Signed-off-by: Michael Stecklein <m-stecklein@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: hdc100x: document compatible HDC10xx devices
Michael Stecklein [Mon, 19 Jun 2017 16:01:05 +0000 (11:01 -0500)]
iio: humidity: hdc100x: document compatible HDC10xx devices

Include datasheet links, add i2c_device_id entries, and update
kconfig help for compatible HDC10xx devices: HDC1000, HDC1008,
HDC1010, HDC1050, and HDC1080.

Signed-off-by: Michael Stecklein <m-stecklein@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: humidity: add bindings for HDC100x sensors
Michael Stecklein [Mon, 19 Jun 2017 16:01:04 +0000 (11:01 -0500)]
dt-bindings: iio: humidity: add bindings for HDC100x sensors

Add the bindings for the family of HDC100x sensors.

Signed-off-by: Michael Stecklein <m-stecklein@ti.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodt-bindings: iio: gyro: add L3GD20H sensor device binding
Lorenzo Bianconi [Mon, 19 Jun 2017 20:04:31 +0000 (22:04 +0200)]
dt-bindings: iio: gyro: add L3GD20H sensor device binding

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: gyro: st_gyro: fix L3GD20H support
Lorenzo Bianconi [Mon, 19 Jun 2017 20:04:30 +0000 (22:04 +0200)]
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: 9444a300c2be (IIO: Add support for L3GD20H gyroscope)
Fixes: a0657716416f ("iio:gyro: bug on L3GD20H gyroscope support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: accel: bmc150: Add support for BOSC0200 ACPI device id
Hans de Goede [Mon, 19 Jun 2017 06:22:25 +0000 (08:22 +0200)]
iio: accel: bmc150: Add support for BOSC0200 ACPI device id

Add support for the BOSC0200 ACPI device id used on some x86 tablets.
note driver_data is not set to a specific model, driver_data is not
used anyways (instead detection is done on the chip_id reg) and the
2 tablets with a BOSC0200 ACPI device id I've have 2 different chips,
one has a BMA250E, the other a BMA222E.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: lustre: replace kmalloc with kmalloc_array
Denis Petrovic [Sun, 25 Jun 2017 12:52:48 +0000 (14:52 +0200)]
staging: lustre: replace kmalloc with kmalloc_array

This patch fixes the following checkpatch.pl warning:

WARNING: Prefer kmalloc_array over kmalloc with multiply

Signed-off-by: Denis Petrovic <denis.petrovic@edu.ece.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ion: fix code style warning from NULL comparisons
Quytelda Kahja [Tue, 27 Jun 2017 21:35:46 +0000 (14:35 -0700)]
Staging: ion: fix code style warning from NULL comparisons

This patch replaces several instances where a pointer is compared to NULL
(i.e., `ptr == NULL`) with `!ptr`, which is preferred.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: make dprc.h header private
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:35 +0000 (17:41 +0300)]
staging: fsl-mc: make dprc.h header private

dprc.h is only used in the mc bus driver so move it together with the
sources thus making it private.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move mc-cmd.h contents in the public header
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:34 +0000 (17:41 +0300)]
staging: fsl-mc: move mc-cmd.h contents in the public header

mc-cmd.h contains some low level functions used to encode and decode
commands to the MC. They are used by the drivers so move them to the
public headers and get rid of the mc-cmd.h header.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move mc-sys.h contents in the public header
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:33 +0000 (17:41 +0300)]
staging: fsl-mc: move mc-sys.h contents in the public header

mc-sys.h contains the API to send commands to the MC and is used
by drivers. Move it to the public headers and get rid of the mc-sys.h
header.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: fix a few implicit includes
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:32 +0000 (17:41 +0300)]
staging: fsl-mc: fix a few implicit includes

Few files using byte order macros but did not explicitly
included the required kernel header, so add it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: remove dpmng API files
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:31 +0000 (17:41 +0300)]
staging: fsl-mc: remove dpmng API files

dpmng.h & dpmng.c files expose an API of just one function which is only
used by the bus driver. Move that single API in the bus source as static
and remove the two files.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move rest of mc-bus.h to private header
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:30 +0000 (17:41 +0300)]
staging: fsl-mc: move rest of mc-bus.h to private header

All the mc-bus.h contents is only used privately in the bus driver so
move everything to the private header and get rid of the mc-bus.h
header file.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move couple of definitions to public header
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:29 +0000 (17:41 +0300)]
staging: fsl-mc: move couple of definitions to public header

Define dev_is_fsl_mc() and the bus type definition (fsl_mc_bus_type)
are used externally so move them to the public header.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move irq domain creation prototype to public header
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:28 +0000 (17:41 +0300)]
staging: fsl-mc: move irq domain creation prototype to public header

fsl_mc_msi_create_irq_domain() will is used from the irqchip glue code
so it needs to be in the public headers.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: turn several exported functions static
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:27 +0000 (17:41 +0300)]
staging: fsl-mc: turn several exported functions static

They are never used outside the source they are implemented in and very
likely never will, so it's safe to make them static.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: delete prototype of unimplemented function
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:26 +0000 (17:41 +0300)]
staging: fsl-mc: delete prototype of unimplemented function

The function fsl_mc_bus_exists() has a prototype but is never
implemented so delete it from the header file.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: delete duplicated function prototypes
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:25 +0000 (17:41 +0300)]
staging: fsl-mc: delete duplicated function prototypes

These functions already have their prototypes in fsl-mc-private.h
header file so delete them from mc-bus.h.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: decouple the mc-bus public headers from dprc.h
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:24 +0000 (17:41 +0300)]
staging: fsl-mc: decouple the mc-bus public headers from dprc.h

In its current form, the public headers of the mc-bus depend only on a
structure "dprc_obj_desc" defined in dprc.h. Move it to the bus public
header together with its associated defines and, in order to keep the
naming prefixes consistent rename it to "fsl_mc_obj_desc".
This will allow making dprc.h private in future patches.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: drop useless #includes
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:23 +0000 (17:41 +0300)]
staging: fsl-mc: drop useless #includes

These couple of header files are not needed in the source
so remove them.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: be consistent when checking strcmp() return
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:22 +0000 (17:41 +0300)]
staging: fsl-mc: be consistent when checking strcmp() return

Stick to one way of checking the return code of strcmp(): use '!'.
This was suggested in a review comment.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fsl-mc: move comparison before strcmp() call
Laurentiu Tudor [Tue, 27 Jun 2017 14:41:21 +0000 (17:41 +0300)]
staging: fsl-mc: move comparison before strcmp() call

Move comparison before the strcmp() in this if statement, and slightly
increase efficiency by not making the strcmp() each time the if gets
evaluated but only when the comparison is true.
This was suggested in a review comment.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: speakup: make function ser_to_dev static
Colin Ian King [Wed, 28 Jun 2017 13:13:51 +0000 (14:13 +0100)]
staging: speakup: make function ser_to_dev static

The helper function ser_to_dev does not need to be in global scope, so
make it static.

Cleans up sparse warning:
"warning: symbol 'ser_to_dev' was not declared. Should it be static?"

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Okash Khawaja <okash.khawaja@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ks7010: fix spelling mistake: "errror" -> "error"
Colin Ian King [Wed, 28 Jun 2017 16:11:29 +0000 (17:11 +0100)]
staging: ks7010: fix spelling mistake: "errror" -> "error"

Trivial fix to spelling mistake in netdev_err message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192e: fix spelling mistake: "respose" -> "response"
Colin Ian King [Tue, 27 Jun 2017 14:23:26 +0000 (15:23 +0100)]
staging: rtl8192e: fix spelling mistake: "respose" -> "response"

Trivial fix to spelling mistake in netdev_info message and split
line to clean up an checkpatch line too wide warning.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wilc1000: fix spelling mistake: "dissconect" -> "disconnect"
Colin Ian King [Tue, 27 Jun 2017 09:29:06 +0000 (10:29 +0100)]
staging: wilc1000: fix spelling mistake: "dissconect" -> "disconnect"

Trivial fix to spelling mistake in netdev_err error message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: ccree: fix block comment style
Gilad Ben-Yossef [Tue, 27 Jun 2017 07:27:26 +0000 (10:27 +0300)]
staging: ccree: fix block comment style

Align block comments according to coding style.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>