]> asedeno.scripts.mit.edu Git - linux.git/log
linux.git
7 years agoiio: Documentation: Add proximity unit
Enric Balletbo i Serra [Wed, 11 Jan 2017 15:51:38 +0000 (16:51 +0100)]
iio: Documentation: Add proximity unit

To follow iio guidelines Where possible we stick to the raw SI unit, so
specify meters for proximity.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt: iio: add st_lsm6dsx sensor device binding
Lorenzo Bianconi [Tue, 10 Jan 2017 21:55:19 +0000 (22:55 +0100)]
Documentation: dt: iio: add st_lsm6dsx sensor device binding

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: imu: add support to lsm6dsx driver
Lorenzo Bianconi [Tue, 10 Jan 2017 21:55:18 +0000 (22:55 +0100)]
iio: imu: add support to lsm6dsx driver

Add support to STM LSM6DS3-LSM6DSM 6-axis (acc + gyro) Mems sensor

http://www.st.com/resource/en/datasheet/lsm6ds3.pdf
http://www.st.com/resource/en/datasheet/lsm6dsm.pdf

- continuous mode support
- i2c support
- spi support
- sw fifo mode support
- supported devices: lsm6ds3, lsm6dsm

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: inkern: pass through raw values if no scaling
Linus Walleij [Wed, 11 Jan 2017 10:48:39 +0000 (11:48 +0100)]
iio: inkern: pass through raw values if no scaling

When a consumer calls iio_read_channel_processed() the IIO core
tries to apply scaling to the value, but if the channel only
supports reading raw values, we should return that raw value
to the cosumer instead of an error.

This is what userspace is expected to do with sensors only
providing raw values so the kernel should do the same, so as to
avoid adding scaling boilerplate to drivers for hardware that
actually return processed values from raw reads.

A sensor not providing a scale, but providing a _raw attribute
could be valid if for example the scale is the default of 1,
but an offset needs to be applied to convert to the _processed
form.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:temperature: Add support for TI TMP007 sensor
Manivannan Sadhasivam [Mon, 9 Jan 2017 02:55:26 +0000 (08:25 +0530)]
iio:temperature: Add support for TI TMP007 sensor

This patch adds support for TI TMP007 - 16 bit IR thermopile sensor with integrated Math engine.
Sensor takes care of calculating the object temperature with the help of calibrated constants stored in non-volatile memory,
thereby reducing the calculation overhead.

Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.
Jonathan Cameron [Sun, 8 Jan 2017 19:52:25 +0000 (19:52 +0000)]
iio:adc:qcom-spmi-vadc: use div64_s64 instead of direct 64 bit division.

Another one of these that we missed previously which prevents test builds
of this driver on 32 bit platforms as it gives an undefined __divdi3 warning.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:adc:qcom-spmi-vadc silence a long constant warning.
Jonathan Cameron [Fri, 30 Dec 2016 18:25:50 +0000 (18:25 +0000)]
iio:adc:qcom-spmi-vadc silence a long constant warning.

It is meant to be long and is only added to an s64.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:adc:qcom-spmi-vadc : fix undefined __divdi3
Jonathan Cameron [Fri, 30 Dec 2016 18:25:49 +0000 (18:25 +0000)]
iio:adc:qcom-spmi-vadc : fix undefined __divdi3

A simple do_div call works here as all the signed 64 bit is
actually small and unsigned at this point, and the numerator is
u32.

Introduce a temporary u64 variable to avoid type comparison warnings
on some architectures.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: hx711: Add IIO driver for AVIA HX711
Andreas Klinger [Thu, 5 Jan 2017 17:51:57 +0000 (18:51 +0100)]
iio: adc: hx711: Add IIO driver for AVIA HX711

This is the IIO driver for AVIA HX711 ADC which is mostly used in weighting
cells.

The protocol is quite simple and using GPIOs:
One GPIO is used as clock (SCK) while another GPIO is read (DOUT)

The raw value read from the chip is delivered.
To get a weight one needs to subtract the zero offset and scale it.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: hx711: Add DT binding for avia,hx711
Andreas Klinger [Thu, 5 Jan 2017 17:51:36 +0000 (18:51 +0100)]
iio: adc: hx711: Add DT binding for avia,hx711

Add DT bindings for avia,hx711
Add vendor avia to vendor list

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
Hans de Goede [Wed, 14 Dec 2016 13:55:25 +0000 (14:55 +0100)]
iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications

For some reason the axp288_adc driver was modifying the
AXP288_ADC_TS_PIN_CTRL register, changing bits 0-1 depending on
whether the GP_ADC channel or another channel was written.

These bits control when a bias current is send to the TS_PIN, the
GP_ADC has its own pin and a separate bit in another register to
control the bias current.

Not only does changing when to enable the TS_PIN bias current
(always or only when sampling) when reading the GP_ADC make no sense
at all, the code is modifying these bits is writing the entire register,
assuming that all the other bits have their default value.

So if the firmware has configured a different bias-current for either
pin, then that change gets clobbered by the write, likewise if the
firmware has set bit 2 to indicate that the battery has no thermal sensor,
this will get clobbered by the write.

This commit fixes all this, by simply removing all writes to the
AXP288_ADC_TS_PIN_CTRL register, they are not needed to read the
GP_ADC pin, and can actually be harmful.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging:iio:addac:adt7316 Fixes Alignment should match open parenthesis
Scott Matheina [Wed, 4 Jan 2017 01:50:24 +0000 (19:50 -0600)]
staging:iio:addac:adt7316 Fixes Alignment should match open parenthesis

Fixes style issue where Alignment doesn't match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: imx25-gcq: Fix module autoload
Javier Martinez Canillas [Mon, 2 Jan 2017 12:45:45 +0000 (09:45 -0300)]
iio: adc: imx25-gcq: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
$

After this patch:

$ modinfo drivers/iio/adc/fsl-imx25-gcq.ko | grep alias
alias:          of:N*T*Cfsl,imx25-gcqC*
alias:          of:N*T*Cfsl,imx25-gcq

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:buffer.h - split into buffer.h and buffer_impl.h
Jonathan Cameron [Mon, 2 Jan 2017 19:28:34 +0000 (19:28 +0000)]
iio:buffer.h - split into buffer.h and buffer_impl.h

buffer.h supplies everything needed for devices using buffers.
buffer_impl.h supplies access to the internals as needed to write
a buffer implementation.

This was really motivated by the mess that turned up in the
kernel-doc documentation pulled in by the new sphinx docs.
It made it clear that our logical separations in headers were
generally terrible.  The buffer case was easy to sort out without
greatly effecting drivers so here it is.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:dummy: Stop enabling timestamp by default.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:33 +0000 (19:28 +0000)]
iio:dummy: Stop enabling timestamp by default.

It's bad practice and only done in this fake driver + it breaks my
attempt to take struct buffer opaque. Not worth an access function
as it shouldn't be done anyway.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer: Push implementation of iio_device_attach_buffer into .c file
Jonathan Cameron [Mon, 2 Jan 2017 19:28:32 +0000 (19:28 +0000)]
iio:buffer: Push implementation of iio_device_attach_buffer into .c file

This is a precursor to the splitting of buffer.h into parts relevant
to buffer implementation vs those for devices using buffers.
struct buffer is about to become opaque as far as the header is
concerned.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer.h include pushdown into buffer implementations
Jonathan Cameron [Mon, 2 Jan 2017 19:28:31 +0000 (19:28 +0000)]
iio:buffer.h include pushdown into buffer implementations

These were only getting access to the internals of struct iio_dev via
the include of iio.h within buffer.h.  This should always have been
explicitly included by the buffer implementations themselves.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:kfifo_buf header include push down.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:30 +0000 (19:28 +0000)]
iio:kfifo_buf header include push down.

As a precursor to splitting buffer.h, lets make sure all drivers
include the relevant headers rather than relying on picking them
up from kfifo_buf.h.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer:iio_push_to_buffers_with_timestamp fix kernel-doc.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:29 +0000 (19:28 +0000)]
iio:buffer:iio_push_to_buffers_with_timestamp fix kernel-doc.

Wrong start of kernel doc comment /* -> /**

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffers: Push some docs down into the .c file.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:28 +0000 (19:28 +0000)]
iio:buffers: Push some docs down into the .c file.

Ancient legacy of me doing it wrong which it is nice to clear
up whilst we are here.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer: Stop exporting iio_scan_mask_query
Jonathan Cameron [Mon, 2 Jan 2017 19:28:27 +0000 (19:28 +0000)]
iio:buffer: Stop exporting iio_scan_mask_query

Nothing uses it outside of core code.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer: Introduced a function to assign the buffer specific attrs.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:26 +0000 (19:28 +0000)]
iio:buffer: Introduced a function to assign the buffer specific attrs.

This is a necessary step in taking the buffer implementation
opaque.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer.h Reformat structure comments to be inline.
Jonathan Cameron [Mon, 2 Jan 2017 19:28:25 +0000 (19:28 +0000)]
iio:buffer.h Reformat structure comments to be inline.

This should make it easier to see how the structure is split into
public and private parts - reflected in the generated documentation.

Deliberately use /* instead of /** for the private elements to avoid
warnings when kernel-doc script runs.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio:buffer: Stop exporting iio_update_demux
Jonathan Cameron [Mon, 2 Jan 2017 19:28:24 +0000 (19:28 +0000)]
iio:buffer: Stop exporting iio_update_demux

Nothing outside of indiustrialio-buffer.c should be using this.
Requires a large amount of juggling of functions to avoid a
forward definition.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
7 years agoiio: accel: st_accel: handle deprecated bindings
Linus Walleij [Thu, 5 Jan 2017 13:32:33 +0000 (14:32 +0100)]
iio: accel: st_accel: handle deprecated bindings

The earlier deployed LIS3LV02DL driver had already defined a few
DT bindings that need to be supported by the new more generic
driver and listed as compatible but deprecated bindings in the
documentation.

After this we can start to activate the new driver with the old
systems where applicable.

As part of this enablement: make us depend on the old drivers
not being in use so we don't get a kernel with two competing
drivers.

Cc: devicetree@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: ad7606: replace range/range_available with corresponding scale
Eva Rachel Retuya [Sat, 7 Jan 2017 11:10:23 +0000 (19:10 +0800)]
staging: iio: ad7606: replace range/range_available with corresponding scale

Eliminate the non-standard attributes in_voltage_range and
in_voltage_range_available. Implement in_voltage_scale_available in place
of these attributes and update the SCALE accordingly. The array
scale_avail is introduced to hold the available scale values.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio:trigger: Fix coding style in iio-trig-bfin-timer.c by aligning parameters with...
rishabh hardas [Sat, 7 Jan 2017 10:51:36 +0000 (16:21 +0530)]
iio:trigger: Fix coding style in iio-trig-bfin-timer.c by aligning parameters with opening bracket.

Fixes a warning flagged by checkpatch.pl

Signed-off-by: rishabh hardas <rishabheudyptula@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: Add gravity sensor support
Song Hongyan [Thu, 5 Jan 2017 10:24:04 +0000 (18:24 +0800)]
iio: Add gravity sensor support

Gravity sensor is a soft sensor, which derives value from
standard accelerometer device by filtering out the acceleration
which is not caused by gravity.

Gravity sensor provides a three dimensional vector indicating
the direction and magnitude of gravity. Typically, this sensor
is used to determine the device's relative orientation in space.
The units and the coordinate system is the same as the one used by
the acceleration sensor.
When a device is at rest, the output of the gravity sensor should
be identical to that of the accelerometer.

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

Gravity sensor and accelerometer have similar channels and
share channel usage ids. So the most of the code for accel_3d
can be reused.

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: Add channel for Gravity
Song Hongyan [Thu, 5 Jan 2017 10:24:03 +0000 (18:24 +0800)]
iio: Add channel for Gravity

Add new channel types support for gravity sensor.

Gravity sensor provides an application-level or physical collection that
identifies a device that measures exclusively the force of Earth's
gravity along any number of axes.

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

Signed-off-by: Song Hongyan <hongyan.song@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: pulsedlight-lidar-lite-v2: add lidar-lite-v3 property
Matt Ranostay [Thu, 29 Dec 2016 05:13:06 +0000 (21:13 -0800)]
iio: pulsedlight-lidar-lite-v2: add lidar-lite-v3 property

Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodevicetree: add Garmin vendor prefix
Matt Ranostay [Thu, 29 Dec 2016 05:13:05 +0000 (21:13 -0800)]
devicetree: add Garmin vendor prefix

Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: Documentation: fix spelling mistake: "deactived" -> "deactivated"
Colin Ian King [Wed, 28 Dec 2016 17:40:23 +0000 (17:40 +0000)]
iio: Documentation: fix spelling mistake: "deactived" -> "deactivated"

trivial fix to spelling mistake in iio documentation

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging:iio:adt7316: Fix braces not present on all arms of if else statement
Scott Matheina [Sun, 25 Dec 2016 19:56:42 +0000 (13:56 -0600)]
staging:iio:adt7316: Fix braces not present on all arms of if else statement

Adds braces to second arm of if else statement.

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: dummy: No semicolon at end of function definition
Peter Meerwald-Stadler [Tue, 20 Dec 2016 16:38:10 +0000 (17:38 +0100)]
iio: dummy: No semicolon at end of function definition

Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: dac: ad5593r: Add ACPI support
Michael Hennerich [Mon, 19 Dec 2016 12:10:39 +0000 (13:10 +0100)]
iio: dac: ad5593r: Add ACPI support

This patch adds the ACPI/PNP ID. The AD5592/3 driver core is already
designed around the unified device property API.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: dac: ad5592r: Add ACPI support
Michael Hennerich [Mon, 19 Dec 2016 12:10:38 +0000 (13:10 +0100)]
iio: dac: ad5592r: Add ACPI support

This patch adds the ACPI/PNP ID. The AD5592/3 driver core is already
designed around the unified device property API.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: add driver for Capella CM3605
Linus Walleij [Sun, 18 Dec 2016 21:56:05 +0000 (22:56 +0100)]
iio: light: add driver for Capella CM3605

This adds a driver for the Capella Microsystems CM3605 Ambient
Light Sensor and proximity sensor. This is a pretty simple entirely
analog device that is interfaced with the target system using
the POUT (proximity out) and AOUT (ambient light out) signals.

The POUT signal is a simple high/low signal that indicates whether
an object is in proximity, most typically used to detect a face
in front of a mobile device. The signal requires that an infrared
LED is mounted next to the device, making IR light reflect off
the object in proximity and triggering the POUT signal. We grab
a GPIO pin to handle the POUT signal as an interrupt line and
register this as an event channel for the sensor.

Since the proximity sensor requires an IR LED, we add a LED trigger
named "cm3605" so that the infrared LED can just associate with
this trigger to be sure it is always on when the proximity sensor
needs it.

The AOUT is an analog voltage between 0 and 1550 mV that indicate
the LUX value in the ambient light: this is orthogonal to the
proximity sensor functionality. Since this analog voltage needs
to be converted into a digital value, the driver grabs an IIO
channel named "aout" associated with the device.

This patch created a combined ALS and proximity sensor driver.
The former supports raw reads of the LUX value and the latter
will generate proximity events.

To integrate this properly with Linux we also add a supply
regulator for the VDD pin (driving both functions) and add device
tree bindings to define the RSET resistor that in turn configures
the luminosity range of the ALS sensor.

Since the sensor needs to be on more or less constantly, we
restrict the power management to system suspend/resume: we
disable the IR LED and disable the regulator for VDD on suspend
and take them back up on resume.

Tests:
cd /sys/bus/iio/devices/iio:device1
cat in_illuminance_raw
304
(hold hand over sensor)
cat in_illuminance_raw
17
iio_event_monitor cm3605
Found IIO device with name cm3605 with device number 1
(hold hand over sensor)
Event: time: 2444842301447, type: proximity, channel: 0,
  evtype: thresh, direction: falling
(remove hand over sensor)
Event: time: 2445583440706, type: proximity, channel: 0,
  evtype: thresh, direction: rising

Cc: Capella Microsystems <capellamicro@gmail.com>
Cc: Kevin Tsai <ktsai@capellamicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: add DT bindings for Capella CM3605
Linus Walleij [Sun, 18 Dec 2016 21:55:55 +0000 (22:55 +0100)]
iio: light: add DT bindings for Capella CM3605

This adds device tree bindings for the Capella Microsystems CM3605
ambient light sensor and short range proximity sensor.

Cc: devicetree@vger.kernel.org
Cc: Capella Microsystems <capellamicro@gmail.com>
Cc: Kevin Tsai <ktsai@capellamicro.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: hid-sensor-als: Add duplicate IIO_LIGHT channel
Kweh, Hock Leong [Thu, 15 Dec 2016 21:48:21 +0000 (13:48 -0800)]
iio: light: hid-sensor-als: Add duplicate IIO_LIGHT channel

There is one light sensor type defined in the sensor hub specification,
which has one Illuminance field. It doesn't distinguish between ambient
light sensor or color sensor. Currently it is presented as IIO_INTENSITY
channel. There are some user spaces specifically looking for IIO_LIGHT
channel.
To satisfy such user spaces this change also add a duplicate IIO_LIGHT
channel. The units of measurement of Illuminance field is Lux, so it is
still compatible to IIO ABI.

Signed-off-by: Kweh, Hock Leong <hock.leong.kweh@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: st_pressure: Export sampling frequency for lps25h and lps331ap
Marcin Niestroj [Mon, 12 Dec 2016 16:58:43 +0000 (17:58 +0100)]
iio: st_pressure: Export sampling frequency for lps25h and lps331ap

Both devices are using the same iio_chan_spec to define which settings
are exported with sysfs. Both are properly configured to set/get
sampling frequency for pressure and temperature. They also properly
export available sampling frequencies. The only missing thing is
sampling_frequency sysfs file, which allows to set/get this property
from userspace.

Add sampling frequency to iio channel info mask, so sampling_frequency
file is properly exported using sysfs.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: st_pressure: Fix data sign
Marcin Niestroj [Mon, 12 Dec 2016 16:58:42 +0000 (17:58 +0100)]
iio: st_pressure: Fix data sign

Datasheet of each device (lps331ap, lps25h, lps001wp, lps22hb) says that
the pressure and temperature data is a 2's complement.

I'm sending this the slow way, as negative pressures on these are pretty
unusual and the nature of the fixing of multiple device introduction patches
will make it hard to apply to older kernels - Jonathan.

Fixes: 217494e5b780 ("iio:pressure: Add STMicroelectronics pressures driver")
Fixes: 2f5effcbd097 ("iio: pressure-core: st: Expand and rename LPS331AP's channel descriptor")
Fixes: 7885a8ce6800 ("iio: pressure: st: Add support for new LPS001WP pressure sensor")
Fixes: e039e2f5b4da ("iio:st_pressure:initial lps22hb sensor support")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: DT: Add bmi160 imu binding
Marcin Niestroj [Thu, 8 Dec 2016 14:22:56 +0000 (15:22 +0100)]
Documentation: DT: Add bmi160 imu binding

This adds documentation for Bosch BMI160 Inertial Measurement Unit
device-tree bindings.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: bmi160: Add of device table for spi
Marcin Niestroj [Thu, 8 Dec 2016 14:22:55 +0000 (15:22 +0100)]
iio: bmi160: Add of device table for spi

From now on we can add bmi160 device to device-tree by specifying
compatible string.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: bmi160: Add of device table for i2c
Marcin Niestroj [Thu, 8 Dec 2016 14:22:54 +0000 (15:22 +0100)]
iio: bmi160: Add of device table for i2c

From now on we can add bmi160 device to device-tree by specifying
compatible string.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoStaging: iio: impedance-analyzer: ad5933: fix wrong comments
Nizam Haider [Wed, 7 Dec 2016 17:44:47 +0000 (23:14 +0530)]
Staging: iio: impedance-analyzer: ad5933: fix wrong comments

according to datasheet complete control register is of 2 bytes.
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf

Signed-off-by: Nizam Haider <nijam.h@hcl.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: spmi-vadc: Changes to support different scaling
Rama Krishna Phani A [Fri, 9 Dec 2016 15:01:50 +0000 (20:31 +0530)]
iio: adc: spmi-vadc: Changes to support different scaling

Several ADC channels are supported in PMIC which can be used to
measure voltage, temperature, current etc. Different scaling can be
applied on the obtained voltage to report in physical units. Scaling
functionality can be different per channel. Add scaling support per
channel. Every channel present in adc has an unique conversion formula
for obtained voltage. Add support to report in Raw as well as in
processed format. Scaling is applied when processed read is requested
and is not applied when a Raw read is requested.

Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: spmi-vadc: Update function for generic voltage conversion
Rama Krishna Phani A [Fri, 9 Dec 2016 15:01:49 +0000 (20:31 +0530)]
iio: adc: spmi-vadc: Update function for generic voltage conversion

Several channels are supported in ADC of PMIC which can be used to
measure voltage, temperature, current etc., Hardware provides
readings for all channels in adc code. That adc code needs to be
converted to voltage. Logic for conversion of adc code to voltage
is common for all ADC channels(voltage, temperature, current
.,etc). Implement separate function for generic conversion logic.

Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: isl29028: made alignment of #defines consistent
Brian Masney [Sun, 4 Dec 2016 02:19:29 +0000 (21:19 -0500)]
staging: iio: isl29028: made alignment of #defines consistent

The alignment of the #defines at the top of the file is not consistent.
This changes all of the defines to use consistent alignment to improve
the code readability.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: isl29028: remove chip test and defaults from isl29028_chip_init()
Brian Masney [Sun, 4 Dec 2016 02:19:27 +0000 (21:19 -0500)]
staging: iio: isl29028: remove chip test and defaults from isl29028_chip_init()

isl29028_chip_init() contains the device driver defaults and
two I2C calls that detect the presence of the chip. This patch
moves these into isl29028_probe() so that this function can
be used by the power management runtinme in a followup patch. This
patch also renames isl29028_chip_init() to
isl29028_chip_init_and_power_on().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: isl29028: remove nested if statements
Brian Masney [Sun, 4 Dec 2016 02:19:25 +0000 (21:19 -0500)]
staging: iio: isl29028: remove nested if statements

There are two callers to the function isl29028_set_als_ir_mode() and
both instances use a nested if statement to only change the chip state
if it is not in the proper mode. This patch moves this check into the
isl29028_set_als_ir_mode() function to remove the nested if
statements.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: cdc: fix improper return value
Pan Bian [Sat, 3 Dec 2016 13:44:30 +0000 (21:44 +0800)]
staging: iio: cdc: fix improper return value

At the end of function ad7150_write_event_config(), directly returns 0.
As a result, the errors will be ignored by the callers. It may be better
to return variable "ret".

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: light: fix improper return value
Pan Bian [Sat, 3 Dec 2016 09:24:17 +0000 (17:24 +0800)]
iio: light: fix improper return value

In function cm3232_reg_init(), it returns 0 even if the last call to
i2c_smbus_write_byte_data() returns a negative value (indicates error).
As a result, the return value may be inconsistent with the execution
status, and the caller of cm3232_reg_init() will not be able to detect
the error. This patch fixes the bug.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188641

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: replace symbolic permission
Amit Kumar Kushwaha [Wed, 30 Nov 2016 15:24:10 +0000 (15:24 +0000)]
staging: iio: replace symbolic permission

This patch fixes the following checkpatch.pl warning in ad7150.c
WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred
Occured during build.

Signed-off-by: Amit Kushwaha <kushwaha.a@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: accel: hid-sensor-accel-3d: Add timestamp
Srinivas Pandruvada [Mon, 28 Nov 2016 22:41:16 +0000 (14:41 -0800)]
iio: accel: hid-sensor-accel-3d: Add timestamp

Added timestamp channel. With this change, each sample has a timestamp.
This timestamp can be from the sensor hub when present or local kernel
timestamp. HID sensors can send timestamp with input data using usage id
HID_USAGE_SENSOR_TIME_TIMESTAMP. This timestamp value is converted to
nano seconds before pushing this sample to the iio core.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: New driver for TI ADS7950 chips
David Lechner [Mon, 28 Nov 2016 16:58:15 +0000 (10:58 -0600)]
iio: adc: New driver for TI ADS7950 chips

This adds a new driver for the TI ADS7950 family of ADC chips. These
communicate using SPI and come in 8/10/12-bit and 4/8/12/16 channel
varieties.

Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoIIO: Change msleep to usleep_range for small msecs
Aniroop Mathur [Sat, 26 Nov 2016 03:47:26 +0000 (09:17 +0530)]
IIO: Change msleep to usleep_range for small msecs

msleep(1~20) may not do what the caller intends, and will often sleep longer.
(~20 ms actual sleep for any value given in the 1~20ms range)
This is not the desired behaviour for many cases like device resume time,
device suspend time, device enable time, data reading time, etc.
Thus, change msleep to usleep_range for precise wakeups.

Signed-off-by: Aniroop Mathur <a.mathur@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adis16203: Fix copyright year
Reto Schneider [Sun, 11 Oct 2015 23:44:51 +0000 (01:44 +0200)]
iio: adis16203: Fix copyright year

The copyright year can not be in the future.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adis1620x: Fix mixed up device descriptions
Reto Schneider [Sun, 20 Nov 2016 21:11:24 +0000 (22:11 +0100)]
iio: adis1620x: Fix mixed up device descriptions

The module descriptions for the ADIS 16201, 16203 and 16209 drivers do not
match the actual function of the devices. Update them accordingly to fix
this.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: accel: mma8452: define unsigned return values where appropriate
Martin Kepplinger [Mon, 21 Nov 2016 19:53:54 +0000 (20:53 +0100)]
iio: accel: mma8452: define unsigned return values where appropriate

smatch warned:
sval_binop_signed: invalid divide LLONG_MIN/-1

and this fixes it. It's actually good to have, in order to avoid accidental
checking for negative return values here.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: humidity: Support acpi probe for hts211
Shrirang Bagul [Thu, 24 Nov 2016 09:07:54 +0000 (17:07 +0800)]
iio: humidity: Support acpi probe for hts211

Support driver probe by reading unique HID on systems based on ACPI instead
of DT compatible strings.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: st_pressure: Support i2c probe using acpi
Shrirang Bagul [Thu, 24 Nov 2016 05:33:45 +0000 (13:33 +0800)]
iio: st_pressure: Support i2c probe using acpi

Compatible strings are not available on ACPI based systems. This patch adds
support to use DSDT information read from platform BIOS instead for probing
st pressure sensors.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: st_accel: Support sensor i2c probe using acpi
Shrirang Bagul [Thu, 24 Nov 2016 05:33:44 +0000 (13:33 +0800)]
iio: st_accel: Support sensor i2c probe using acpi

Add support to probe st_accel sensors on i2c bus using ACPI. Compatible
strings are not avaialable on ACPI based systems.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: st_sensors: match sensors using ACPI handle
Shrirang Bagul [Thu, 24 Nov 2016 05:33:43 +0000 (13:33 +0800)]
iio: st_sensors: match sensors using ACPI handle

Add support to match st sensors using information passed from ACPI DST
tables.

Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: unisys: visorbus: Remove two passthrough postcode macros
Bryan Thompson [Thu, 1 Dec 2016 06:31:14 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove two passthrough postcode macros

Remove two passthrough macros that are only called from a single
location and make the resultant vmcall directly.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove POSTCODE_SEVERITY levels
Bryan Thompson [Thu, 1 Dec 2016 06:31:13 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove POSTCODE_SEVERITY levels

Use the already defined DIAG_SEVERITY values directly instead of special
postcode macro names.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Fix spelling error (FAIULRE to FAILURE)
Bryan Thompson [Thu, 1 Dec 2016 06:31:12 +0000 (01:31 -0500)]
staging: unisys: visorbus: Fix spelling error (FAIULRE to FAILURE)

There were two instances of FAILURE being misspelled in the s-Par
firmware postcode event enum that are fixed.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove unused values from guestlinuxdebug
Bryan Thompson [Thu, 1 Dec 2016 06:31:11 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove unused values from guestlinuxdebug

Remove guestlinuxdebug enum values that are no longer being used and
renumber remaining values accordingly.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Update visorchipset postcode values
Bryan Thompson [Thu, 1 Dec 2016 06:31:10 +0000 (01:31 -0500)]
staging: unisys: visorbus: Update visorchipset postcode values

The visorchipset.c functionality was moved into the visorbus driver
previously. This patch updates the s-Par firmware postcode values to
reflect this status.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove POSTCODE_LINUX_4 macro
Bryan Thompson [Thu, 1 Dec 2016 06:31:09 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove POSTCODE_LINUX_4 macro

Call POSTCODE_LINUX directly instead of passing through POSTCODE_LINUX_4.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove POSTCODE_LINUX_3 macro
Bryan Thompson [Thu, 1 Dec 2016 06:31:08 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove POSTCODE_LINUX_3 macro

Call POSTCODE_LINUX directly instead of passing through POSTCODE_LINUX_3.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Remove POSTCODE_LINUX_2 macro
Bryan Thompson [Thu, 1 Dec 2016 06:31:07 +0000 (01:31 -0500)]
staging: unisys: visorbus: Remove POSTCODE_LINUX_2 macro

Call POSTCODE_LINUX directly instead of passing through POSTCODE_LINUX_2.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Use CURRENT_FILE_PC in base postcode macro
Bryan Thompson [Thu, 1 Dec 2016 06:31:06 +0000 (01:31 -0500)]
staging: unisys: visorbus: Use CURRENT_FILE_PC in base postcode macro

Use CURRENT_FILE_PC directly in the POSTCODE_LINUX macro instead of
relying on passthrough macros to provide it.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: Replace two base postcode macros with one
Bryan Thompson [Thu, 1 Dec 2016 06:31:05 +0000 (01:31 -0500)]
staging: unisys: visorbus: Replace two base postcode macros with one

Leverage the 3 existing s-Par postcode macros to do a bit more work
and provide only 1 base postcode macro.

Signed-off-by: Bryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: vbuschannel.h remove unused pound defines
Erik Arfvidson [Thu, 1 Dec 2016 06:31:04 +0000 (01:31 -0500)]
staging: unisys: visorbus: vbuschannel.h remove unused pound defines

This patch removes all the unused pound defines currently in
vbuschannel.h.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visorbus: vmcallinterface.h remove unused pound defines
Erik Arfvidson [Thu, 1 Dec 2016 06:31:03 +0000 (01:31 -0500)]
staging: unisys: visorbus: vmcallinterface.h remove unused pound defines

This patch removes all the unused pound defines currently in
vmcallinterface.h.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: dgnc: remove sysfs files
Greg Kroah-Hartman [Wed, 30 Nov 2016 13:46:50 +0000 (14:46 +0100)]
staging: dgnc: remove sysfs files

The dgnc driver has no business creating "custom" sysfs files just for a
single tty driver.  Combined with the odd way they are created, it's
just a mess, so remove them entirely as I am tired of tripping over them
when doing driver core changes.

Cc: Lidza Louina <lidza.louina@gmail.com>
Cc: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: sm750fb: fix tabstop style warning
Andrea Ghittino [Tue, 29 Nov 2016 21:57:21 +0000 (22:57 +0100)]
staging: sm750fb: fix tabstop style warning

Fixes sm750fb tabstop style warning
found by checkpatch.pl tool

Signed-off-by: Andrea Ghittino <aghittino@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: libcfs: repair improper unlikely test
James Simmons [Wed, 30 Nov 2016 01:33:33 +0000 (20:33 -0500)]
staging: lustre: libcfs: repair improper unlikely test

The scripts to replace NULL test got confused with the
macro parenthesis so the unlikely test in libcfs_private.h
ended up incorrect. This fixes this error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: fix spelling mistake of "outstanding"
Colin Ian King [Tue, 29 Nov 2016 19:06:58 +0000 (19:06 +0000)]
staging: unisys: fix spelling mistake of "outstanding"

Trivial fix to spelling mistake "oustanding" to "outstanding".

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gdm724x: Remove one blank line in sequence
Dawid Kurek [Sat, 26 Nov 2016 10:51:00 +0000 (11:51 +0100)]
staging: gdm724x: Remove one blank line in sequence

Remove one blank line in sequence of two empty lines.

Signed-off-by: Dawid Kurek <dawikur@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: gdm724x: Align parameters to parenthesis
Dawid Kurek [Sat, 26 Nov 2016 10:43:25 +0000 (11:43 +0100)]
staging: gdm724x: Align parameters to parenthesis

Align parameters to open parenthesis.

Signed-off-by: Dawid Kurek <dawikur@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: sm750fb: fix a type issue in sm750_set_chip_type()
Dan Carpenter [Sat, 26 Nov 2016 10:20:58 +0000 (13:20 +0300)]
staging: sm750fb: fix a type issue in sm750_set_chip_type()

"revId" needs to be unsigned because we use it to test:

if (revId == SM750LE_REVISION_ID) {

and SM750LE_REVISION_ID is ((unsigned char )0xfe).

Fixes: 81dee67e215b ("staging: sm750fb: add sm750 to staging")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: sm750fb: update license
Sudip Mukherjee [Sat, 26 Nov 2016 09:07:42 +0000 (09:07 +0000)]
staging: sm750fb: update license

The driver was actually released with BSD license. It also gained GPL
when it was submitted to be included in the kernel.

Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: gzhou1 <guojian.zhou@windriver.com>
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: slicoss: remove UPDATE_STATS_GB macro and inline code
Sergio Paracuellos [Thu, 24 Nov 2016 20:30:19 +0000 (21:30 +0100)]
staging: slicoss: remove UPDATE_STATS_GB macro and inline code

This patch removes UPDATE_STATS_GB macro in slic.h header file
and just inline code. This improve readability.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: slicoss: remove not used UPDATE_STATS macro
Sergio Paracuellos [Thu, 24 Nov 2016 20:30:18 +0000 (21:30 +0100)]
staging: slicoss: remove not used UPDATE_STATS macro

This patch remove UPDATE_STATS macro from
header slic.h which is not being used.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: ks7010: Fixed {} brace warnings for single statement blocks.
Yamanappagouda Patil [Thu, 24 Nov 2016 09:19:16 +0000 (14:49 +0530)]
Staging: ks7010: Fixed {} brace warnings for single statement blocks.

Fixed checkpatch.pl warnings related to {} brace warnings for single
statement blocks.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: Eliminate usage of symbolic permissions
Jason Litzinger [Fri, 25 Nov 2016 22:31:09 +0000 (15:31 -0700)]
staging: most: Eliminate usage of symbolic permissions

Fix checkpatch warnings regarding the use of symbolic permissions.

Where the MOST_CHANNEL_ATTR macro is used, convert to octal
permissions over symbolic.

Where _ATTR is used directly, replace with _ATTR_RW/_ATTR_WO and
update the show/store function names appropriately.

Signed-off-by: Jason Litzinger <jlitzingerdev@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obd: reserve connection flag OBD_CONNECT_FLAGS2
Fan Yong [Wed, 23 Nov 2016 23:01:20 +0000 (18:01 -0500)]
staging: lustre: obd: reserve connection flag OBD_CONNECT_FLAGS2

This is a feature for the client and server to use
obd_connect_flags2 to communicate future feature flags. The
client should set this flag whenever any flags in that field
are requested, and the server should mask unsupported features
from this field (assuming it understands OBD_CONNECT_FLAGS2).
When checking if an OBD_CONNECT2_xxxx feature is supported,
the client/server needs to firstly check if OBD_CONNECT_FLAGS2
is supported, since this field is also beyond the end of the
old obd_connect_data.

Land the connection flags to upstream client earlier for reserving
the slot to avoid potential conflict with others.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7543
Reviewed-on: http://review.whamcloud.com/17647
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obd: reserve connection flag OBD_CONNECT_OBDOPACK
Fan Yong [Wed, 23 Nov 2016 23:01:19 +0000 (18:01 -0500)]
staging: lustre: obd: reserve connection flag OBD_CONNECT_OBDOPACK

The connection flag OBD_CONNECT_OBDOPACK will be used for the
following the patch: LU-4215 optimize OUT protocol
http://review.whamcloud.com/15336

Land the connection flags to upstream client earlier for reserving
the slot to avoid potential conflict with others.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7543
Reviewed-on: http://review.whamcloud.com/17646
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obd: reserve connection flag OBD_CONNECT_LOCK_AHEAD
Fan Yong [Wed, 23 Nov 2016 23:01:18 +0000 (18:01 -0500)]
staging: lustre: obd: reserve connection flag OBD_CONNECT_LOCK_AHEAD

The connection flag OBD_CONNECT_LOCK_AHEAD will be used for the
following the patch: LU-6917 LDLM lock ahead
http://review.whamcloud.com/13564

Land the connection flags to upstream client earlier for reserving
the slot to avoid potential conflict with others.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7543
Reviewed-on: http://review.whamcloud.com/17645
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: obd: reserve connection flag OBD_CONNECT_SUBTREE
Fan Yong [Wed, 23 Nov 2016 23:01:17 +0000 (18:01 -0500)]
staging: lustre: obd: reserve connection flag OBD_CONNECT_SUBTREE

The connection flag OBD_CONNECT_SUBTREE will be used for the
following the patch: LU-28 mounting of filesystem from MDS
http://review.whamcloud.com/5007

Land the connection flags to master earlier for reserving the
slot to avoid potential conflict with others.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7543
Reviewed-on: http://review.whamcloud.com/17644
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: change "int" to proper enum type
Andreas Dilger [Wed, 23 Nov 2016 22:59:51 +0000 (17:59 -0500)]
staging: lustre: ldlm: change "int" to proper enum type

Fix users of flags that were using "int" instead of named enum.
Rename some "flags" variables to distinguish between different flags.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: rename LDLM_CANCEL_* flags
Andreas Dilger [Wed, 23 Nov 2016 22:59:50 +0000 (17:59 -0500)]
staging: lustre: ldlm: rename LDLM_CANCEL_* flags

Rename LDLM_CANCEL_* flags (used with enum ldlm_lru_flags) to
LDLM_LRU_FLAGS_* to avoid confusion with enum ldlm_cancel_flags.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: remove ldlm_wire_policy_data_t typedef usage from code
Andreas Dilger [Wed, 23 Nov 2016 22:59:49 +0000 (17:59 -0500)]
staging: lustre: ldlm: remove ldlm_wire_policy_data_t typedef usage from code

Replace usage of ldlm_wire_policy_data_t with named enums
to conform to upstream coding style.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: remove ldlm_side_t typedef usage from code
Andreas Dilger [Wed, 23 Nov 2016 22:59:48 +0000 (17:59 -0500)]
staging: lustre: ldlm: remove ldlm_side_t typedef usage from code

Replace usage of ldlm_side_t with named enums
to conform to upstream coding style.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ldlm: remove ldlm_policy_data_t typedef usage from code
Andreas Dilger [Wed, 23 Nov 2016 22:59:47 +0000 (17:59 -0500)]
staging: lustre: ldlm: remove ldlm_policy_data_t typedef usage from code

Replace usage of ldlm_policy_data_t with named enums
to conform to upstream coding style.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: memory corruption in selftest
Dan Carpenter [Thu, 24 Nov 2016 11:10:39 +0000 (14:10 +0300)]
staging: lustre: lnet: memory corruption in selftest

We want sizeof(struct lstcon_node) but instead we're getting the sizeof
a pointer.

Fixes: 8d78f0f2ba76 ("staging: lustre: lnet: cleanup some of the > 80 line issues")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre/ptlrpc: small leak on allocation failure
Dan Carpenter [Thu, 24 Nov 2016 11:12:04 +0000 (14:12 +0300)]
staging: lustre/ptlrpc: small leak on allocation failure

We should free "desc" before returning NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge tag 'iio-for-4.10d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Mon, 28 Nov 2016 07:26:16 +0000 (08:26 +0100)]
Merge tag 'iio-for-4.10d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Fourth set of IIO new device support, features and cleaups for the 4.10 cycle.

Probably the final set before the merge window unless things get significantly
delayed.

New device support
* STM32 ADC core
  - new driver.  Interesting device with up to 3 ADCs with complex triggering
    options that will follow later. Note split into an 'mfd like' core that
    handles the interrupt sharing etc between the various instances present and
    a per ADC section that is instantiated as many times as needed.
  - device tree bindings.

Cleanups and minor fixes
* st_accel
  - inline per sensor data as the defines don't add any meaning and make it
    much harder to check if a given sensor has the right values.
* hid-magnetometer
  - sort out the associations of the associated attributes with the two types.

7 years agoiio: magnetometer: separate the values of attributes based on their usage type for...
Ooi, Joyce [Wed, 16 Nov 2016 09:43:09 +0000 (17:43 +0800)]
iio: magnetometer: separate the values of attributes based on their usage type for HID compass sensor

There are 2 usage types (Magnetic Flux and Heading data field) for HID
compass sensor, thus the values of offset, scale, and sensitivity should
be separated according to their respective usage type. The changes made
are as below:
1. Hysteresis: A struct hid_sensor_common rot_attributes is created in
struct magn_3d_state to contain the sensitivity for IIO_ROT.
2. Scale: scale_pre_decml and scale_post_decml are separated for IIO_MAGN
and IIO_ROT.
3. Offset: Same as scale, value_offset is separated for IIO_MAGN and
IIO_ROT.

For sensitivity, HID_USAGE_SENSOR_ORIENT_MAGN_FLUX and
HID_USAGE_SENSOR_ORIENT_MAGN_HEADING are used for sensivitity fields based
on the HID Sensor Usages specifications. Hence, these changes are added on
the sensitivity field.

Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>