platform/kernel/linux-exynos.git
7 years agostaging: bcm2835-audio: use | instead of || otherwise result is just boolean 1
Colin Ian King [Wed, 1 Feb 2017 11:57:11 +0000 (11:57 +0000)]
staging: bcm2835-audio: use | instead of || otherwise result is just boolean 1

The incorrect or operator is being used resulting in cookies being
set to 1 (true) rather than the intended hex value.  Fix this by
using | instead of ||.

Issue found with static analysis with cppcheck

Fixes: 0cec463e391e05b807a ("staging: bcm2835-audio: Simplify callback structure for write data")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: remove CLASSERT macro
Arnd Bergmann [Thu, 2 Feb 2017 11:26:51 +0000 (12:26 +0100)]
staging: lustre: remove CLASSERT macro

lustre uses a fake switch() statement as a compile-time assert, but unfortunately
each use of that causes a warning when building with clang:

drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c:2907:2: warning: no case matching constant switch condition '42'
drivers/staging/lustre/lnet/klnds/socklnd/../../../include/linux/libcfs/libcfs_private.h:294:36: note: expanded from macro 'CLASSERT'
 #define CLASSERT(cond) do {switch (42) {case (cond): case 0: break; } } while (0)

As Greg suggested, let's just kill off this macro completely instead of
fixing it. This replaces it with BUILD_BUG_ON(), which means we have
to negate all the conditions in the process.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835: mark all symbols as 'static'
Arnd Bergmann [Thu, 2 Feb 2017 11:34:11 +0000 (12:34 +0100)]
staging: bcm2835: mark all symbols as 'static'

I got a link error in allyesconfig:

drivers/staging/media/platform/bcm2835/bcm2835-camera.o: In function `vidioc_enum_framesizes':
bcm2835-camera.c:(.text.vidioc_enum_framesizes+0x0): multiple definition of `vidioc_enum_framesizes'
drivers/media/platform/vivid/vivid-vid-cap.o:vivid-vid-cap.c:(.text.vidioc_enum_framesizes+0x0): first defined here

While both drivers are equally at fault for this problem, the bcm2835 one was
just added and is easier to fix, as it is only one file, and none of its symbols
need to be globally visible. This marks the three global symbols as static.

Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: fix empty-body warning
Arnd Bergmann [Wed, 1 Feb 2017 16:22:25 +0000 (17:22 +0100)]
staging: bcm2835-audio: fix empty-body warning

gcc-7 warns about debug statements being left out here:

drivers/staging/bcm2835-audio/bcm2835-vchiq.c: In function 'bcm2835_audio_set_ctls':
drivers/staging/bcm2835-audio/bcm2835-vchiq.c:572:54: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]

It's better to use no_printk(), which has the added advantage of checking
the format strings.

Fixes: 23b028c871e1 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: remove incorrect include path
Arnd Bergmann [Wed, 1 Feb 2017 16:21:19 +0000 (17:21 +0100)]
staging: bcm2835-audio: remove incorrect include path

The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:

cc1: error: /git/arm-soc/drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]

In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.

Fixes: 23b028c871e1 ("staging: bcm2835-audio: initial staging submission")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l: remove incorrect include path
Arnd Bergmann [Wed, 1 Feb 2017 16:15:06 +0000 (17:15 +0100)]
staging: bcm2835-v4l: remove incorrect include path

The driver introduces a new instance of the missing-include-dirs warning that
is enabled at the "make W=1" level but has no other output:

cc1: error: drivers/staging/vc04_services/interface/vcos/linuxkernel: No such file or directory [-Werror=missing-include-dirs]
cc1: all warnings being treated as errors
scripts/Makefile.build:307: recipe for target 'drivers/staging/media/platform/bcm2835/bcm2835-camera.o' failed

In order to let us enable the warning by default in the future, we should
just remove the incorrect argument here.

Fixes: 97b35807cc4d ("staging: bcm2835-v4l2: Add a build system for the module.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835/mmal-vchiq: Replace call to vchi_msg_queue with vchi_queue_kernel_me...
Michael Zoran [Wed, 1 Feb 2017 14:31:54 +0000 (06:31 -0800)]
staging: bcm2835/mmal-vchiq: Replace call to vchi_msg_queue with vchi_queue_kernel_message

The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.

Change the call to vchi_msg_queue to vchi_queue_kernel_message

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: Replace call to vchi_msg_queue with vchi_queue_kernel_message
Michael Zoran [Wed, 1 Feb 2017 14:31:53 +0000 (06:31 -0800)]
staging: bcm2835-audio: Replace call to vchi_msg_queue with vchi_queue_kernel_message

The function vchi_msg_queue was made static in vc04_services
and replaced with vchi_queue_kernel_message.

Change the call to vchi_msg_queue to vchi_queue_kernel_message

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge tag 'iio-for-4.11c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Thu, 2 Feb 2017 10:26:23 +0000 (11:26 +0100)]
Merge tag 'iio-for-4.11c' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new device support, features and cleanups for IIO in the 4.11 cycle

This also involves a merge of the ib-mid-iio-pwm-4.11 branch from mfd to
bring in support for the stm32 timer triggers needed for the buffered
features in the stm32 adc driver.

New device support:
* Amligic Meson SAR ADC
  - new driver and bindings
* cros_ec barometer
  - new driver
* max5481 digital potentiometers
  - new driver for 5481, 5482, 5483 and 5484
* Renesas GyroADC - a very specific spi offload engine for ADCs
  - new driver and bindings.
* srf08 ultrasonic ranger
  - new driver, bindings and ABI docs,

New features
* Qualcomm PM8xxx ADC bindings.
  - due to a trivial build issues the driver will be following shortly.
* stm32 ADC
  - Triggered buffer mode
  - Allow use of stm32 timer triggers
  - Add trigger polarity control
  - Optional DMA support with bindings update
* stx104
  - add support for gpio names
  - support set_multiple callback
* tmp007
  - optional interrupt support

Cleanups
* ad7150
  - alignment fix.
* ad7816
  - octal rather than symbolic permissions.
* lsm6dsx
  - allow selection of data ready pin via device tree bindings.
* ssp_sensors
  - use devm_iio_device_register to handle unregister automatically.
* stx104
  - use devm functions in probe allowing removal or the remove function.
  - drop unneeded struct stx104_dev
* tmp007
  - fix the name attribute to be a meaninful description of the part.

7 years agoiio: stx104: Add GPIO set_multiple callback function support
William Breathitt Gray [Thu, 19 Jan 2017 15:06:16 +0000 (10:06 -0500)]
iio: stx104: Add GPIO set_multiple callback function support

The Apex Embedded Systems STX104 series provides a digital output
register where 4 lines may be set at a time. This patch add support for
the set_multiple callback function, thus allowing multiple digital
output lines to be set more efficiently in groups.

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>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: add device tree bindings for Qualcomm PM8xxx ADCs
Linus Walleij [Tue, 17 Jan 2017 14:25:13 +0000 (15:25 +0100)]
iio: adc: add device tree bindings for Qualcomm PM8xxx ADCs

This adds the device tree bindings for the Qualcomm PM8xxx
ADCs. This is based on the existing DT bindings for the
SPMI ADC so there are hopefully no controversial features.

Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: Ivan T. Ivanov <iivanov.xz@gmail.com>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Rama Krishna Phani A <rphani@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: stx104: Add support for GPIO names
William Breathitt Gray [Mon, 30 Jan 2017 17:16:04 +0000 (12:16 -0500)]
iio: stx104: Add support for GPIO names

This patch sets the gpio_chip names option with an array of GPIO line
names that match the manual documentation for the Apex Embedded Systems
STX104. This should make it easier for users to identify which GPIO line
corresponds to a respective GPIO pin on the device.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: vc04_services: Make vchi_msg_queue static
Michael Zoran [Mon, 30 Jan 2017 07:31:11 +0000 (23:31 -0800)]
staging: vc04_services: Make vchi_msg_queue static

The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.

Make the function static and remove it from the exported
symbols.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Add vchi_queue_user_message function
Michael Zoran [Mon, 30 Jan 2017 07:31:10 +0000 (23:31 -0800)]
staging: vc04_services: Add vchi_queue_user_message function

The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.

Add a new function which is a wrapper on top of vchi_msg_queue
that is specifically for queuing a message located in user
address space.

int
vchi_queue_user_message(VCHI_SERVICE_HANDLE_T handle,
                        void __user *data,
                        unsigned int size)

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vc04_services: Add vchi_queue_kernel_message function
Michael Zoran [Mon, 30 Jan 2017 07:31:09 +0000 (23:31 -0800)]
staging: vc04_services: Add vchi_queue_kernel_message function

The vchi_msg_queue function which is used by other drivers
to queue a message is difficult to understand and overly
generic.

Add a new function which is a wrapper on top of vchi_msg_queue
that is specifically for queuing a message located in kernel
address space.

int
vchi_queue_kernel_message(VCHI_SERVICE_HANDLE_T handle,
  void *data,
  unsigned int size)

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: Simplify callback structure for write data
Michael Zoran [Sun, 29 Jan 2017 05:39:45 +0000 (21:39 -0800)]
staging: bcm2835-audio: Simplify callback structure for write data

The device sends data to the audio devices by sending a message with
the data through VC04_SERVICES/VCHIQ.  This message contains a
callback pointer that is always filled in with the same function.
This is prone to corruption issues.

Instead fill the callback fields with a fixed cookie value to perforam
some validation on the message response and call the handler function
directly instead of through the callback pointer.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: Remove code for non device tree init
Michael Zoran [Sun, 29 Jan 2017 05:39:44 +0000 (21:39 -0800)]
staging: bcm2835-audio: Remove code for non device tree init

The bcm2835-audio driver has a legacy code path for initializing
devices without a device tree.  Delete this code path and remove
the non device tree devices.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: Add TODO list
Michael Zoran [Sun, 29 Jan 2017 14:39:09 +0000 (06:39 -0800)]
staging: bcm2835-audio: Add TODO list

Add a TODO list of possible cleanup items.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l2: Apply spelling fixes from checkpatch.
Eric Anholt [Fri, 27 Jan 2017 21:55:03 +0000 (13:55 -0800)]
staging: bcm2835-v4l2: Apply spelling fixes from checkpatch.

Generated with checkpatch.pl --fix-inplace and git add -p out of the
results.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l2: Apply many whitespace fixes from checkpatch.
Eric Anholt [Fri, 27 Jan 2017 21:55:02 +0000 (13:55 -0800)]
staging: bcm2835-v4l2: Apply many whitespace fixes from checkpatch.

Generated with checkpatch.pl --fix-inplace, some manual fixes for
cases where checkpatch fixed one out of multiple lines of mis-indented
function parameters, and then git add -p out of the results.

I skipped some fixes that should probably instead be replaced with the
BIT() macro.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l2: Add a TODO file for improvements we need.
Eric Anholt [Fri, 27 Jan 2017 21:55:01 +0000 (13:55 -0800)]
staging: bcm2835-v4l2: Add a TODO file for improvements we need.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l2: Add a build system for the module.
Eric Anholt [Fri, 27 Jan 2017 21:55:00 +0000 (13:55 -0800)]
staging: bcm2835-v4l2: Add a build system for the module.

This is derived from the downstream tree's build system, but with just
a single Kconfig option.

For now the driver only builds on 32-bit arm -- the aarch64 build
breaks due to the driver using arm-specific cache flushing functions.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-v4l2: Update the driver to the current VCHI API.
Eric Anholt [Fri, 27 Jan 2017 21:54:59 +0000 (13:54 -0800)]
staging: bcm2835-v4l2: Update the driver to the current VCHI API.

49bec49fd7f2 ("staging: vc04_services: remove vchiq_copy_from_user")
removed the flags/msg_handle arguments, which were unused, and pushed
the implementation of copying using memcpy vs copy_from_user to the
caller.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: Import the BCM2835 MMAL-based V4L2 camera driver.
Eric Anholt [Fri, 27 Jan 2017 21:54:58 +0000 (13:54 -0800)]
staging: Import the BCM2835 MMAL-based V4L2 camera driver.

- Supports raw YUV capture, preview, JPEG and H264.
- Uses videobuf2 for data transfer, using dma_buf.
- Uses 3.6.10 timestamping
- Camera power based on use
- Uses immutable input mode on video encoder

This code comes from the Raspberry Pi kernel tree (rpi-4.9.y) as of
a15ba877dab4e61ea3fc7b006e2a73828b083c52.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: unisys: visornic: Fix typo in visornic_main.c
Masanari Iida [Mon, 30 Jan 2017 03:32:31 +0000 (12:32 +0900)]
staging: unisys: visornic: Fix typo in visornic_main.c

This patch fix some spelling typos found in visornic_main.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: wlan-ng: add missing byte order conversion
Igor Pylypiv [Tue, 31 Jan 2017 05:39:54 +0000 (21:39 -0800)]
staging: wlan-ng: add missing byte order conversion

Conversion macros le16_to_cpu was removed and that caused new sparse warning

sparse output:
drivers/staging/wlan-ng/p80211netdev.c:241:44: warning: incorrect type in argument 2 (different base types)
drivers/staging/wlan-ng/p80211netdev.c:241:44:    expected unsigned short [unsigned] [usertype] fc
drivers/staging/wlan-ng/p80211netdev.c:241:44:    got restricted __le16 [usertype] fc

Fixes: 7ad82572348c ("staging:wlan-ng:Fix sparse warning")
Signed-off-by: Igor Pylypiv <igor.pylypiv@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: speakup: speakup_bns: fix comment
Vitali Liaukovich [Sat, 28 Jan 2017 11:02:40 +0000 (13:02 +0200)]
Staging: speakup: speakup_bns: fix comment

Fixed comment formatting issue.

Signed-off-by: Vitali Liaukovich <vitali.liaukovich@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: speakup - syle fix permissions to octal
Derek Robson [Sat, 28 Jan 2017 06:35:01 +0000 (19:35 +1300)]
Staging: speakup - syle fix permissions to octal

A style fix across whole driver.
changed permissions to octal style, found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: tmp007: Fix `name` attribute ABI
Lars-Peter Clausen [Mon, 30 Jan 2017 10:18:25 +0000 (11:18 +0100)]
iio: tmp007: Fix `name` attribute ABI

The IIO ABI specifies the name field of the IIO device as:

Description of the physical chip / device for device X.
Typically a part number.

The tmp007 driver currently uses the name of the parent device instead.
Change this to the part name to be in accordance with the ABI.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: stx104: Remove unneeded struct stx104_dev code
William Breathitt Gray [Mon, 30 Jan 2017 13:58:50 +0000 (08:58 -0500)]
iio: stx104: Remove unneeded struct stx104_dev code

The stx104_dev structure was used to hold private data for use in the
stx104_remove function. Now that the stx104_remove function is gone, the
stx104_dev structure and relevant code is no longer needed. This patch
removes the unnecessary code.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: stm32: add optional dma support
Fabrice Gasnier [Thu, 26 Jan 2017 14:28:33 +0000 (15:28 +0100)]
iio: adc: stm32: add optional dma support

Add DMA optional support to STM32 ADC, as there is a limited number DMA
channels (request lines) that can be assigned to ADC. This way, driver
may fall back using interrupts when all DMA channels are in use for
other IPs.
Use dma cyclic mode with two periods. Allow to tune period length by
using watermark. Coherent memory is used for dma (max buffer size is
fixed to PAGE_SIZE).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt: iio: stm32-adc: optional dma support
Fabrice Gasnier [Thu, 26 Jan 2017 14:28:32 +0000 (15:28 +0100)]
Documentation: dt: iio: stm32-adc: optional dma support

STM32 ADC can use dma. Add dt documentation for optional dma support.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: stm32: add trigger polarity extended attribute
Fabrice Gasnier [Thu, 26 Jan 2017 14:28:31 +0000 (15:28 +0100)]
iio: adc: stm32: add trigger polarity extended attribute

Define extended attribute so that user may choose rising, falling or both
edges for external trigger sources.
Default to rising edge in case it isn't set.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: stm32: Enable use of stm32 timer triggers
Fabrice Gasnier [Thu, 26 Jan 2017 14:28:30 +0000 (15:28 +0100)]
iio: adc: stm32: Enable use of stm32 timer triggers

STM32 ADC has external timer trigger sources. Use stm32 timer triggers
API (e.g. is_stm32_timer_trigger()) with local ADC lookup table to
validate a trigger can be used.
This also provides correct trigger selection value (e.g. extsel).

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: stm32: add support for triggered buffer mode
Fabrice Gasnier [Thu, 26 Jan 2017 14:28:29 +0000 (15:28 +0100)]
iio: adc: stm32: add support for triggered buffer mode

STM32 ADC conversions can be launched using hardware triggers.
It can be used to start conversion sequences (group of channels).
Selected channels are select via sequence registers.
Trigger source is selected via 'extsel' (external trigger mux).
Trigger polarity is set to rising edge by default.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoMerge tag 'ib-mfd-iio-pwm-4.11' into test
Jonathan Cameron [Sat, 28 Jan 2017 18:21:49 +0000 (18:21 +0000)]
Merge tag 'ib-mfd-iio-pwm-4.11' into test

Immutable branch between MFD, IIO and PWM due for the v4.11 merge window

Pulled into IIO to allow follow up series of triggered capture for the
STM32 ADCs.

7 years agoiio: distance: srf08: add driver ABI documentation
Andreas Klinger [Wed, 25 Jan 2017 19:07:47 +0000 (20:07 +0100)]
iio: distance: srf08: add driver ABI documentation

Add sysfs-bus-iio-distance-srf08 for individual attributes of the driver,
especially:
 - sensitivity which the device documentation calls gain for amplifying the
   signal
 - max_range for limiting the maximum distance for expected echos and
   therefore limiting the time waiting for telegrams

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: distance: srf08: add IIO driver for us ranger
Andreas Klinger [Wed, 25 Jan 2017 19:07:19 +0000 (20:07 +0100)]
iio: distance: srf08: add IIO driver for us ranger

This is the IIO driver for devantech srf08 ultrasonic ranger which can be
used to measure the distances to an object.

The sensor supports I2C with some registers.

Supported Features include:
 - read the distance in ranging mode in centimeters
 - output of the driver is directly the read value
 - together with the scale the driver delivers the distance in meters
 - only the first echo of the nearest object is delivered
 - set sensitivity as analog value in the range of 0-31  means setting
   gain register on device
 - set range registers; userspace enters max. range in millimeters in
   43 mm steps

Features not supported by this driver:
 - ranging mode in inches or in microseconds
 - ANN mode
 - change I2C address through this driver
 - light sensor

The driver was added in the directory "proximity" of the iio subsystem and
the menu in den config is now called "Proximity and distance sensors"

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: distance: srf08: add trivial DT binding
Andreas Klinger [Wed, 25 Jan 2017 19:06:48 +0000 (20:06 +0100)]
iio: distance: srf08: add trivial DT binding

 - Add DT binding for devantech,srf08
 - Add vendor devantech 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: cros_ec: Add cros_ec barometer driver
Gwendal Grignou [Tue, 24 Jan 2017 13:41:41 +0000 (14:41 +0100)]
iio: cros_ec: Add cros_ec barometer driver

Handle the barometer sensor presented by the ChromeOS EC Sensor hub.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo Serra <enric.balletbo@collabora.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: stx104: Utilize devm_ functions in driver probe callback
William Breathitt Gray [Tue, 24 Jan 2017 20:26:17 +0000 (15:26 -0500)]
iio: stx104: Utilize devm_ functions in driver probe callback

The devm_ resource manager functions allow memory to be automatically
released when a device is unbound. This patch takes advantage of the
resource manager functions and replaces the gpiochip_add_data call and
iio_device_register call with the devm_gpiochip_add_data call and
devm_iio_device_register call respectively. In addition, the
stx104_remove function has been removed as no longer necessary due to
the use of the relevant devm_ resource manager functions.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt: iio: imu: st_lsm6dsx: add st,drdy-int-pin property
Lorenzo Bianconi [Sun, 22 Jan 2017 18:32:25 +0000 (19:32 +0100)]
Documentation: dt: iio: imu: st_lsm6dsx: add st,drdy-int-pin property

Add st,drdy-int-pin property to select interrupt pin of the package

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: add possibility to select drdy pin
Lorenzo Bianconi [Sun, 22 Jan 2017 18:32:24 +0000 (19:32 +0100)]
iio: imu: st_lsm6dsx: add possibility to select drdy pin

Add capability to route data ready signal on pin 1 or pin 2 of the package

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs
Martin Blumenstingl [Sun, 22 Jan 2017 18:17:13 +0000 (19:17 +0100)]
iio: adc: add a driver for the SAR ADC found in Amlogic Meson SoCs

This adds support for the SAR (Successive Approximation Register) ADC
on the Amlogic Meson SoCs.

The code is based on the public S805 (Meson8b) and S905 (GXBB)
datasheets (see [0] and [1]), as well as by reading (various versions
of) the vendor driver and by inspecting the registers on the vendor
kernels of my testing-hardware.

Currently the GXBB, GXL and GXM SoCs are supported. GXBB hardware has
10-bit ADC resolution, while GXL and GXM have 12-bit ADC resolution.
The code was written to support older SoCs (Meson8 and Meson8b) as well,
but due to lack of actual testing-hardware no of_device_id was added for
these.

Two "features" from the vendor driver are currently missing:
- the vendor driver uses channel #7 for calibration (this improves the
  accuracy of the results - in my tests the results were less than 3%
  off without calibration compared to the vendor driver). Adding support
  for this should be easy, but is not required for most applications.
- channel #6 is connected to the SoCs internal temperature sensor.
  Adding support for this is probably not so easy since (based on the
  u-boot sources) most SoC versions are using different registers and
  algorithms for the conversion from "ADC value" to temperature.

Supported by the hardware but currently not supported by the driver:
- reading multiple channels at the same time (the hardware has a FIFO
  buffer which stores multiple results)
- continuous sampling (this would require a way to enable this
  individually because otherwise the ADC would be drawing power
  constantly)
- interrupt support (similar to the vendor driver this new driver is
  polling the results. It is unclear if the IRQ-mode is supported on
  older (Meson6 or Meson8) hardware as well or if there are any errata)

[0]
http://dn.odroid.com/S805/Datasheet/S805_Datasheet%20V0.8%2020150126.pdf
[1] http://dn.odroid.com/S905/DataSheet/S905_Public_Datasheet_V1.1.4.pdf

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt-bindings: add the Amlogic Meson SAR ADC documentation
Martin Blumenstingl [Sun, 22 Jan 2017 18:17:12 +0000 (19:17 +0100)]
Documentation: dt-bindings: add the Amlogic Meson SAR ADC documentation

This adds the devicetree binding documentation for the SAR ADC found in
Amlogic Meson SoCs.
Currently only the GXBB, GXL and GXM SoCs are supported.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoStaging: iio: adc: ad7816: fix symbolic permissions coding style issue
Julián de Gortari [Mon, 23 Jan 2017 18:08:29 +0000 (12:08 -0600)]
Staging: iio: adc: ad7816: fix symbolic permissions coding style issue

Octal permissions should be used instead of symbolic ones for easier
reading.

Signed-off-by: Julián de Gortari <kiototeko@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agodrivers:staging:iio:cdc: Style fix.
Anthony Brandon [Mon, 23 Jan 2017 13:14:12 +0000 (14:14 +0100)]
drivers:staging:iio:cdc: Style fix.

Align parameters to parentheses.

Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: common: ssp_sensors: gyro: use devm_iio_device_register()
Wei Yongjun [Sun, 22 Jan 2017 17:15:06 +0000 (17:15 +0000)]
iio: common: ssp_sensors: gyro: use devm_iio_device_register()

Use devm_iio_device_register() for IIO subsystem device
registration and delete the remove function since there
is no need after this change.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: common: ssp_sensors: accel: use devm_iio_device_register()
Wei Yongjun [Sun, 22 Jan 2017 16:36:12 +0000 (16:36 +0000)]
iio: common: ssp_sensors: accel: use devm_iio_device_register()

Use devm_iio_device_register() for IIO subsystem device
registration and delete the remove function since there
is no need after this change.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: max5481: Add support for Maxim digital potentiometers
Matt Weber [Thu, 26 Jan 2017 20:26:15 +0000 (21:26 +0100)]
iio: max5481: Add support for Maxim digital potentiometers

Add implementation for Maxim Integrated 5481, 5482, 5483,
and 5484 digital potentiometer devices.

Datasheet:
http://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf

Signed-off-by: Maury Anderson <maury.anderson@rockwellcollins.com>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoDocumentation: dt-bindings: tmp007: Add optional interrupt support
Manivannan Sadhasivam [Mon, 23 Jan 2017 16:28:09 +0000 (21:58 +0530)]
Documentation: dt-bindings: tmp007: Add optional interrupt support

This patch adds optional interrupt binding support for TI TMP007 - IR thermopiler sensor

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: Add Renesas GyroADC driver
Marek Vasut [Fri, 27 Jan 2017 23:08:37 +0000 (00:08 +0100)]
iio: adc: Add Renesas GyroADC driver

Add IIO driver for the Renesas RCar GyroADC block. This block is a
simple 4/8-channel ADC which samples 12/15/24 bits of data every
cycle from all channels.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: Add Renesas GyroADC bindings
Marek Vasut [Fri, 27 Jan 2017 23:08:36 +0000 (00:08 +0100)]
iio: adc: Add Renesas GyroADC bindings

Add DT bindings for the Renesas RCar GyroADC block. This block is
a simple 4/8-channel ADC which samples 12/15/24 bits of data every
cycle from all channels.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-renesas-soc@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Rob Herring <robh@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: lustre: lnet: Fix coding style errors
Maxime Rossi Bellom [Fri, 27 Jan 2017 10:58:52 +0000 (11:58 +0100)]
staging: lustre: lnet: Fix coding style errors

Replace a mix of tabs and spaces indentation by tabs only.

Errors were reported by checkpatch.pl as
WARNING: Statements should start on a tabstop
WARNING: suspect code indent for conditional statement

Signed-off-by: Maxime Rossi Bellom <mrossibellom@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8188eu: Fix coding style issues
William Blough [Fri, 27 Jan 2017 18:54:26 +0000 (13:54 -0500)]
staging: rtl8188eu: Fix coding style issues

Convert leading spaces to tabs

Signed-off-by: William Blough <devel@blough.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: xgifb: XGI_main_26: Remove multiple assignments
sayli karnik [Fri, 27 Jan 2017 19:14:36 +0000 (00:44 +0530)]
staging: xgifb: XGI_main_26: Remove multiple assignments

This patch resolves the checkpatch issue:
multiple assignments should be avoided

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: bcm2835-audio: initial staging submission
Michael Zoran [Thu, 26 Jan 2017 00:39:49 +0000 (16:39 -0800)]
staging: bcm2835-audio: initial staging submission

Initial cleanup of bcm2835-audio driver for the
bcm2535(Raspberry PI)

Driver provides HDMI audio through ALSA and is built
on top of the vc04_services driver.

Original version of the driver is available at:
http://www.github.com/raspberry/linux

Driver compiles without any build errors or warnings.

Tested on a RPI 3 running in ARM64 mode with the
vlc player and alsautils.

Signed-off-by: Michael Zoran <mzoran@crowfest.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging/rtl8192u: add endianness conversions
Colin Vidal [Thu, 26 Jan 2017 19:22:00 +0000 (20:22 +0100)]
staging/rtl8192u: add endianness conversions

Fields frag_size and playload_size of struct ieee80211_txb are encoded
as short little-endian. This patch adds conversions to / from cpu byte
order when copy / write these values in variables of architecture
independent byte order. It also avoid a sparse type warning.

Signed-off-by: Colin Vidal <colin@cvidal.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Adding space after ','
simran singhal [Thu, 26 Jan 2017 22:09:36 +0000 (03:39 +0530)]
staging: rtl8192u: Adding space after ','

This patch fixes the checkpatch issue by adding space after ','.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Adding space around '='
simran singhal [Thu, 26 Jan 2017 21:31:34 +0000 (03:01 +0530)]
staging: rtl8192u: Adding space around '='

This patch fixes the checkpatch issue by adding space around '='.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: vt6656: Add missing identifier names
=?UTF-8?q?Simon=20Sandstr=C3=B6m?= [Thu, 26 Jan 2017 21:29:48 +0000 (22:29 +0100)]
staging: vt6656: Add missing identifier names

Fix multiple checkpatch.pl warnings:
function definition argument '...' should also have an identifier name

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: llite: use octal permissions
Ernestas Kulik [Tue, 24 Jan 2017 17:40:50 +0000 (19:40 +0200)]
staging: lustre: llite: use octal permissions

Using octal permissions instead of symbolic ones is preferred.

Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: libcfs: use octal permissions
Ernestas Kulik [Tue, 24 Jan 2017 17:40:49 +0000 (19:40 +0200)]
staging: lustre: libcfs: use octal permissions

Using octal permissions instead of symbolic ones is preferred.

Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: ptlrpc: avoid warning on missing return
Arnd Bergmann [Wed, 25 Jan 2017 22:36:34 +0000 (23:36 +0100)]
staging: lustre: ptlrpc: avoid warning on missing return

The newly added function triggers a harmless warning:

drivers/staging/lustre/lustre/ptlrpc/pack_generic.c: In function 'lustre_shrink_msg':
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c:472:1: error: control reaches end of non-void function [-Werror=return-type]

This probably happens because LASSERTF() contains an 'unlikely()' that
sometimes prevents gcc from analysing the control flow correctly.
Adding a return statement here seems harmless and lets us keep that
unlikely().

Fixes: 96049bd1ecd0 ("staging: lustre: ptlrpc: embed highest XID in each request")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: most: hdm-usb: fix symbolic permissions warning
Sebastian Haas [Wed, 25 Jan 2017 22:47:43 +0000 (23:47 +0100)]
staging: most: hdm-usb: fix symbolic permissions warning

Replace symbolic permissions with their octect representation to fix
checkpatch warnings.

Signed-off-by: Sebastian Haas <sehaas@deebas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: fix unaligned parentheses
Umang Raghuvanshi [Thu, 26 Jan 2017 14:40:59 +0000 (14:40 +0000)]
staging: fbtft: fix unaligned parentheses

Fix the following formatting issues:
CHECK: Alignment should match open parenthesis

Signed-off-by: Umang Raghuvanshi <u@umangis.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: loopback: fix broken udelay
Johan Hovold [Thu, 26 Jan 2017 11:37:32 +0000 (12:37 +0100)]
staging: greybus: loopback: fix broken udelay

The loopback driver allows the user to set a minimum delay of up to one
second to be inserted between test iterations (i.e. request
submissions). The delay is currently specified in microseconds and is
implemented using udelay.

Busy looping for long periods is not just anti-social; udelay must not
be used for delays longer than a few milliseconds due to the risk of
integer overflow.

Replace the broken udelay with a usleep_range with a 100 us range for
short delays (< 20 ms) and otherwise revert to using msleep.

Fixes: b36f04fa9417 ("greybus: loopback: Convert thread delay to microseconds")
Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: stable <stable@vger.kernel.org> # 4.9+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: sdio: Prefer u32 over uint32_t
Franck Demathieu [Wed, 25 Jan 2017 17:38:01 +0000 (18:38 +0100)]
staging: greybus: sdio: Prefer u32 over uint32_t

It fixes the following issue reported by checkpatch.pl:
Prefer kernel type 'u32' over 'uint32_t'

Signed-off-by: Franck Demathieu <fdemathieu@gmail.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: uart: fix TIOCGSERIAL flags
Johan Hovold [Wed, 25 Jan 2017 17:07:52 +0000 (18:07 +0100)]
staging: greybus: uart: fix TIOCGSERIAL flags

This driver does not have a low-latency mode and should not report
anything else.

Also drop the skip-test flag which isn't used either.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: Add STM32 timer trigger driver
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:07 +0000 (10:15 +0100)]
iio: Add STM32 timer trigger driver

Timers IPs can be used to generate triggers for other IPs like
DAC or ADC.
Each trigger may result of timer internals signals like counter enable,
reset or edge, this configuration could be done through "master_mode"
device attribute.

Since triggers could be used by DAC or ADC their names are defined
in include/ nux/iio/timer/stm32-timer-trigger.h and is_stm32_iio_timer_trigger
function could be used to check if the trigger is valid or not.

"trgo" trigger have a "sampling_frequency" attribute which allow to configure
timer sampling frequency.

version 8:
- change kernel version from 4.10 to 4.11 in ABI documentation

version 7:
- remove all iio_device related code
- move driver into trigger directory

version 5:
- simplify tables of triggers
- only create an IIO device when needed

version 4:
- get triggers configuration from "reg" in DT
- add tables of triggers
- sampling frequency is enable/disable when writing in trigger
  sampling_frequency attribute
- no more use of interruptions

version 3:
- change compatible to "st,stm32-timer-trigger"
- fix attributes access right
- use string instead of int for master_mode and slave_mode
- document device attributes in sysfs-bus-iio-timer-stm32

version 2:
- keep only one compatible
- use st,input-triggers-names and st,output-triggers-names
  to know which triggers are accepted and/or create by the device

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agoiio: Add bindings for STM32 timer trigger driver
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:06 +0000 (10:15 +0100)]
iio: Add bindings for STM32 timer trigger driver

Define bindings for STM32 timer trigger

version 8:
- reword "reg" parameter description

version 4:
- remove triggers enumeration from DT
- add reg parameter

version 3:
- change file name
- add cross reference with mfd bindings

version 2:
- only keep one compatible
- add DT parameters to set lists of the triggers:
  one list describe the triggers created by the device
  another one give the triggers accepted by the device

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agopwm: Add driver for STM32 plaftorm
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:05 +0000 (10:15 +0100)]
pwm: Add driver for STM32 plaftorm

This driver adds support for PWM driver on STM32 platform.
The SoC have multiple instances of the hardware IP and each
of them could have small differences: number of channels,
complementary output, auto reload register size...

version 9:
- fix commit message header
- remove one space MODULE_ALIAS

version 8:
- fix comments done by Thierry on version 7

version 6:
- change st,breakinput parameter to make it usuable for stm32f7 too.

version 4:
- detect at probe time hardware capabilities
- fix comments done on v2 and v3
- use PWM atomic ops

version 2:
- only keep one comptatible
- use DT parameters to discover hardware block configuration

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agostaging: fbtft: fix checkpatch decimal permissions error
Abdul Rauf [Tue, 24 Jan 2017 00:20:10 +0000 (00:20 +0000)]
staging: fbtft: fix checkpatch decimal permissions error

Fix the following errors:
Use 4 digit octal (0777) not decimal permissions

Signed-off-by: Abdul Rauf <abdulraufmujahid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: rtl8712: fix spelling errors
Joseph Wright [Tue, 24 Jan 2017 08:17:18 +0000 (08:17 +0000)]
Staging: rtl8712: fix spelling errors

Found by checkpatch:
- s/cacluated/calculated/
- s/convertor/converter/
- s/psudo/pseudo/
- s/halfs/halves/

Signed-off-by: Joseph Wright <rjosephwright@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: fbtft: remove duplicate entries of ili9225
Amitesh Singh [Tue, 24 Jan 2017 17:46:14 +0000 (23:16 +0530)]
staging: fbtft: remove duplicate entries of ili9225

There are multiple entries for ili9225 display defined in
flexfb_chip_table array. remove duplicate entries and
keep single entry.

Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agodt-bindings: pwm: Add STM32 bindings
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:04 +0000 (10:15 +0100)]
dt-bindings: pwm: Add STM32 bindings

Define bindings for pwm-stm32

version 9:
- change commit message header

version 8:
- reword st,breakinput description.

version 6:
- change st,breakinput parameter format to make it usuable on stm32f7 too.

version 2:
- use parameters instead of compatible of handle the hardware configuration

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agomfd: Add STM32 Timers driver
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:03 +0000 (10:15 +0100)]
mfd: Add STM32 Timers driver

This hardware block could at used at same time for PWM generation
and IIO timers.
PWM and IIO timer configuration are mixed in the same registers
so we need a multi fonction driver to be able to share those registers.

version 7:
- rebase on v4.10-rc2

version 6:
- rename files to stm32-timers
- rename functions to stm32_timers_xxx

version 5:
- fix Lee comments about detect function
- add missing dependency on REGMAP_MMIO

version 4:
- add a function to detect Auto Reload Register (ARR) size
- rename the structure shared with other drivers

version 2:
- rename driver "stm32-gptimer" to be align with SoC documentation
- only keep one compatible
- use of_platform_populate() instead of devm_mfd_add_devices()

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agodt-bindings: mfd: Add bindings for STM32 Timers driver
Benjamin Gaignard [Fri, 20 Jan 2017 09:15:02 +0000 (10:15 +0100)]
dt-bindings: mfd: Add bindings for STM32 Timers driver

Add bindings information for STM32 Timers

version 6:
- rename stm32-gtimer to stm32-timers
- change compatible
- add description about the IPs

version 2:
- rename stm32-mfd-timer to stm32-gptimer
- only keep one compatible string

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
7 years agostaging: media: lirc: use new parport device model
Sudip Mukherjee [Sat, 21 Jan 2017 00:55:54 +0000 (00:55 +0000)]
staging: media: lirc: use new parport device model

Modify lirc_parallel driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change msg union in struct lnet_hdr to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:32 +0000 (19:40 -0500)]
staging: lustre: lnet: change msg union in struct lnet_hdr to proper structure

Modify all the msg union fields from typedefs to
to proper structures.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_hdr_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:31 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_hdr_t to proper structure

Change lnet_hdr_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_magicversion_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:30 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_magicversion_t to proper structure

Change lnet_magicversion_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_acceptor_connreq_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:29 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_acceptor_connreq_t to proper structure

Change lnet_acceptor_connreq_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_process_id_packed_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:28 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_process_id_packed_t to proper structure

Change lnet_process_id_packed_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_ni_status_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:27 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_ni_status_t to proper structure

Change lnet_ni_status_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_ping_info_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:26 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_ping_info_t to proper structure

Change lnet_ping_info_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: lustre: lnet: change lnet_handle_wire_t to proper structure
James Simmons [Sun, 22 Jan 2017 00:40:25 +0000 (19:40 -0500)]
staging: lustre: lnet: change lnet_handle_wire_t to proper structure

Change lnet_handle_wire_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: greybus: audio_gb.c: Change uint32_t to u32
Marcos Paulo de Souza [Sun, 22 Jan 2017 17:49:21 +0000 (15:49 -0200)]
staging: greybus: audio_gb.c: Change uint32_t to u32

Change uint32_t to u32, solved the issue reported by checkpatch.pl:

CHECK: Prefer kernel type 'u32' over 'uint32_t'
+ uint32_t *format, uint32_t *rate, u8 *channels,

CHECK: Prefer kernel type 'u32' over 'uint32_t'
+ uint32_t format, uint32_t rate, u8 channels,

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoStaging: rtl8188eu: os_dep: usb_ops_linux.c - style fix
Derek Robson [Sun, 22 Jan 2017 05:17:24 +0000 (18:17 +1300)]
Staging: rtl8188eu: os_dep: usb_ops_linux.c - style fix

Fixed comparison, moved the constant to the right side of the test
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agostaging: rtl8192u: Adding space around '='
simran singhal [Fri, 20 Jan 2017 17:48:23 +0000 (23:18 +0530)]
staging: rtl8192u: Adding space around '='

This patch fixes the checkpatch issue by adding space around '='.

Signed-off-by: simran singhal <singhalsimran0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoiio: accel: fix Kconfig warning
Linus Walleij [Fri, 20 Jan 2017 09:46:05 +0000 (10:46 +0100)]
iio: accel: fix Kconfig warning

commit 762227721fe6225be5b6d233ef681aea5871f5f3
"iio: accel: st_accel: handle deprecated bindings"
attempted to be smart and let users use the old I2C
driver and the new SPI driver, or the old SPI driver and
the new I2C driver in combination for the LIS3LV02,
and put the restrictions on the I2C and SPI subdrivers
not not be combined with the old subdrivers.

This doesn't work since the IIO ST accel top-level
component selects the I2C and SPI subdrivers, resulting
in the following Kconfig noise:

warning: (IIO_ST_ACCEL_3AXIS) selects IIO_ST_ACCEL_I2C_3AXIS
which has unmet direct dependencies (IIO && !SENSORS_LIS3_I2C
&& IIO_ST_ACCEL_3AXIS && IIO_ST_SENSORS_I2C)
warning: (IIO_ST_ACCEL_3AXIS) selects IIO_ST_ACCEL_SPI_3AXIS
which has unmet direct dependencies (IIO && !SENSORS_LIS3_SPI
&& IIO_ST_ACCEL_3AXIS && IIO_ST_SENSORS_SPI)
(...)

This fixes the issue by putting the dependencies directly
in the top-level component instead, so that it never gets
to select its unselectable subcomponent.

Fixes: 762227721fe6 ("iio: accel: st_accel: handle deprecated bindings")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7 years agoMerge tag 'iio-for-4.11b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Mon, 23 Jan 2017 08:23:23 +0000 (09:23 +0100)]
Merge tag 'iio-for-4.11b' of git://git./linux/kernel/git/jic23/iio into work-next

Jonathan writes:

Second round of IIO new device support, cleanups and features for the 4.11 cycle

New device support:
* lsm6dsx imu
  - new driver and bindings.
* max11100 adc
  - new driver and bindings.
* tlc4541
  - new driver
* tmp007 thermopile
  - new driver.

Core
* in kernel interfaces
  - pass through raw values if no scaling provided and a processed value is
    requested.
* trigger
  - close a race condition in acquiring trigger reference.
  - constify device_type structures.
  - rework the viio_trigger_alloc function to be much neater and easier to
  read.
  - free trigger resources correctly on some error paths. Avoids putting a
  module we don't have.

Documentation
* ABI
  - specify a unit for proximity measurements.

Cleanups and features
* ads1015
  - constify iio_info structure.
* ads7950 cleanups following merge in previous pull
  - Add device tree bindings
  - Drop the ti prefix from the module name in common with other drivers.
  - Change regulator name to vref to match datasheet and other drivers.
* ak8974
  - remove a redundant zero timeout check.
* bmi160
  - use variable names for sizeof instead of types.
* cm3605
  - mark PM functions as __maybe_unused to avoid a build warning.
* isl29028 (on it's way towards moving out of staging).
  - alignment fixes and newline improvements.
  - combine proxim_get and read_proxim for simpler code.
  - drop unused ISL29028_DEV_ATTR macro
  - move some error logging into functions to cut out repitition.
  - make error messages more consistent.
  - tidy up some brackets.
  - drop the enable flag that nothing uses.
  - only set proximity rate and ALS scale when relevant channel type is enabled.
  - runtime pm support.
* lsm6dsx
  - fix wrong values for gyro sensitivitiy.
* mag3110
  - claim direct mode during sysfs reads to avoid a race condition.
* max1363
  - export OF device table IDs as module aliases.
* max30100
  - use msleep for long uncritical delays.
* mcp4531
  - export OF device table as module aliases.
* ms5611
  - claim direct mode during sysfs reads to avoid a race condition.
* opt3001
  - export OF device table as module aliases.
* sx9500
  - claim direct mode during oversampling changes to avoid a race condition.

7 years agoiio: trigger: free trigger resource correctly
Alison Schofield [Fri, 20 Jan 2017 03:47:38 +0000 (19:47 -0800)]
iio: trigger: free trigger resource correctly

These stand-alone trigger drivers were using iio_trigger_put()
where they should have been using iio_trigger_free().  The
iio_trigger_put() adds a module_put which is bad since they
never did a module_get.

In the sysfs driver, module_get/put's are used as triggers are
added & removed. This extra module_put() occurs on an error path
in the probe routine (probably rare).

In the bfin-timer & interrupt trigger drivers, the module resources
are not explicitly managed, so it's doing a put on something that
was never get'd.  It occurs on the probe error path and on the
remove path (not so rare).

Tested with the sysfs trigger driver.
The bfin & interrupt drivers were build tested & inspected only.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: trigger: clean up viio_trigger_alloc()
Dan Carpenter [Sat, 21 Jan 2017 04:55:58 +0000 (07:55 +0300)]
iio: trigger: clean up viio_trigger_alloc()

1) Reverse the test for kmalloc() failure so we can pull everything
   back one tab.
2) Use gotos for unwinding.
3) Some of the extra line breaks for the 80 character limit are no
   longer needed so we can remove them.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: adc: constify iio_info structures
Bhumika Goyal [Sat, 21 Jan 2017 17:03:00 +0000 (22:33 +0530)]
iio: adc: constify iio_info structures

Declare iio_info structures as const as they are only stored in
the info field of a iio_dev structure. This field is of type const,
so iio_info structures having similar properties can be made const too.

File size before:
   text    data     bss     dec     hex filename
   6944     792       0    7736    1e38 drivers/iio/adc/ti-ads1015.o

File size after:
   text   data     bss     dec     hex filename
   7264     472       0    7736    1e38 drivers/iio/adc/ti-ads1015.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: industrialio-trigger: constify device_type structures
Bhumika Goyal [Sat, 21 Jan 2017 16:59:49 +0000 (22:29 +0530)]
iio: industrialio-trigger: constify device_type structures

Declare device_type structure as const as it is only stored in the
type field of a device structure. This field is of type const, so add
const to declaration of device_type structure.

File size before:
   text    data     bss     dec     hex filename
   5389     208      48    5645    160d iio/industrialio-trigger.o

File size after:
   text    data     bss     dec     hex filename
   5453     176      48    5677    162d iio/industrialio-trigger.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: trigger: close race condition in acquiring trigger reference
Alison Schofield [Sun, 22 Jan 2017 03:28:52 +0000 (19:28 -0800)]
iio: trigger: close race condition in acquiring trigger reference

In iio_trigger_write_current() we find the trigger we want while
holding mutex on the list of triggers, but we don't actually do a
get on it while holding mutex.  We wait until further validations
are completed and we're sure it's the one we want.  Race condition
is that it could be freed by the time we do the get.

Solution is to grab the trigger (iio_trigger_get) as soon as we
find it while holding mutex on the list of triggers.  If later
we decide it's not the right one, put it back. (iio_trigger_put).

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agoiio: imu: st_lsm6dsx: fix typo in gyro sensitivity definition
Lorenzo Bianconi [Tue, 17 Jan 2017 18:38:23 +0000 (19:38 +0100)]
iio: imu: st_lsm6dsx: fix typo in gyro sensitivity definition

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: isl29028: add runtime power management support
Brian Masney [Tue, 17 Jan 2017 09:25:02 +0000 (04:25 -0500)]
staging: iio: isl29028: add runtime power management support

This patch adds runtime power management support to the isl29028 driver.
It defaults to powering off the device after two seconds of inactivity.

isl29028_chip_init_and_power_on() currently only zeros the CONFIGURE
register on the chip, which will cause the chip to turn off. This patch
also renames that function to isl29028_clear_configure_reg() since it is
now used in several places.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
7 years agostaging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabled
Brian Masney [Tue, 17 Jan 2017 09:25:01 +0000 (04:25 -0500)]
staging: iio: isl29028: only set ALS scale when ALS/IR sensing is enabled

isl29028_chip_init_and_power_on() calls isl29028_set_als_scale() and
this is not needed until the user actually needs to take a reading from
the ALS/IR sensor. This patch moves the isl29028_set_als_scale() call
from isl29028_chip_init_and_power_on() to isl29028_set_als_ir_mode().
This sets the stage for faster resume times from runtime power
management if the user is only querying the proximity sensor.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>