libata: do not limit R-Car SATA driver to shmobile

The motivation for this is to allow the driver to be
used with the r8a7790 SoC.

I believe that rather than adding another SoC to the list of allowed SoCs
it is better to simply remove the dependency of the driver on shmobile all
together.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from commit 5c23341ff66c9280c2e76dc9795cd14497ea780f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
i2c: rcar: add compatible entry for r8a7791

While we are here, also brush up the devicetree binding documentation.
The example was an inappropriate copy from the sh_mobile driver.

Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit e89364556824cc7a947f99173af842217074c099)
(Queued by Wolfram Sang for mainline but not yet in Linus's tree)
(Queued by Wolfram Sang for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Add SDHI devices to r8a7791 DTSI

Add SDHI0, SDHI1 and SDHI2 to the r8a7791 DTSI.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b7ed8a0dd4f1d41464c3ab050c3688c4a7fc15b3)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Add SDHI devices for Koelsch DTS

Add DT support for SDHI0, SDHI1 and SDHI2 on Koelsch.

The board specific handling of CD and WP pins are
using GPIOs. SDHI0 and SDHI1 are hooked up to regular
SD connectors while SDHI2 is using micro-SD which
is lacking WP signal.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2c60a7df72711fb8b4be1e6aa651ab166a8931bc)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Move SYSC base variable to inside ifdefs

Move the rcar_sysc_base variable to inside #ifdefs to avoid
triggering build warnings in case PM or SMP is not selected.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit c4ca5d80e03559fd95c526ece5ce39fc732a2511)
(Queued by Simon Horman for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: sh-msiof: Fix SPI bus population from DT

DT doesn't instantiate SPI children if spi_master.dev.of_node is not set up
properly.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f7c05e837df794d2aaf19174269a270c93a52eca)
(Queued by Mark Brown for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: sh-msiof: Typo in comment s/tx/rx/

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit a669c11a0df07477afbfeb53bc9d8fc989d1ed59)
(Queued by Mark Brown for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: sh-msiof: Change hz from unsigned long to u32

Both spi_transfer.speed_hz and spi_master.max_speed_hz are u32

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 6a85fc5af1f09982e50abe56efc70eda9ad24632)
(Queued by Mark Brown for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: sh-msiof: Add more register documentation

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 01cfef57efe9c8ef445d4a5ad3bf26770fd5942a)
(Queued by Mark Brown for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: sh-msiof: Use the core cs_gpio field, and make it optional

In current implementation, CS is controlled by GPIO, which is passed
through spi->controller_data.  However, the MSIOF HW module has a function
to output CS by itself, which is already enabled and actual switch will be
done by pinmux.

Store the GPIO number in the core cs_gpio field, and ignore it if it is
an invalid (negative) GPIO number.

Loosely based on a patch from Takashi Yoshii <takasi-y@ops.dti.ne.jp>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 8d19534a8d539bb2e598e56e017a423f205e909e)
(Queued by Mark Brown for mainline but not yet in Linus's tree)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: Add media format codes for AHSV8888 on 32-bit busses

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 7e941a7999fe5ece856c066ba94c929870e30fe0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Supply frames to the DU continuously

When operating in DU output mode (deep pipeline to the DU through the
LIF), the VSP1 needs to constantly supply frames to the display. To
ensure reuse the last queued buffer instead of returning it to the user.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 3299ba5c0b213be5d911752d40251c1abc1004f7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Add cropping support

Implement the get and set selection operations on the RPF and WPF
entities. Only the crop targets are currently available.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit e5ad37b64de975463c51f9ed4e4c55dc6e442ba5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Add HST and HSI support

The Hue Saturation value Transform and Hue Saturation value Inverse
transform entities convert from RGB to HSV and back.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 5cdf5741d6529f3c04dcd117b4c9b9039d101602)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Add SRU support

The Super Resolution Unit performs super resolution processing with
optional upscaling by a factor of two.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit a626e64e0bee4fb26848dbed92223dde488f3d93)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Add LUT support

The Look-Up Table looks up values in 8-bit indexed tables separately for
each color component.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit 989af88339db26345e23271dae1089d949c4a0f1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[media] v4l: vsp1: Fix error return code in vsp1_video_init()

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
(cherry picked from commit b317828beec632791a440a677de5116ab9bd900a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
spi: conditional checking of mode and transfer bits.

There is a bug in the following patch:
http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420

spi: DUAL and QUAD support

    fix the previous patch some mistake below:
    1. DT in slave node, use "spi-tx-nbits = <1/2/4>" in place of using
       "spi-tx-dual, spi-tx-quad" directly, same to rx. So correct the
       previous way to get the property in @of_register_spi_devices().
    2. Change the value of transfer bit macro(SPI_NBITS_SINGLE, SPI_NBITS_DUAL
       SPI_NBITS_QUAD) to 0x01, 0x02 and 0x04 to match the actual wires.
    3. Add the following check
       (1)keep the tx_nbits and rx_nbits in spi_transfer is not beyond the
          single, dual and quad.
       (2)keep tx_nbits and rx_nbits are contained by @spi_device->mode
          example: if @spi_device->mode = DUAL, then tx/rx_nbits can not be set
                   to QUAD(SPI_NBITS_QUAD)
       (3)if "@spi_device->mode & SPI_3WIRE", then tx/rx_nbits should be in
          single(SPI_NBITS_SINGLE)

Checking of the tx/rx transfer bits and mode bits should be done conditionally
based on type of buffer filled else EINVAL condition will
always get hit either for rx or tx.

Signed-off-by: Sourav Poddar <sourav.poddar@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit db90a44177ac39fc22b2da5235b231fccdd4c673)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
sh-pfc: r8a7791: Fix DU pin groups organisation

Rename the sync_1 group to sync as the device has a single sync pin
group for the DU, move the cde_disp mux array right after the
corresponding pins array, and split the clk_in pins in three separate
groups as the pins can be used independently.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit bc41f9f138bd93b82b08f84ca55b7da2acb847b3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
sh-pfc: Fix PINMUX_GPIO macro

Commit 7cbb0e55e27e ("sh-pfc: Don't duplicate argument to PINMUX_GPIO
macro") erronesouly modified the PINMUX_GPIO macro in a way that
resulted in all pins being named "name". Fix the macro to name the pins
correctly.

Cc: stable@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 8620f394c4f9abd13e4fdf927d9c2bbeda74cde7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>