platform/kernel/linux-starfive.git
6 years agostaging: iio: ad2s1200: Setup spi before iio device register
David Veenstra [Fri, 18 May 2018 18:21:44 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Setup spi before iio device register

The spi should be set up before the device is registered as an iio
device.

This patch moves the setup to before the device registration.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Add kernel docs to driver state
David Veenstra [Fri, 18 May 2018 18:21:34 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Add kernel docs to driver state

Add missing kernel docs to the ad2s1200 driver state.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Remove unneeded initializations
David Veenstra [Fri, 18 May 2018 18:21:23 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Remove unneeded initializations

Remove 2 initializations which are unneeded, because the
initialized values are never used.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: ad2s1200: Remove unneeded newline in license
David Veenstra [Fri, 18 May 2018 18:21:06 +0000 (20:21 +0200)]
staging: iio: ad2s1200: Remove unneeded newline in license

Remove unneeded newline in license, as it does not improve readability.

Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R support
Stefan Popa [Fri, 18 May 2018 15:23:34 +0000 (18:23 +0300)]
iio:dac:ad5686: Add AD5681R/AD5682R/AD5683/AD5683R support

The AD5681R/AD5682R/AD5683/AD5683R are a family of one channel DACs with
12-bit, 14-bit and 16-bit precision respectively. The devices have either
no built-in reference, or built-in 2.5V reference.

These devices are similar to AD5691R/AD5692R/AD5693/AD5693R except
with a few notable differences:
 * they use the SPI interface instead of I2C
 * in the write control register, DB18 and DB17 are used for setting the
   power mode, while DB16 is the REF bit. This is why a new regmap type
   was defined and checked accordingly.
 * the shift register is 24 bits wide, the first four bits are the command
   bits followed by the data bits. As the data comprises of 20-bit, 18-bit
   or 16-bit input code, this means that 4 LSB bits are don't care. This is
   why the data needs to be shifted on the left with four bits. Therefore,
   AD5683_REGMAP is checked inside a switch case in the ad5686_spi_write()
   function. On the other hand, similar devices such as AD5693R family,
   have the 4 MSB command bits followed by 4 don't care bits.

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

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R support
Stefan Popa [Fri, 18 May 2018 15:22:50 +0000 (18:22 +0300)]
iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R support

The AD5691R/AD5692R/AD5693/AD5693R are a family of one channel DACs with
12-bit, 14-bit and 16-bit precision respectively. The devices have either
no built-in reference, or built-in 2.5V reference.

These devices are pretty similar to AD5671R/AD5675R and
AD5694/AD5694R/AD5695R/AD5696/AD5696R, except that they have one channel.
Another difference is that they use a write control register(addr 0x04) for
setting the power down modes and the internal reference instead of separate
registers for each function.

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

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: stm32-dfsdm: include stm32-dfsdm-adc.h
Fabrice Gasnier [Tue, 15 May 2018 15:19:17 +0000 (17:19 +0200)]
iio: adc: stm32-dfsdm: include stm32-dfsdm-adc.h

Fix the following sparse warnings:
  CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?

BTW, move interrupt.h to sort headers alphabetically.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: afe: Spelling s/mesaurement/measurement/
Geert Uytterhoeven [Tue, 15 May 2018 13:06:24 +0000 (15:06 +0200)]
dt-bindings: iio: afe: Spelling s/mesaurement/measurement/

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: tsl2583: correct values in integration_time_available
Brian Masney [Sun, 13 May 2018 00:20:39 +0000 (20:20 -0400)]
iio: tsl2583: correct values in integration_time_available

The times reported by the in_illuminance_integration_time_available
sysfs attribute are actually in milliseconds, not microseconds. This
patch corrects the times with the correct unit.

The fixes tag is inaccurate as the issue existed when the driver
was still in staging.   However, lots of changes occured before
it graduated so this is as a good a point as any for backports.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Fixes: f44d5c8ac399 ("staging: iio: tsl2583: move out of staging")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x/tsl2772: move out of staging
Brian Masney [Fri, 11 May 2018 00:12:23 +0000 (20:12 -0400)]
staging: iio: tsl2x7x/tsl2772: move out of staging

Move the tsl2772 driver out of staging and into mainline.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: rename driver to tsl2772
Brian Masney [Fri, 11 May 2018 00:12:22 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: rename driver to tsl2772

This patch renames this driver from tsl2x7x to tsl2772 since it is
highly likely that additional devices will be added to this driver that
do not match that wildcard. The tsl2772 driver name was selected since
that is currently the device with the most features that are supported
by this driver.

This patch also adds Brian Masney's copyright to tsl2772.h for all of
the work that has been done to move this driver out of staging.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: add range checking to tsl2x7x_write_raw
Brian Masney [Fri, 11 May 2018 00:12:21 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: add range checking to tsl2x7x_write_raw

The CALIBBIAS and INT_TIME masks in tsl2x7x_write_raw did not have any
range checking in place so this patch adds the appropriate range
checking. The defines TSL2X7X_ALS_GAIN_TRIM_{MIN,MAX} are also
introduced by this patch.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD values
Brian Masney [Fri, 11 May 2018 00:12:20 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: correct IIO_EV_INFO_PERIOD values

The thresh periods assumed an integration time of 3ms. This patch adds
support for the correct integration time (2.72ms or 2.73ms). The code
had the ALS filter values as going up to 15, however the values actually
went up to 60 since the values scaled in increments of 5 once the
persistence value went above 3.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: convert to use read_avail
Brian Masney [Fri, 11 May 2018 00:12:19 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: convert to use read_avail

Make the sysfs attributes in_proximity0_calibscale_available, and
in_intensity0_{calibscale,integration_time}_available be created
using info_mask_separate_available on the channel configuration.

The driver assumed that the ALS increment was 2.72 ms, and the upper
range was 696 ms. Some other supported devices use 2.73 ms - 699 ms.
This patch adds support for the multiple ranges.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: use macro to populate tsl2X7X_device_info
Brian Masney [Fri, 11 May 2018 00:12:18 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: use macro to populate tsl2X7X_device_info

This patch creates a macro that populates the tsl2X7X_device_info
structure to reduce duplicated code in the driver.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: turn chip off if IIO device registration fails
Brian Masney [Fri, 11 May 2018 00:12:17 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: turn chip off if IIO device registration fails

This patch turns the chip off if IIO device registration fails so that
the error handling mirrors the device remove to make review easier in
preparation for moving this driver out of staging.

This patch also adds a missing error check in the call to
tsl2x7x_chip_on() in tsl2x7x_probe().

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: use direct returns
Brian Masney [Fri, 11 May 2018 00:12:16 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: use direct returns

This patch changes the functions tsl2x7x_read_event_value() and
tsl2x7x_read_raw() to use direct returns to simplify the code.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: iio: tsl2x7x: remove unnecessary whitespace
Brian Masney [Fri, 11 May 2018 00:12:15 +0000 (20:12 -0400)]
staging: iio: tsl2x7x: remove unnecessary whitespace

This patch removes unnecessary whitespace in preparation for moving this
driver out of staging.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: accell: mma8452: Reduce sleep time when data not ready
Richard Tresidder [Fri, 11 May 2018 08:54:59 +0000 (16:54 +0800)]
iio: accell: mma8452: Reduce sleep time when data not ready

Modified the sleep method when data is not ready to allow for sampling > 50sps to work.

Signed-off-by: Richard Tresidder <rtresidd@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: ti-ads8688: add trigger and buffer support
Sean Nyekjaer [Wed, 9 May 2018 18:17:18 +0000 (20:17 +0200)]
iio: adc: ti-ads8688: add trigger and buffer support

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: potentiostat: lmp91000: add LMP91002 support
Matt Ranostay [Tue, 8 May 2018 05:34:01 +0000 (22:34 -0700)]
iio: potentiostat: lmp91000: add LMP91002 support

LMP91002 is register compatible so add devicetree and i2c client ids

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: magnetometer: mag3110: Add ability to run in continuous mode
Richard Tresidder [Tue, 8 May 2018 07:59:54 +0000 (15:59 +0800)]
iio: magnetometer: mag3110: Add ability to run in continuous mode

Adds the ability to run the Mag3110 in continuous mode to speed up the
sampling rate.
Depending on the sampling rate requested the device can be put in or out
of continuous mode automatically.
Shifting out of continuous mode requires a potential 1 / ODR wait which
is also implemented.
Modified the sleep method when data is not ready to allow for
sampling > 50sps to work.

Signed-off-by: Richard Tresidder <rtresidd@electromag.com.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: adc: stm32-dfsdm: Add support for stm32mp1
Fabrice Gasnier [Wed, 2 May 2018 13:05:23 +0000 (15:05 +0200)]
iio: adc: stm32-dfsdm: Add support for stm32mp1

Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
6 filter instances. Registers map is also increased.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: imu: inv_mpu6050: make loop a do-while
Martin Kelly [Tue, 1 May 2018 17:56:42 +0000 (10:56 -0700)]
iio: imu: inv_mpu6050: make loop a do-while

Prior to this loop, we check if fifo_count < bytes_per_datum and bail if
so. This means that when we hit the loop, we know that fifo_count >=
bytes_per_datum, so the check is unneeded and we can turn the loop into
a do-while for a slight performance improvement.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agostaging: wlan-ng: fix block comment alignment in p80211metastruct.h
Tim Collier [Fri, 11 May 2018 07:36:46 +0000 (08:36 +0100)]
staging: wlan-ng: fix block comment alignment in p80211metastruct.h

Fix checkpatch warning for misaligned * characters in the block
comment at the start of p80211metastruct.h; with this change the file
is checkpatch clean.

Signed-off-by: Tim Collier <osdevtc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835: Fix mmal_port_parameter_get() signed/unsigned warnings.
Eric Anholt [Thu, 10 May 2018 19:42:20 +0000 (12:42 -0700)]
staging: bcm2835: Fix mmal_port_parameter_get() signed/unsigned warnings.

The arg is a u32 *, so switch over to that in our declarations.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835: Remove dead code related to framerate.
Eric Anholt [Thu, 10 May 2018 19:42:19 +0000 (12:42 -0700)]
staging: bcm2835: Remove dead code related to framerate.

Fixes a compiler warning about a set-but-not-used variable. I think
this was just leftover dead code from before set_framerate_params(),
since that also sets up some mmal_parameter_rational structs for fps.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.
Eric Anholt [Thu, 10 May 2018 19:42:18 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix warnings about string ops on v4l2 uapi.

The v4l2 uapi uses u8[] for strings, so cast those to char * to avoid
compiler warnings about unsigned vs signed with sprintf() and friends.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix indentation of tables
Dave Stevenson [Thu, 10 May 2018 19:42:17 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix indentation of tables

As requested by Mauro Carvalho Chehab in review.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Fix comment typos.
Dave Stevenson [Thu, 10 May 2018 19:42:15 +0000 (12:42 -0700)]
staging: bcm2835-camera: Fix comment typos.

Fix a typo flagged by checkpatch, and another in the same line.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Replace BUG_ON with return error
Dave Stevenson [Thu, 10 May 2018 19:42:14 +0000 (12:42 -0700)]
staging: bcm2835-camera: Replace BUG_ON with return error

The error conditions don't warrant taking the kernel down, so remove
BUG_ON.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Move struct vchiq_mmal_rect
Dave Stevenson [Thu, 10 May 2018 19:42:13 +0000 (12:42 -0700)]
staging: bcm2835-camera: Move struct vchiq_mmal_rect

struct vchiq_mmal_rect is only referenced from mmal-parameters.h, yet
was defined in mmal-vchiq.h.

Move it to avoid having to include multiple headers for no reason.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Add multiple include protection
Dave Stevenson [Thu, 10 May 2018 19:42:12 +0000 (12:42 -0700)]
staging: bcm2835-camera: Add multiple include protection

mmal-parameters.h didn't have the normal

...

protection to stop it being included multiple times.  Add it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Remove V4L2/MMAL buffer remapping
Dave Stevenson [Thu, 10 May 2018 19:42:11 +0000 (12:42 -0700)]
staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping

The MMAL and V4L2 buffers had been disassociated, and linked on
demand.  Seeing as both are finite and low in number, and we now have
the same number of each, link them for the duration.  This removes the
complexity of maintaining lists as the struct mmal_buffer context
comes back from the VPU, so we can directly link back to the relevant
V4L2 buffer.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Match MMAL buffer count to V4L2.
Dave Stevenson [Thu, 10 May 2018 19:42:10 +0000 (12:42 -0700)]
staging: bcm2835-camera: Match MMAL buffer count to V4L2.

For historical reasons, the number of buffers passed to the VPU over
MMAL did not match that passed from V4L2.  That is a silly situation
as the driver has to duplicate serialisation and other functions that
have already been implemented in V4L2/videobuf2.

As we had more V4L2 buffers than MMAL ones, the MMAL buffer headers
were returned to the VPU immediately on being filled, which is now
invalid.

Match the number of buffers notified in queue_setup with that used in
MMAL.  Return buffers only when we get them from V4L2.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Remove bulk_mutex as it is not required
Dave Stevenson [Thu, 10 May 2018 19:42:09 +0000 (12:42 -0700)]
staging: bcm2835-camera: Remove bulk_mutex as it is not required

There is no requirement to serialise bulk transfers as that is all
done in VCHI, and if a second MMAL_MSG_TYPE_BUFFER_TO_HOST happened
before the VCHI_CALLBACK_BULK_RECEIVED, then the service_callback
thread is deadlocked.

Remove the bulk_mutex so that multiple receives can be scheduled at a
time.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Allocate context once per buffer
Dave Stevenson [Thu, 10 May 2018 19:42:08 +0000 (12:42 -0700)]
staging: bcm2835-camera: Allocate context once per buffer

The struct mmal_msg_context was being allocated for every message
being sent to the VPU, and freed when it came back.  Whilst that is
required behaviour for some messages (mainly the synchronous ones), it
is wasteful for the video buffers that make up the majority of the
traffic.

Add to the buffer_init/cleanup hooks that it allocates/frees the
msg_context required.

v2: changes by anholt from the downstream tree: clean up indentation,
    pass an error value through, forward-declare the struct so we have
    less void *

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: bcm2835-camera: Skip ISP pass to eliminate padding.
Dave Stevenson [Thu, 10 May 2018 19:42:07 +0000 (12:42 -0700)]
staging: bcm2835-camera: Skip ISP pass to eliminate padding.

Interleaved RGB and single plane YUV formats can be delivered by the
GPU without the secondary step of removing padding, as the
bytesperline field can be set appropriately.

Planar YUV needs the GPU to still remove padding, as there is no way
to report that there is padding between the planes (ie on the height).
The multi-planar formats are NOT applicable, as there is no easy way
to make them contiguous in memory (ie one large allocation that gets
broken up). The whole task is passed across to videobuf2 which has no
notion of that requirement.

v2: Changes by anholt from the downstream driver: Flag two more planar
    formats as needing padding removal, and remove broken userspace
    workaround.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/bcm2835-camera: Set ourselves up as a platform driver.
Eric Anholt [Thu, 10 May 2018 19:42:06 +0000 (12:42 -0700)]
staging/bcm2835-camera: Set ourselves up as a platform driver.

This allows bcm2835-camera to automatically probe after VCHI has
loaded, rather than only successfully probing if the arbitrary probe
order chooses us after VCHI.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging/vc04_services: Register a platform device for the camera driver.
Eric Anholt [Thu, 10 May 2018 19:42:05 +0000 (12:42 -0700)]
staging/vc04_services: Register a platform device for the camera driver.

We had the camera driver set up in a module_init function, but that
meant that the camera driver would fail to load if it was initialized
before VCHI.  By attaching to this platform_device, it can get a
defined load order.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging:r8188eu: Remove rx_handler_data unnecessary read
Ivan Safonov [Wed, 9 May 2018 19:44:06 +0000 (22:44 +0300)]
staging:r8188eu: Remove rx_handler_data unnecessary read

Rx handler (assigned with netdev_rx_handler_register,
called from __netif_receive_skb()) uses value of dev->rx_handler_data.
The driver has no rx handler and does not need it, so remove rx_handler_data read.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lnet: add static to libcfs_dev declaration
Justin Skists [Thu, 10 May 2018 19:41:29 +0000 (20:41 +0100)]
staging: lustre: lnet: add static to libcfs_dev declaration

Add a static prefix to the declaration for libcfs_dev. This would fix
the following sparse warning:

drivers/staging/lustre/lnet/libcfs/module.c:317:19: warning: symbol
'libcfs_dev' was not declared. Should it be static?

Signed-off-by: Justin Skists <justin.skists@juzza.co.uk>
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtlwifi: fix spelling mistake: "traking" -> "tracking"
Colin Ian King [Thu, 10 May 2018 15:07:41 +0000 (16:07 +0100)]
staging: rtlwifi: fix spelling mistake: "traking" -> "tracking"

Trivial fix to spelling mistake in ODM_RT_TRACE message text

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: video: remove debugging code
Abdun Nihaal [Tue, 8 May 2018 16:30:40 +0000 (22:00 +0530)]
staging: most: video: remove debugging code

This patch removes debugging code in video.c that causes the following
checkpatch warning:

WARNING: Prefer using '\"%s...\", __func__' to using function's name in a string

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: rtl8723bs: Replace license boilerplate with SPDX identifiers
Nathan Chancellor [Tue, 8 May 2018 11:59:53 +0000 (04:59 -0700)]
staging: rtl8723bs: Replace license boilerplate with SPDX identifiers

This satisfies a checkpatch.pl warning and is the preferred method for
notating the license due to its lack of ambiguity.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoMerge tag 'iio-for-4.18a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23...
Greg Kroah-Hartman [Fri, 11 May 2018 07:50:04 +0000 (09:50 +0200)]
Merge tag 'iio-for-4.18a' of git://git./linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

1st round of IIO new device support, features and cleanup for the 4.18 cycle

A nice mix this time of excellent cleanups (many to send drivers
speeding toward staging graduations) and new drivers / device support.
A good part of this is Brian Masney's never ending task on the tsl2x7x
driver.  The end is in sight so hopefully we'll get that one out of
staging very soon!

New device support
* AD5686
  - Support AD5685R (was wrongly present as AD5685)
  - Support AD5672R, AD5676, AD5676, AD5684R and AD5686R 4 and 8 channel
    SPI DACs with various precisions.
  - Support AD5671R, AD5675R, AD5694, AD5694R, AD5695R, AD5696 and AD5696R
    I2C DACs with various percisions and numbers of channels.
* Analog front end rescale driver - New driver.
  - Support current sensing usings a shunt resistor.
  - Support simple voltage dividers.
  - support simple current sense amplifiers.
* TI dac5571
  - New driver and device bindings supporting:
    dac5571, dac6571, dac7571, dac5574, dac6574, dac7574,
    dac5573, dac6573 and dac7573
* Meson-adc
  - Support for Meson AXG with DT bindings.
* mpu6050
  - Support the mpu9255 which only requires additional WHOAMI entry and
    compatible string.
* st_lsm6dsx
  - Support for lsm330dlc combinded accelerometer and gyro sensors with
    DT bindings.
* stm32_adc
  - Add support for STM32MP1 with bindings.

Staging graduations
* adis16201 after some excelent cleanup by Himanshu Jha.
* adis16029 after some excelent cleanup by Shreeya Patel.

New features:
* ABI docs
  - Add core ABI docs for angle channels.
* inv_mpu6050
  - Provide support for the full range of interrupts the device
    supports.
* st_accel
  - Add SMO8840 ACPI ID seen in the wild on some Lenovo machines.
* stx104
  - Provide a multiple gpio get function.

Cleanups / Minor fixes
* core
  - Use new nested structure support to improve kernel-doc.
* ad2s1200
  - Use be16_to_cpup instead of opencoding.
* ad5686
  - Indentation tidy up.
  - Switch to SPDX
  - Refactor to allow various numbers of channels.
  - Refactor to separate core and SPI specific support, prior to
    addition of i2c equivalent devices.
* ad7606
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* ad7746
  - Replace opencoded byte swapped i2c calls with _swapped variants.
  - White space and line break readability improvements.
  - Reorder includes and variable declarations where appropriate.
* ad7791
  - Changes to the AD ADC library used by this driver took in the
    sampling frequency.  This lead to be the wrong path being the one
    tied to the resulting attribute, so it didn't work, and a warning
    to be printed.
* ad7780
  - Remove apparent support for sampling frequency control on devices
    that don't support changing the sampling attributes.
* ade7854
  - Fix a read of the wrong number of bits.
  - Improve error handling on i2c read/write errors.
  - Rework i2c and spi code to reduce duplication.
* adis16201 (staging)
  - Improve meaning inherent in some macro names by adding units etc
    where relevant.
  - Adjust comments to improve detail and drop the irrelevant.
  - Rename register address definitions definitions to add a _REG
    postfix, clearly separating them from field definitions. Reorganize
    the definitions to group register address and fields.
  - Use sign_extend32 rather than open coding.
  - Reverse Xmas tree ordering where appropriate and align function args.
  - Remove unused headers.
  - Use GENMASK where appropriate instead of open coding.
* adis16209 (staging)
  - Indent field definitions to visually separate them from
    register address definitions.
  - Use reverse xmas tree ordering where appropriate.
  - Add some whitespace where it will help readability.
  - Drop some unused headers.
  - Use GENMASK where appropriate.
* ad2s1200
  - Drop unnecessary includes and reorder alphabetically.
  - Reverse xmas tree and blank line cleanups.
* atlas-ph-sensor
  - Use msleep instead of usleep_range where the precise value doesn't
    matter and the delays are long.
* bcm150
  - Drop transaction splitting as core now handles it.
* cros_ec
  - Move the shared header to the include/iio/common directory.
    This brings it inline with the other multiple type devices.
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* hid-sensors
  - Use drvdata directly from device rather than boucing via the
    platform_device structure.
* inv_mpu6050
  - Clear out a second function definition for the same function.
  - Don't flush fifo when the iio buffer is full but just drop excess
    data.
  - Tidy up set_power_itg and ensure it is used in the right places.
  - Use set_power_itg rather than opencoding it again in the i2c mux
    control.
  - Make sure error paths disable the power if undoing power on.
  - Used managed devm_ functions during probe. Delete remove function.
  - Refactor to pull raw data read out of read_raw function.
  - Simplify data reading error paths.
  - Only enable the i2c mux for chips with the i2c aux bus (not icm20608)
  - Fix a potential deadlock due to varying lock ordering.
  - Fix an issue where first sample from gyro after enabling is unstable
    by dropping the first sample.
  - Fix an issue where the user_ctrl register is incorrectly overwritten.
  - Tidy up some grammar and spelling minor issus.
* mcp320x
  - Use vendor compatible strings.
* mcp4018
  - Switch to using i2c .probe_new.
* mcp4351
  - switch to using i2c .probe_new.
* meson-adc
  - rework handing on common ADC platform data so it can be shared
    across multiple families of SoCs.
* sca3000
  - Fix an error handling path if the ring configure fails.
* st_lsm6dsx
  - Fix a wrong fifo threshold mask (no actual effect)
* stm32-dfsdm
  - Style fixes and cleanups.
  - Check filter ID is in range and check spi-max-frequency.
* tsl2x7x (staging)
  - Drop some unnecessary function calls, unused variables and
    unnecessary local variables.
  - Fix wrong interrupt type.
  - Avoid unnecessary double clear of interrupt.
  - Simplify proximity calibration call which did various things
    unrelated to actually calibrating.
  - Separate control of the proximity and ALS interrupts.
  - Improve consistency of logging.
  - Separate ALS and proximity persistence settings as they have
    separate hardware controls.
  - Tidy up variable ordering.
  - Add Brian to copyright notice given consider work on this driver.
  - Take advantage of hardware support for I2C address auto increment.
  - Combine individuaal enable and period attributes for the two
    directions on the threshold events into a single value as the
    hardware doesn't separate them.
  - Move integration_time* attributes from light channel to
    intensity value as they effect the intensity readings directly
    and the light reading only indirectly.  Hence this better
    reflects reality. Also move the calibscale_available.
  - Avoid returning an error in the IRQ handler.
  - Hard code the reg value in _clear_interrupts as it only takes
    one value in the code.   Result is the function has little
    purpose so opencode the two remaining i2c_smbus_write_byte
    calls.
  - Drop some unnecessary checking of the chip status register.
  - Tidy up return path in _write_interrupt_config.
  - Tidy up the ID verification code.
  - Move the power and diode settings defines into the header as these
    are needed for platform data configuration.
  - Various renames and comment cleanups for consistency and clarity.
  - Use actual device defaults for default startup settings.
  - SPDX
  - Add some range sanity checking to sysfs attribute writes.
  - Don't provide event interfaces if the interrupt line isn't available.
  - Use IIO_CONST_ATTR macro for calibscale_available as it's a constant
    string.
  - Fix the integration time and lux equations.
  - Make device IDs explicit index values in the device_channel_config array.

6 years agostaging: mt7621-eth: Alignment should match open parenthesis
Kamal Heib [Mon, 7 May 2018 09:05:58 +0000 (12:05 +0300)]
staging: mt7621-eth: Alignment should match open parenthesis

Fix alignment issues reported by checkpatch.pl.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Add missing blank lines after declarations
Kamal Heib [Mon, 7 May 2018 09:05:57 +0000 (12:05 +0300)]
staging: mt7621-eth: Add missing blank lines after declarations

Add missing blank lines after declarations to solve checkpatch.pl errors.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Remove unnecessary blank lines
Kamal Heib [Mon, 7 May 2018 09:05:56 +0000 (12:05 +0300)]
staging: mt7621-eth: Remove unnecessary blank lines

Remove un-necessary blank lines to solve errors found by checkpatch.pl.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: mt7621-eth: Fix compilation error
Kamal Heib [Mon, 7 May 2018 09:05:55 +0000 (12:05 +0300)]
staging: mt7621-eth: Fix compilation error

Fix the following comilation error by making sure that "phy_ring_head" is
defined as "dma_addr_t" and change "phy_ring_tail" to match it as both
should be "dma_addr_t".

error: passing argument 3 of â€˜dma_alloc_coherent’ from incompatible pointer type

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: o2iblnd: Enable Multiple OPA Endpoints between Nodes
Doug Oucharek [Tue, 8 May 2018 03:18:06 +0000 (20:18 -0700)]
staging: lustre: o2iblnd: Enable Multiple OPA Endpoints between Nodes

OPA driver optimizations are based on the MPI model where it is
expected to have multiple endpoints between two given nodes. To
enable this optimization for Lustre, we need to make it possible,
via an LND-specific tuneable, to create multiple endpoints and to
balance the traffic over them.

Both sides of a connection must have this patch for it to work.
Only the active side of the connection (usually the client)
needs to have the new tuneable set > 1.

Signed-off-by: Doug Oucharek <doug.s.oucharek@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8943
Reviewed-on: https://review.whamcloud.com/25168
Reviewed-by: Amir Shehata <amir.shehata@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Doug Oucharek <dougso@me.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: ks7010: Remove unnecessary limit checks
Nathan Chancellor [Sun, 6 May 2018 22:03:00 +0000 (15:03 -0700)]
staging: ks7010: Remove unnecessary limit checks

uwrq is an unsigned 32-bit integer, it cannot be less than zero.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: remove local variable
Christian Gromm [Tue, 8 May 2018 09:45:16 +0000 (11:45 +0200)]
staging: most: usb: remove local variable

This patch removes the local variable dev that is used to store the pointer
to the usb_device whenever it is used only once.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: fix usb_disconnect race condition
Christian Gromm [Tue, 8 May 2018 09:45:15 +0000 (11:45 +0200)]
staging: most: usb: fix usb_disconnect race condition

The functions usb_disconnect and usb_sndbulkpipe are racing for the struct
usb_device, which might cause a null pointer dereference exception. This
patch fixes this race condition by protecting the critical section inside
the function hdm_enque with the io_mutex.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data
Christian Gromm [Tue, 8 May 2018 09:45:14 +0000 (11:45 +0200)]
staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data

This patch avoids setting the URB_ZERO_PACKET transfer flag for synchronous
data. This is needed to prevent the host from sending an empty packet when
data is aligned to an endpoint packet boundary.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: use device to allocate coherent memory
Christian Gromm [Tue, 8 May 2018 09:45:13 +0000 (11:45 +0200)]
staging: most: dim2: use device to allocate coherent memory

On several architectures the allocation of coherent memory needs a device
that has the dma_ops structure properly initialized. This patch enables
the DIM2 platform to be used to allocate this type of memory.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: read clock speed from the device
Christian Gromm [Tue, 8 May 2018 09:45:12 +0000 (11:45 +0200)]
staging: most: dim2: read clock speed from the device

This patch implemets reading of the clock speed from DT.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: use device tree
Christian Gromm [Tue, 8 May 2018 09:45:11 +0000 (11:45 +0200)]
staging: most: dim2: use device tree

This patch removes the dependency to platform specific source files
that do platform specific initialization and supply the IRQ number.
Instead DT code is added

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix race condition
Christian Gromm [Tue, 8 May 2018 09:45:10 +0000 (11:45 +0200)]
staging: most: cdev: fix race condition

This patch fixes a race condition between the functions disconnect and poll.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: fix startup sequence
Christian Gromm [Tue, 8 May 2018 09:45:09 +0000 (11:45 +0200)]
staging: most: dim2: fix startup sequence

Platform specific initialization (data->init) has to be done before
calling dim_startup to start the DIM2 IP.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix function return value
Christian Gromm [Tue, 8 May 2018 09:45:08 +0000 (11:45 +0200)]
staging: most: cdev: fix function return value

The function ch_get_mbo declares its return value as type bool,
but returns a pointer to mbo.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: usb: add ep number to log
Christian Gromm [Tue, 8 May 2018 09:45:07 +0000 (11:45 +0200)]
staging: most: usb: add ep number to log

This patch adds the endpoint number of the USB pipe that reports to be
broken into the log message. It is needed to make debugging for
applications more comfortable.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: fix chrdev_region leak
Christian Gromm [Tue, 8 May 2018 09:45:06 +0000 (11:45 +0200)]
staging: most: cdev: fix chrdev_region leak

The function unregister_chrdev_region is called with a different counter
as the alloc_chrdev_region. To fix this, this patch introduces the
constant CHRDEV_REGION_SIZE that is used in both functions.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: cdev: avoid warning about potentially uninitialized variable
Christian Gromm [Tue, 8 May 2018 09:45:05 +0000 (11:45 +0200)]
staging: most: cdev: avoid warning about potentially uninitialized variable

This patch avoids the warning that the pointer mbo might be used
uninitialized that some environmens throw.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: sound: call snd_card_new with struct device
Christian Gromm [Tue, 8 May 2018 09:45:04 +0000 (11:45 +0200)]
staging: most: sound: call snd_card_new with struct device

This patch is needed as function snd_card_new needs a valid
parent device. Passing a NULL pointer leads to kernel Ooops.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: make interface drivers allocate coherent memory
Christian Gromm [Tue, 8 May 2018 09:45:03 +0000 (11:45 +0200)]
staging: most: make interface drivers allocate coherent memory

On arm64/aarch64 architectures the allocation of coherent memory needs a
device that has the dma_ops properly set. That's why the core module of
the MOST driver is no longer able to allocate this type or memory. This
patch moves the allocation process down to the interface drivers where
the proper devices exist (e.g. platform device or USB system software).

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: reduce parameters inconsistency
Christian Gromm [Tue, 8 May 2018 09:45:02 +0000 (11:45 +0200)]
staging: most: i2c: reduce parameters inconsistency

Currently, there are two module parameters for the i2c driver:
  - polling_req: boolean irq/polling mode;
  - scan_rate: polling rate, that is used in the case where the polling
    mode is active

This model is misconfiguration-prone.  For example, it is possible to
select polling mode with the zero polling rate or configure non-zero
polling rate in a combination with the IRQ mode.

This patch replaces the 'polling_req' and 'scan_rate' by the
'polling_rate', where the value zero means the interrupt driven mode and
other values are used as the polling rate in the polling mode.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: remove redundant list_mutex
Christian Gromm [Tue, 8 May 2018 09:45:01 +0000 (11:45 +0200)]
staging: most: i2c: remove redundant list_mutex

The elements of the dev->rx.list are consumed in the pending_rx_work and
populated in the function enqueue() that cancels the pending_rx_work.

The function enqueue() and poison_channel() do not race anyway.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: remove redundant is_open
Christian Gromm [Tue, 8 May 2018 09:45:00 +0000 (11:45 +0200)]
staging: most: i2c: remove redundant is_open

The variable is_open is checked only in the work function
pending_rx_work() that is only active between the calls
configure_channel() and poison_channel().

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: trace real polling rate
Christian Gromm [Tue, 8 May 2018 09:44:59 +0000 (11:44 +0200)]
staging: most: i2c: trace real polling rate

The real polling rate depends on the CONFIG_HZ and may differ from the
required polling rate.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: prevent zero delay polling
Christian Gromm [Tue, 8 May 2018 09:44:58 +0000 (11:44 +0200)]
staging: most: i2c: prevent zero delay polling

This patch avoids that a configured scan_rate of more than MSEC_PER_SEC
might result in a polling delay of zero.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: avoid polling in case of misconfig
Christian Gromm [Tue, 8 May 2018 09:44:57 +0000 (11:44 +0200)]
staging: most: i2c: avoid polling in case of misconfig

This patch prevents the driver from falling back to polling mode
in case of IRQ misconfiguration.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: do not wait in work function
Christian Gromm [Tue, 8 May 2018 09:44:56 +0000 (11:44 +0200)]
staging: most: i2c: do not wait in work function

This patch removes the function wait_event_interruptible from the
work function to avoid waiting.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: shorten lifetime of IRQ handler
Christian Gromm [Tue, 8 May 2018 09:44:55 +0000 (11:44 +0200)]
staging: most: i2c: shorten lifetime of IRQ handler

Currently the IRQ handler used for the rx channel lives between the
functions i2c_probe and i2c_remove. This patch shortens the lifetime
and keeps the handler alive only between the functions configure_channel
and poison_channel.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: aim-sound: add flexible format support
Christian Gromm [Tue, 8 May 2018 09:44:54 +0000 (11:44 +0200)]
staging: most: aim-sound: add flexible format support

Currently, the only supported PCM formats are 1x8", "2x16", "2x24",
"2x32" or "6x16".

This adds support for the format "Nx{8,16,24,32}" that also includes the
exotic PCM formats like "4x16", "5x8", etc.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: add channel property dbr_size
Christian Gromm [Tue, 8 May 2018 09:44:53 +0000 (11:44 +0200)]
staging: most: add channel property dbr_size

This patch adds the channel property dbr_size to control the corresponding
buffer size of the channels of the DIM2 interface.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: remove unnecessary poison_channel call
Christian Gromm [Tue, 8 May 2018 09:44:52 +0000 (11:44 +0200)]
staging: most: i2c: remove unnecessary poison_channel call

This removes call of the poison_channel that is:
  - not allowed after most_deregister_interface;
  - is made during the most_deregister_interface call.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: i2c: prevent division by zero
Christian Gromm [Tue, 8 May 2018 09:44:51 +0000 (11:44 +0200)]
staging: most: i2c: prevent division by zero

This prevents division by zero scan_rate.

The zero scan_rate does not need any special action as it actually means
"never poll again".

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: dim2: remove clock speed processing from the HDM
Christian Gromm [Tue, 8 May 2018 09:44:50 +0000 (11:44 +0200)]
staging: most: dim2: remove clock speed processing from the HDM

This removes the module parameter clock_speed from the HDM code.

Instead, the platform-dependent clock speed must be delivered by the
platform driver with the help of the dim2_platform_data.clk_speed.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: most: allocate only all requested memory
Christian Gromm [Tue, 8 May 2018 09:44:49 +0000 (11:44 +0200)]
staging: most: allocate only all requested memory

This prohibits the allocation of the memory for the MBOs if only the
part of the MBOs, requested by the application, may be allocated.  The
function arm_mbo_chain, if cannot allocate all requested MBO, frees all
prior allocated memory and returns 0.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: ion: Remove unnecessary blank line
Nathan Chancellor [Mon, 7 May 2018 01:18:54 +0000 (18:18 -0700)]
staging: android: ion: Remove unnecessary blank line

Fixes a checkpatch.pl warning.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: ion: Fix license identifier comment format
Nathan Chancellor [Mon, 7 May 2018 01:18:53 +0000 (18:18 -0700)]
staging: android: ion: Fix license identifier comment format

checkpatch.pl complains these are invalid because the rules in
Documentation/process/license-rules.rst state that C headers should
have "/* */" style comments.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: vsoc: Fix ending '(' warnings in vsoc_probe_device
Nathan Chancellor [Mon, 7 May 2018 01:13:28 +0000 (18:13 -0700)]
staging: android: vsoc: Fix ending '(' warnings in vsoc_probe_device

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: vsoc: Fix ending '(' warnings in vsoc_ioctl
Nathan Chancellor [Mon, 7 May 2018 01:13:27 +0000 (18:13 -0700)]
staging: android: vsoc: Fix ending '(' warnings in vsoc_ioctl

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: vsoc: Fix ending '(' warnings in do_destroy_fd_scoped_permission
Nathan Chancellor [Mon, 7 May 2018 01:13:26 +0000 (18:13 -0700)]
staging: android: vsoc: Fix ending '(' warnings in do_destroy_fd_scoped_permission

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: vsoc: Fix ending '(' warnings in function defintions
Nathan Chancellor [Mon, 7 May 2018 01:13:25 +0000 (18:13 -0700)]
staging: android: vsoc: Fix ending '(' warnings in function defintions

Fixes checkpatch.pl warnings about lines ending with parentheses.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: Clean up license identifiers
Nathan Chancellor [Mon, 7 May 2018 01:13:24 +0000 (18:13 -0700)]
staging: android: Clean up license identifiers

Add the identifiers when missing and fix the ones already present
according to checkpatch.pl.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: android: Kconfig; Remove excessive hyphens
Nathan Chancellor [Mon, 7 May 2018 01:13:23 +0000 (18:13 -0700)]
staging: android: Kconfig; Remove excessive hyphens

Fixes the following checkpatch.pl warning:
"prefer 'help' over '---help---' for new help texts"

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fix error deref in ll_splice_alias().
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: fix error deref in ll_splice_alias().

d_splice_alias() can return an ERR_PTR().
If it does while debugging is enabled, the following
CDEBUG() will dereference that error and crash.

So add appropriate checking, and provide a separate
debug message for the error case.

Reported-and-tested-by: James Simmons <jsimmons@infradead.org>
Fixes: e9d4f0b9f559 ("staging: lustre: llite: use d_splice_alias for directories.")
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move remaining code from linux-module.c to module.c
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: move remaining code from linux-module.c to module.c

There is no longer any need to keep this code separate,
and now we can remove linux-module.c

Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: move misc-device registration closer to related code.
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: move misc-device registration closer to related code.

The ioctl handler for the misc device is in  lnet/libcfs/module.c
but is it registered in lnet/libcfs/linux/linux-module.c.

Keeping related code together make maintenance easier, so move the
code.

Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: remove redundant lookup in dump_pgcache
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: llite: remove redundant lookup in dump_pgcache

Both the 'next' and the 'show' functions for the dump_page_cache
seqfile perform a lookup based on the current file index.  This is
needless duplication.

The reason appears to be that the state that needs to be communicated
from "next" to "show" is two pointers, but seq_file only provides for
a single pointer to be returned from next and passed to show.

So make use of the new 'seq_private' structure to store the extra
pointer.
So when 'next' (or 'start') find something, it returns the page and
stores the clob in the private area.
'show' accepts the page as an argument, and finds the clob where it
was stored.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: llite: use more private data in dump_pgcache
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: llite: use more private data in dump_pgcache

The dump_page_cache debugfs file allocates and frees an 'env' in each
call to vvp_pgcache_start,next,show.  This is likely to be fast, but
does introduce the need to check for errors.

It is reasonable to allocate a single 'env' when the file is opened,
and use that throughout.

So create 'seq_private' structure which stores the sbi, env, and
refcheck, and attach this to the seqfile.

Then use it throughout instead of allocating 'env' repeatedly.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: fold lu_object_new() into lu_object_find_at()
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: fold lu_object_new() into lu_object_find_at()

lu_object_new() duplicates a lot of code that is in
lu_object_find_at().
There is no real need for a separate function, it is simpler just
to skip the bits of lu_object_find_at() that we don't
want in the LOC_F_NEW case.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lu_object: move retry logic inside htable_lookup
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: lu_object: move retry logic inside htable_lookup

The current retry logic, to wait when a 'dying' object is found,
spans multiple functions.  The process is attached to a waitqueue
and set TASK_UNINTERRUPTIBLE in htable_lookup, and this status
is passed back through lu_object_find_try() to lu_object_find_at()
where schedule() is called and the process is removed from the queue.

This can be simplified by moving all the logic (including
hashtable locking) inside htable_lookup(), which now never returns
EAGAIN.

Note that htable_lookup() is called with the hash bucket lock
held, and will drop and retake it if it needs to schedule.

I made this a 'goto' loop rather than a 'while(1)' loop as the
diff is easier to read.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: lu_object: discard extra lru count.
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: lu_object: discard extra lru count.

lu_object maintains 2 lru counts.
One is a per-bucket lsb_lru_len.
The other is the per-cpu ls_lru_len_counter.

The only times the per-bucket counters are use are:
- a debug message when an object is added
- in lu_site_stats_get when all the counters are combined.

The debug message is not essential, and the per-cpu counter
can be used to get the combined total.

So discard the per-bucket lsb_lru_len.

Reviewed-by: Andreas Dilger <andreas.dilger@dilger.ca>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agostaging: lustre: make struct lu_site_bkt_data private
NeilBrown [Mon, 7 May 2018 00:54:48 +0000 (10:54 +1000)]
staging: lustre: make struct lu_site_bkt_data private

This data structure only needs to be public so that
various modules can access a wait queue to wait for object
destruction.
If we provide a function to get the wait queue, rather than the
whole bucket, the structure can be made private.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6 years agoiio: adc: stm32-adc: add support for STM32MP1
Fabrice Gasnier [Wed, 2 May 2018 07:44:50 +0000 (09:44 +0200)]
iio: adc: stm32-adc: add support for STM32MP1

Add support for STM32MP1 ADC. It's quite similar to STM32H7 ADC.
Introduce new compatible to handle variants of this hardware such as
vregready flag, trigger list, interrupts, clock rate.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agodt-bindings: iio: stm32-adc: add support for STM32MP1
Fabrice Gasnier [Wed, 2 May 2018 07:44:49 +0000 (09:44 +0200)]
dt-bindings: iio: stm32-adc: add support for STM32MP1

Document support for STM32MP1 ADC. It's quite similar to STM32H7 ADC.
Introduce "st,stm32mp1-adc" compatible to handle variants of this
hardware such as vregready flag, interrupts, clock rate.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
6 years agoiio: iio.h: use nested struct support on kernel-doc markup
Mauro Carvalho Chehab [Mon, 7 May 2018 09:35:51 +0000 (06:35 -0300)]
iio: iio.h: use nested struct support on kernel-doc markup

Solve those Sphinx warnings:

    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.sign' not described in 'iio_chan_spec'
    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.realbits' not described in 'iio_chan_spec'
    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.storagebits' not described in 'iio_chan_spec'
    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.shift' not described in 'iio_chan_spec'
    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.repeat' not described in 'iio_chan_spec'
    ./include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.endianness' not described in 'iio_chan_spec'

    ./include/linux/iio/iio.h:191: WARNING: Unexpected indentation.
    ./include/linux/iio/iio.h:192: WARNING: Block quote ends without a blank line; unexpected unindent.
    ./include/linux/iio/iio.h:198: WARNING: Definition list ends without a blank line; unexpected unindent.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>