gpio: rcar: Add subsys_initcall for early timing startup

This patch changes subsys_initcall from module_platform_driver
in order to start a GPIO driver early.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: fb_helper: Fix return value of drm_fb_helper_is_bound

drm_fb_helper_is_bound should not judge false when the frame
buffer which is set to each CRTCs differs in R-Car driver.
This patch corrects so that true may always be returned in
R-Car driver.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: rcar-du: Fix dot clock selection method

The value of mode->clock may turn into an unexpected value
when EDID is not able to read or EDID is injustice.
In that case, the value of div_ex may be set to 0 and may
do division by 0. This problem is resolved with this patch.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: rcar-du: Fix byte alignment check for pitch

This patch corrects the byte alignment check for pitch when
creating a frame buffer object. The alignment value in case
of using separation format (NV16, NV12 and NV21) is corrected
to the right value.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: rcar-du: Fix setup of LVDS output ON

Since a setup of LVDS output ON is set up twice, this patch corrects
so that it is set up only once.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: rcar-du: Fix redundant reset of Display Unit

When reflecting a value in DEFR8 register, it is necessary to
perform DRES (Display Reset). Even if the value of DEFR8 register
is not changed, the current code has executed DRES. Therefore,
when DEFR8 register was always set up, the screen had disappeared
for a moment. This patch does not execute DRES, when not changing
DEFR8 register. Moreover, bit write restriction in DEFR8 register
is added for every devices.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Revert "media: soc_camera: rcar_vin: Enable VSYNC field toggle mode"

In case of interlaced input, it is not necessary to perform a setup
of this patch for the specification of H/W.

This reverts commit 69dd3fdb41ba779698fd589c307d940d75103c6a.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
drm: gem-cma: Fix warnings due to improper printk formats

Use the %pad printk specifier to print dma_addr_t variables. This fixes
warnings on platforms where dma_addr_t has a different size than int or
size_t.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
xhci: quirk for extra long delay for S4

This patch is backported from 455f58925247e8a1a1941e159f3636ad6ee4c90b
in the upstream.
However, this patch doesn't include the modification of xhci-pci.c.

From Oliver Neukum <oneukum@suse.de>

It has been reported that this chipset really cannot
sleep without this extraordinary delay.

This patch should be backported, in order to ensure this host functions
under stable kernels.  The last quirk for Fresco Logic hosts (commit
bba18e33f25072ebf70fd8f7f0cdbf8cdb59a746 "xhci: Extend Fresco Logic MSI
quirk.") was backported to stable kernels as old as 2.6.36.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
usb: host: xhci-plat: fix suspend/resume on xhci-rcar

This patch fixes an issue that suspend/resume cannot work correctly
on xhci-rcar because the xhci driver output the following log:

	xhci-hcd ee000000.usb: WARN: xHC CMD_RUN timeout

So, this patch adds to set the XHCI_SLOW_SUSPEND quirk if xhci-rcar.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
phy: rcar-gen2: add the suspend/resume

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
usb: renesas_usbhs: Add dmaengine status check and repair in xfer_work()

This patch fixes an issue that renesas_usbhs may not be able to start
the transfer when renesas_usbhs used shdma-base driver and f_mtp gadget
driver.

If a renesas_usbhs has a callback, __ld_cleanup() will call
the callback before shdma-base driver removes the list.
After the callback, since the return value of __ld_cleanup()
is not zero, shdma_chan_ld_cleanup() calls __ld_cleanup() again.
And, __ld_cleanup() will removes the list.

At this time, if a renesas_usbhs calls dmaengine_submit() before
shdma-base driver removes the list, shdma-base driver will set
schan->pm_state to SHDMA_PM_PENDING in shdma_tx_submit(). And then,
even if renesas_usbhs calls dma_async_issue_pending(), shdma-base
driver don't start the transfer because the schan->pm_state is
SHDMA_PM_PENDING in shdma_issue_pending().

So, this patch adds dma_async_is_tx_complete() before renesas_usbhs
calls dmaengine_submit() in xfer_work(). Since
dma_async_is_tx_complete() calls shdma_chan_ld_cleanup(),
shdma-base driver don't start the transfer is avoided.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
usb: phy: rcar-gen2: Add member gpio_vbus and wakeup

This patch adds gpio_vbus and wakeup which are member of
rcar_gen2_phy_platform_data structure to detect vbus by gpio.
When gpio_vbus is not 0, gpio_vbus is used as a vbus sensing.
When wakeup is true, gpio_vbus is used as a wakeup source.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
usb: phy: rcar-gen2: Add vbus detection by gpio_vbus

usb_gadget_vbus_connect() and usb_gadget_vbus_disconnect()
are called when detecting vbus from gpio.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
usb: renesas_usbhs: Remove static specifier for mod_gadget use

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
usb: renesas_usbhs: gadget: Add vbus_session

This patch adds vbus_session of usb_gadget_ops.
Power On/Off by usb_gadget_vbus_connect()/usb_gadget_vbus_disconnect()
can be perfomed.

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
ARM: shmobile: koelsch-reference: Add gpio_vbus and wakeup for usb vbus detection

This patch adds gpio_vbus and wakeup for usb vbus detection.
The value of gpio_vbus is USB0_OVC(GP-7-24).

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
ARM: shmobile: koelsch-reference: Move usbhs clock to clk_names from clk_enables

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
ARM: shmobile: koelsch-reference: Add usbhs_get_vbus to avoid usbhs_mod_autonomy_mode

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
ARM: shmobile: alt-reference: Add gpio_vbus and wakeup for usb vbus detection

This patch adds gpio_vbus and wakeup for usb vbus detection.
The value of gpio_vbus is USB0_OVC(GP-5-25).

Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>