platform/adaptation/renesas_rcar/renesas_kernel.git
9 years agoARM: shmobile: koelsch: enable HS-USB
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:45:07 +0000 (19:45 +0900)]
ARM: shmobile: koelsch: enable HS-USB

Enable HS-USB device for the Koelsch board, defining the GPIO that the driver
should check when probing (which is the ID output from MAX3355 OTG chip).

Note that there will be pinctrl-related error messages if both internal PCI
and HS-USB drivers are enabled but they should be just ignored.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Sergei: added pin function/group and prop, moved device node, fixed summary,
added changelog]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit fc4a00b78c7f8a770b9608164c0c9cdd0e4e68c2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: add HS-USB device node
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:45:06 +0000 (19:45 +0900)]
ARM: shmobile: r8a7791: add HS-USB device node

Define the R8A7791 generic part of the HS-USB device node. It is up to the board
file to enable the device.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Sergei: fixed summary, added changelog]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1c1fee7cbba99023a11d4d2991b56c99a3174bd4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager: enable HS-USB
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:44:34 +0000 (19:44 +0900)]
ARM: shmobile: lager: enable HS-USB

Enable HS-USB device for the Lager board, defining the GPIO that the driver
should check when probing. Since this board doesn't have the OTG ID pin, we
assume that GP5_18 (USB0_PWEN) is an ID pin because it is 1 when the SW5 is
in position 2-3 (meaning USB function) and 0 in other positions.

Note that there will be pinctrl-related error messages if both internal PCI
and HS-USB drivers are enabled but they should be just ignored.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Sergei: added pin node and prop, moved device node, fixed summary, supplemented
changelog]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e03074a7b5fdd2834a9fbbe77bc52a1ddb0d017f)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: add HS-USB device node
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:44:33 +0000 (19:44 +0900)]
ARM: shmobile: r8a7790: add HS-USB device node

Define the R8A7790 generic part of the HS-USB device node.
It is up to the board file to enable the device.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
[Sergei: fixed summary, added changelog]
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ae0a555b68ae4feef07e919b22ef2e0b792616ee)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: add USB3.0 device node
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:43:02 +0000 (19:43 +0900)]
ARM: shmobile: r8a7791: add USB3.0 device node

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit c196931ece017a0aeeef4ee6d4fbb5adeb7dfd0a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager: enable USB3.0
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:41:47 +0000 (19:41 +0900)]
ARM: shmobile: lager: enable USB3.0

Since the PHY of USB3.0 and EHCI/OHCI ch2 are the same, the USB3.0
driver cannot use the phy driver when the EHCI/OHCI ch2 already used it:

phy phy-e6590100.usb-phy.3: phy init failed --> -16
xhci-hcd: probe of ee000000.usb failed with error -16

If so, we have to unbind the EHCI/OHCI ch2, and then we have to bind
the USB3.0 driver as the following:

  echo 0000:02:02.0 > /sys/bus/pci/drivers/ehci-pci/unbind
  echo 0000:02:01.0 > /sys/bus/pci/drivers/ohci-pci/unbind
  echo ee000000.usb > /sys/bus/platform/drivers/xhci-hcd/bind

Note that there will be pinctrl-related error messages if both
internal PCI and USB3.0 are enabled but they should be just ignored:

sh-pfc e6060000.pfc: pin GP_5_22 already requested by ee0d0000.pci; cannot claim for ee000000.usb
sh-pfc e6060000.pfc: pin-182 (ee000000.usb) status -22
ata1: SATA link down (SStatus 0 SControl 300)
sh-pfc e6060000.pfc: could not request pin 182 (GP_5_22) from group usb2  on device sh-pfc

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 37f7c1b0c1ed9465b2e2609ba57bba8a874ddd3c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: add USB3.0 device node
Yoshihiro Shimoda [Fri, 24 Oct 2014 10:41:46 +0000 (19:41 +0900)]
ARM: shmobile: r8a7790: add USB3.0 device node

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 157fcd8a3e6fb46ad99b615838afe16e8fcebd61)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7794: Add arch_timer to device tree
Hisashi Nakamura [Fri, 12 Sep 2014 08:52:06 +0000 (10:52 +0200)]
ARM: shmobile: r8a7794: Add arch_timer to device tree

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit da33648c4296a8590fbeafd7c1ae4494dfe8b04c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: bockw-reference: Initialise TMU device using DT
Simon Horman [Mon, 7 Jul 2014 07:54:31 +0000 (09:54 +0200)]
ARM: shmobile: bockw-reference: Initialise TMU device using DT

Initialise TMU device using DT when booting bockw
using DT-reference.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 18b27aeb5591588de35628bf1e423abf24fe9695)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7778: Add TMU nodes
Simon Horman [Mon, 7 Jul 2014 07:54:30 +0000 (09:54 +0200)]
ARM: shmobile: r8a7778: Add TMU nodes

This describes all of the TMU hardware of the r8a7778.
Each node is disabled and may be enabled as necessary
by board DTS files.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2109b5a28d27a593ab5afa7179fbef2f6a7cabcd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: armadillo800eva dts: Enable TMU0
Geert Uytterhoeven [Wed, 22 Oct 2014 09:38:29 +0000 (11:38 +0200)]
ARM: shmobile: armadillo800eva dts: Enable TMU0

ch0 will be used for clock events and for periodic clock events,
ch1 will be used as clock source.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit df211020718a7cbad0a8018c924ba7dd002f7282)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740 dtsi: Add TMU0 and TMU1 device nodes
Geert Uytterhoeven [Wed, 22 Oct 2014 09:38:28 +0000 (11:38 +0200)]
ARM: shmobile: r8a7740 dtsi: Add TMU0 and TMU1 device nodes

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 600363334de89169a8dbbb1db874777d46fc239e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: Add MMP clock to device tree
Yoshifumi Hosoya [Tue, 14 Oct 2014 07:01:43 +0000 (16:01 +0900)]
ARM: shmobile: r8a7791: Add MMP clock to device tree

Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 74d89d25f6b0d84f7cd2fc09dc708177787c1465)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: Add MMP clock to device tree
Yoshifumi Hosoya [Tue, 14 Oct 2014 07:01:42 +0000 (16:01 +0900)]
ARM: shmobile: r8a7790: Add MMP clock to device tree

Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4ba8f2468ce346642b4ace3cdf4bdd8d29175011)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: Add SGX clock to device tree
Kouei Abe [Tue, 14 Oct 2014 07:01:41 +0000 (16:01 +0900)]
ARM: shmobile: r8a7791: Add SGX clock to device tree

Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e4d2fd9eb43d12e9b6a7ab842bf6986b4dd75a1d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: Add RGX clock to device tree
Kouei Abe [Tue, 14 Oct 2014 07:01:40 +0000 (16:01 +0900)]
ARM: shmobile: r8a7790: Add RGX clock to device tree

Signed-off-by: Kouei Abe <kouei.abe.cp@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2284ff5f3f7d58e33812f4387c2ac8a09428e4cf)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740 dtsi: Fix clock index for scifa2
Geert Uytterhoeven [Thu, 2 Oct 2014 18:42:29 +0000 (20:42 +0200)]
ARM: shmobile: r8a7740 dtsi: Fix clock index for scifa2

The clocks property for the scifa2 device node referred to the scifa0
clock index instead of the scifa2 clock index.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b345aee4d7c2387f2e36cdeb64e0f4dce34598f3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: switch from scif to scifa
Wolfram Sang [Tue, 16 Sep 2014 16:10:37 +0000 (18:10 +0200)]
ARM: shmobile: r8a7790: switch from scif to scifa

SCIF and SCIFA can be plexed onto the same wires on Lager board. The
datasheet also describes the wires as SCIFA. So, to make use of the
bigger FIFOs switch to SCIFA instead.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 7c05589413fa9902f2843e91845d6084f6f8e2cd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
arch/arm/boot/dts/r8a7790-lager.dts

9 years agoARM: shmobile: r8a7791: link PCI USB devices to USB PHY
Sergei Shtylyov [Mon, 29 Sep 2014 18:23:11 +0000 (22:23 +0400)]
ARM: shmobile: r8a7791: link PCI USB devices to USB PHY

Describe the PCI USB devices that are behind the PCI bridges, adding necessary
links to the USB PHY device.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e1bce1249d15b27c56790ab0ecea4a49dcd0e081)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: link PCI USB devices to USB PHY
Sergei Shtylyov [Mon, 29 Sep 2014 18:21:59 +0000 (22:21 +0400)]
ARM: shmobile: r8a7790: link PCI USB devices to USB PHY

Describe the PCI USB devices that are behind the PCI bridges, adding necessary
links to the USB PHY device.

Based on the original work by Ben Dooks <ben.dooks@codethink.co.uk>.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 538c40e52df32285aa9440995c7345ea1c4d83b4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: henninger: enable USB PHY
Sergei Shtylyov [Fri, 26 Sep 2014 21:10:46 +0000 (01:10 +0400)]
ARM: shmobile: henninger: enable USB PHY

Enable USB PHY device for the Henninger board.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit fa03f6b243cb29698fe6a2687ac1d8fa9d4da2b8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: koelsch: enable USB PHY
Sergei Shtylyov [Fri, 26 Sep 2014 21:09:22 +0000 (01:09 +0400)]
ARM: shmobile: koelsch: enable USB PHY

Enable USB PHY device for the Koelsch board.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit dc80d8bcac7c2eb0421b19cb7c2e297fbaf76da7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: add USB PHY DT support
Sergei Shtylyov [Fri, 26 Sep 2014 21:08:12 +0000 (01:08 +0400)]
ARM: shmobile: r8a7791: add USB PHY DT support

Define the R8A7791 generic part of the USB PHY device node. It is up to the
board file to enable the device.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3b7e530d28db276b596251bbd435a058e27810f1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager: enable USB PHY
Sergei Shtylyov [Fri, 26 Sep 2014 21:01:35 +0000 (01:01 +0400)]
ARM: shmobile: lager: enable USB PHY

Enable USB PHY device for the Lager board.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6742cafb6fe84f00f096b206372b48f14eb56946)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: add USB PHY DT support
Sergei Shtylyov [Fri, 26 Sep 2014 21:00:20 +0000 (01:00 +0400)]
ARM: shmobile: r8a7790: add USB PHY DT support

Define the R8A7790 generic part of the USB PHY device node. It is up to the
board file to enable the device.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e089f6578ff96243e31ad6257d7c9f4c8a447107)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740 dtsi: Add missing INTCA clock for irqpin module
Geert Uytterhoeven [Fri, 12 Sep 2014 13:15:20 +0000 (15:15 +0200)]
ARM: shmobile: r8a7740 dtsi: Add missing INTCA clock for irqpin module

This clock drives the INTCA irqpin controller modules.
Before, it was assumed enabled by the bootloader or reset state.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: devicetree@vger.kernel.org
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3ab84ee95ba4e28b30fd8ec7c38f5e9f72c4b4b7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: marzen-reference: Don't include legacy clock.h
Laurent Pinchart [Sun, 26 Oct 2014 13:06:29 +0000 (15:06 +0200)]
ARM: shmobile: marzen-reference: Don't include legacy clock.h

The marzen-reference board file doesn't need the clock.h header, don't
include it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 803fc9b590f74ef1066be328f2f33c2b285ca3af)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: koelsch: Enable DU device in DT
Laurent Pinchart [Tue, 21 Jan 2014 15:02:54 +0000 (16:02 +0100)]
ARM: shmobile: koelsch: Enable DU device in DT

Specify the DU output topology, enable the DU device and configure the
related pins.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 0ee56d403549fd97d8acac6b7ba3a17f6999c30a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: koelsch-reference: Remove DU platform device
Laurent Pinchart [Tue, 21 Jan 2014 15:01:31 +0000 (16:01 +0100)]
ARM: shmobile: koelsch-reference: Remove DU platform device

The DU device is now instantiated from the device tree, remove the
corresponding platform device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 910343e7e281c3f6ac0c660061370afa306d24d0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager: Enable DU device in DT
Laurent Pinchart [Tue, 21 Jan 2014 15:02:54 +0000 (16:02 +0100)]
ARM: shmobile: lager: Enable DU device in DT

Specify the DU output topology, enable the DU device and configure the
related pins.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3edd18ffe53e3c13820310f51109c12e45874cfd)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager-reference: Remove DU platform device
Laurent Pinchart [Tue, 21 Jan 2014 15:01:31 +0000 (16:01 +0100)]
ARM: shmobile: lager-reference: Remove DU platform device

The DU device is now instantiated from the device tree, remove the
corresponding platform device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 64d9c22154d77a448944733d1373c8c0af8e0de2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: marzen: Enable DU device in DT
Laurent Pinchart [Wed, 27 Aug 2014 09:11:45 +0000 (11:11 +0200)]
ARM: shmobile: marzen: Enable DU device in DT

Specify the DU output topology, enable the DU device and configure the
related pins.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a7aee3ac437be568e6285c10d765ec074fa19587)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: Select CONFIG_ZONE_DMA when CONFIG_ARM_LPAE is enabled
Laurent Pinchart [Thu, 23 Oct 2014 14:38:31 +0000 (17:38 +0300)]
ARM: shmobile: Select CONFIG_ZONE_DMA when CONFIG_ARM_LPAE is enabled

Most IP cores on ARM Renesas platforms can only address 32 bits of
physical memory for DMA. Without CONFIG_ZONE_DMA enabled and with the
recent CMA highmem allocation support, the default CMA zone is reserved
above the 4GiB limit when LPAE is enabled, resulting in various driver
failures.

Fix the problem by selecting CONFIG_ZONE_DMA. Other options to
investigate in the future would be to either enable IOMMU support or use
custom CMA reservations for peripherals not supporting LPAE.

While not a strict dependency, the "[PATCH 0/4] Low/high memory CMA
reservation fixes" series is also required to fix a different but related CMA
allocation problem.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3794705aeb318c431c07072f04380c78cc5a84ac)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add A3SM pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:19:01 +0000 (13:19 +0200)]
ARM: shmobile: r8a7740: Add A3SM pm domain support

Add support for the A3SM power domain, and hook it up as a subdomain of
A4S.

This domain contains the System CPU (Cortex-A9) hardware block. Hence
move the special CPU handling from A4S to A3SM.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit dc4470e177973feedd82596969d86468a1695b1e)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add A4SU pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:19:00 +0000 (13:19 +0200)]
ARM: shmobile: r8a7740: Add A4SU pm domain support

Add support for the A4SU power domain.
This domain contains the USBPHY hardware block, which is currently not
used by any driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4ee7830c3ef9224bd078abe41a33c7396f827078)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:59 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740/armadillo legacy: Add A4R pm domain support

Add support for the A4R power domain, and hook up the A3RV subdomain,
and the CEU0, TMU0, and IIC0 hardware blocks.
This domain also contains the Realtime CPU (SH-4A), Realtime CPU debug
modules, H-UDI, RT-SHwy, INTCS, RT-HPB, VIO6C, JPU, RTDMAC1/2, SSP,
MSIOF0, CMT0, ICB, DREQPAK (RT), 2DDMAC, IPMMUI, and 2DG hardware
blocks, but these are currently not used by any driver.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1618a677046b0391621708734f56886233210047)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add D4 pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:58 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740: Add D4 pm domain support

Add support for the D4 power domain.
This domain contains the Coresight-ETM hardware block.

As long as the ARM debug/perf code doesn't use resource management with
runtime PM support, the D4 power domain must be kept powered to avoid a
crash during resume from s2ram (dbg_cpu_pm_notify() calls
reset_ctrl_regs() unconditionally, causing an undefined instruction
oops).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 7e81f5434db5bbef3ac55d3f44f702566c0323c6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:57 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740/armadillo legacy: Add A4MP pm domain support

Add support for the A4MP power domain, and hook up the HDMI-Link and FSI
hardware blocks.
This domain also contains the SPU2, FMSI, and BBIF2 hardware blocks,
but these are currently not used by any driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 77192e1e25a57a519df30015b29c046bd6a769fc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add A3SG pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:56 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740: Add A3SG pm domain support

Add support for the A3SG power domain, and hook it up as a subdomain of
A4S.
This domain contains the SGX540 hardware block, which is currently not
used by any driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 92e88fd7793401dc7bc1b5cec93761e83b19b947)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add A3RV pm domain support
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:55 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740: Add A3RV pm domain support

Add support for the A3RV power domain.
This domain contains the VPU5F and VCP1 hardware blocks, which are
currently not used by any driver.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 995d925058b63f8300b20d458d941a8a1306d8fb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain devices
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:54 +0000 (13:18 +0200)]
ARM: shmobile: armadillo800eva legacy: Add missing A4S pm domain devices

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain
support") added the A4S power domain, but forgot to hook up the GbEther
hardware block.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 671c522a69fc6fa6960ada4c55bc7186f7d89a3a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: armadillo800eva legacy: Add missing A3SP pm domain devices
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:53 +0000 (13:18 +0200)]
ARM: shmobile: armadillo800eva legacy: Add missing A3SP pm domain devices

Commit 802a5639aa7041b2 ("ARM: shmobile: r8a7740: add A3SP pm domain
support") added the A3SP power domain, but forgot to hook up the TPU,
SDHI0/1, and MMCIF hardware blocks.

Note: As the default PM QoS latency constraint for SDHI is only 100 Âµs
(cfr. commit c419e611c3c59c0e ("tmio_mmc / PM: Use PM QoS latency
constraint"), while DEFAULT_DEV_LATENCY_NS is 250000, suspend fails with
-EBUSY, unless the constraint is increased first to more than 500 Âµs
using e.g.

    echo 501 > /sys/devices/platform/sh_mobile_sdhi.0/power/pm_qos_resume_latency_us

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4311d9654c66b7cc7147035b8ec74f41ddffa650)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add missing A4S pm domain devices
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:52 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740: Add missing A4S pm domain devices

Commit 8459293c27bcd13a ("ARM: shmobile: r8a7740: add A4S pm domain
support") added the A4S power domain, but forgot to hook up the INTCA
hardware block.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3b358cb8b7c73304ea2c634afc644cfad37adbdc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7740: Add missing A3SP pm domain devices
Geert Uytterhoeven [Thu, 23 Oct 2014 11:18:51 +0000 (13:18 +0200)]
ARM: shmobile: r8a7740: Add missing A3SP pm domain devices

Commit 802a5639aa7041b2 ("ARM: shmobile: r8a7740: add A3SP pm domain
support") added the A3SP power domain, but forgot to hook up the IPPMU,
DMAC0/1/2, and USBDMAC hardware blocks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 80f643b39346768878317eb04bd4b1deb4551537)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7791: Add DU node to device tree
Laurent Pinchart [Tue, 21 Jan 2014 15:00:46 +0000 (16:00 +0100)]
ARM: shmobile: r8a7791: Add DU node to device tree

Add the DU device with a disabled state. Boards that want to enable the
DU need to specify the output topology

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 8eefac2d6620642e8c44bf4acbf442c7d89f39d8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7790: Add DU node to device tree
Laurent Pinchart [Tue, 21 Jan 2014 15:00:46 +0000 (16:00 +0100)]
ARM: shmobile: r8a7790: Add DU node to device tree

Add the DU device with a disabled state. Boards that want to enable the
DU need to specify the output topology.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au: resolved minor conflict]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 3ac6a83c09cbb74ebb3d3e7e6e40e1ead3ff9d01)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7779: Add DU node to device tree
Laurent Pinchart [Tue, 21 Jan 2014 15:00:46 +0000 (16:00 +0100)]
ARM: shmobile: r8a7779: Add DU node to device tree

Add the DU device with a disabled state. Boards that want to enable the
DU need to specify the output topology

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au: resolved minor conflict]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1f08bbe8ac737a728812df88cbb3049842df7b84)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: Remove FSF address from copyright headers
Laurent Pinchart [Sun, 26 Oct 2014 14:20:27 +0000 (16:20 +0200)]
ARM: shmobile: Remove FSF address from copyright headers

The information is already included in the COPYING file in the kernel
sources root directory, we don't want to modify all source files when
the FSF will move to a new address, and I'm tired of seeing the related
checkpatch.pl warnings.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 335204dfb83b3105cf4a666d1ad024917831cbdc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: rcar-gen2: Add CA7 arch_timer initialization for r8a7794
Ulrich Hecht [Fri, 12 Sep 2014 08:52:05 +0000 (10:52 +0200)]
ARM: shmobile: rcar-gen2: Add CA7 arch_timer initialization for r8a7794

On E2, the arch timer is hooked up to a different clock, and the CA7's arch
timer CNTVOFF register must be initialized.

Based on work by Hisashi Nakamura.

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 9ce3fa6816c2fb59d128248c9b0509aef1c5dae7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: sh73a0: Remove wrapper sh73a0_init_delay()
Geert Uytterhoeven [Fri, 17 Oct 2014 12:24:39 +0000 (14:24 +0200)]
ARM: shmobile: sh73a0: Remove wrapper sh73a0_init_delay()

sh73a0_init_delay() just calls shmobile_init_delay(), hence replace
calls to it by direct calls to shmobile_init_delay().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit dac95365dc2683df55c4e221e2f669a056863307)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a7778: Remove wrapper r8a7778_init_delay()
Geert Uytterhoeven [Fri, 17 Oct 2014 12:24:38 +0000 (14:24 +0200)]
ARM: shmobile: r8a7778: Remove wrapper r8a7778_init_delay()

r8a7778_init_delay() just calls shmobile_init_delay(), hence replace
calls to it by direct calls to shmobile_init_delay().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 92ee341e0b87551ab8838116782a4f3929108136)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a73a4: Remove empty r8a73a4_add_dt_devices
Simon Horman [Mon, 7 Jul 2014 07:54:39 +0000 (09:54 +0200)]
ARM: shmobile: r8a73a4: Remove empty r8a73a4_add_dt_devices

r8a73a4_add_dt_devices() no longer enables any devices
so remove it.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit fd3edcbe9f7bf24b13cadca7616f8e10bbe7e2b3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: ape6evm-reference: Initialise CMT1 device using DT
Simon Horman [Mon, 7 Jul 2014 07:54:38 +0000 (09:54 +0200)]
ARM: shmobile: ape6evm-reference: Initialise CMT1 device using DT

Initialise CMT1 device using DT when booting ape6evm
using DT-reference.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit dfb846c95e3a7bb14f3aa61473aa4be0a8fe02ab)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a73a4: Rename cmt registration helper
Simon Horman [Mon, 7 Jul 2014 07:54:37 +0000 (09:54 +0200)]
ARM: shmobile: r8a73a4: Rename cmt registration helper

Rename r8a7790_register_cmt() as r8a73a4_register_cmt() to
reflect name of the SoC in use. The use of r8a7790 appears
to be due to historical sharing of code from that SoC.
Shared code is no longer used.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 95e39682033b9940e17108098f08745b8938ab2c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Conflicts:
arch/arm/mach-shmobile/setup-r8a73a4.c

9 years agoARM: shmobile: r8a73a4: Add CMT1 node
Simon Horman [Mon, 7 Jul 2014 07:54:36 +0000 (09:54 +0200)]
ARM: shmobile: r8a73a4: Add CMT1 node

This describes all of the CMT1 hardware of the r8a73a4.
The node is disabled and may be enabled as necessary by board DTS files.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit f7b65230019b9dacd69922f925933c8bde1f9ec2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: sh7372: Add shmobile_init_late()
Geert Uytterhoeven [Fri, 17 Oct 2014 12:22:37 +0000 (14:22 +0200)]
ARM: shmobile: sh7372: Add shmobile_init_late()

Extend sh7372 SoC machine vector to include shmobile_init_late()
so Suspend-to-RAM and CPUIdle are setup as expected.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 27c1bb20d45830a64bf344cc1cb5e0a745e2d206)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: Handle CA7 arch timer delay
Magnus Damm [Sun, 5 Oct 2014 23:59:20 +0000 (08:59 +0900)]
ARM: shmobile: Handle CA7 arch timer delay

Update the delay code to include arch timer checks
for CA7. From a arch timer availability perspective
CA7 should be treated same as CA15.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 27f3c70874fc1d114e26c807e900fec4b50b1217)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: armadillo800eva: Sort includes
Simon Horman [Mon, 11 Aug 2014 02:38:59 +0000 (11:38 +0900)]
ARM: shmobile: armadillo800eva: Sort includes

Sorted includes seems to be the done thing these days.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit f4115f25c11790646351df243dae070a7cf80163)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: kzm9d dts: Add chosen/stdout-path
Geert Uytterhoeven [Mon, 6 Oct 2014 11:59:13 +0000 (13:59 +0200)]
ARM: shmobile: kzm9d dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=ttyS1,115200n81" parameter in
chosen/bootargs, else the console will use the default setting of 9600
baud.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 120f038cf04b95dc895cba503a7516ff75561438)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: kzm9g-reference dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:44 +0000 (17:11 +0200)]
ARM: shmobile: kzm9g-reference dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.
In addition, this will allow the PM domain code to find the PM domain
for the console device.

Note that we have to keep the "console=ttySC4" parameter in
chosen/bootargs, else we only get console messages on tty0.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 59ab5bff23020b6223857a460a39b9ec71d91cea)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: alt dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:43 +0000 (17:11 +0200)]
ARM: shmobile: alt dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=ttySC0,38400" parameter in
chosen/bootargs, else the console will use the default setting of 115200
baud.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b4a0f50cc70fef466e5b9935519b8213611e75bb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: koelsch dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:42 +0000 (17:11 +0200)]
ARM: shmobile: koelsch dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=" parameter in chosen/bootargs,
as this DTS is shared between legacy and multi-platform.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 17323b3615b54bd80ba7e9056c62266e7df24f27)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: henninger dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:41 +0000 (17:11 +0200)]
ARM: shmobile: henninger dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=ttySC0,38400" parameter in
chosen/bootargs, else the console will use the default setting of 115200
baud.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 8590e2d742c1687a733a90edc25ab0178d6a66fc)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: lager dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:40 +0000 (17:11 +0200)]
ARM: shmobile: lager dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=" parameter in chosen/bootargs,
as this DTS is shared between legacy and multi-platform.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit cf8558160747694f6011fe26aad79d50f3a40554)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: marzen dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:39 +0000 (17:11 +0200)]
ARM: shmobile: marzen dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Note that we have to keep the "console=" parameter in chosen/bootargs,
as this DTS is shared between legacy and multi-platform.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 1877a35096a3aebd6e848b688f8a50b75882b7e3)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: bockw-reference dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:38 +0000 (17:11 +0200)]
ARM: shmobile: bockw-reference dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Remove the now-superfluous "console=" parameter from chosen/bootargs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 05988b32e3551ffd23e095b3e409db112bb84809)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: armadillo800eva dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:37 +0000 (17:11 +0200)]
ARM: shmobile: armadillo800eva dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.
In addition, this will allow the PM domain code to find the PM domain
for the console device.

Note that we have to keep the "console=ttySC1" parameter in
chosen/bootargs, else we only get console messages on tty0, and because
this DTS is shared between legacy and multi-platform.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2c32622c3f3f9c7e0d3480c1fc0a31a95e04dd91)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: ape6evm-reference dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:36 +0000 (17:11 +0200)]
ARM: shmobile: ape6evm-reference dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.
In addition, this will allow the PM domain code to find the PM domain
for the console device.

Remove the now-superfluous "console=" parameter from chosen/bootargs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 71787aaa6015c4b7f47126c053afd8f2bebb00d7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: genmai dts: Add chosen/stdout-path
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:35 +0000 (17:11 +0200)]
ARM: shmobile: genmai dts: Add chosen/stdout-path

Add a stdout-path property so that automatic console selection works
in the absence of a "console=" parameter on the kernel command line.

Remove the now-superfluous "console=" parameter from chosen/bootargs.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit a67898660278c5a2f1242daafad0fc7535ff0344)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: emev2 dtsi: Add uart* labels for easier referencing
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:33 +0000 (17:11 +0200)]
ARM: shmobile: emev2 dtsi: Add uart* labels for easier referencing

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit e87aabaf24d660e3d4c68cfbd6aae0814b573375)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: emev2 dtsi: Use generic names for device nodes
Geert Uytterhoeven [Fri, 3 Oct 2014 15:11:32 +0000 (17:11 +0200)]
ARM: shmobile: emev2 dtsi: Use generic names for device nodes

smu -> clocks
sti -> timer
uart -> serial

All but "clocks" are defined in ePAPR v1.1.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 87982b2d9a75e10b357e6015f27b94011fc697be)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a73a4: sort dtsi file by address
Ulrich Hecht [Thu, 25 Sep 2014 01:32:14 +0000 (10:32 +0900)]
ARM: shmobile: r8a73a4: sort dtsi file by address

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
[horms+renesas@verge.net.au: updated for removal of dma-multiplexer base
 address]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 7300505a9b60f245c227dadff26c8d12ffb64559)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: kzm9d: sort dts file by address
Ulrich Hecht [Thu, 25 Sep 2014 01:32:13 +0000 (10:32 +0900)]
ARM: shmobile: kzm9d: sort dts file by address

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b97950cf04b32adf0f7521397c5fefa17208e71d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r7s72100: sort dtsi file by address
Ulrich Hecht [Thu, 25 Sep 2014 01:32:12 +0000 (10:32 +0900)]
ARM: shmobile: r7s72100: sort dtsi file by address

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 005980c0024ecd192c2eac3e3a9dcda1bedddffb)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: r8a73a4: Remove spurious dma-multiplexer base addresses
Simon Horman [Thu, 25 Sep 2014 01:32:11 +0000 (10:32 +0900)]
ARM: shmobile: r8a73a4: Remove spurious dma-multiplexer base addresses

As there is no reg property the dma-multiplexer nodes should
not include @...

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6a8663f8bb5e3e2bf0d362744db844f2678d9b8b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoMAINTAINERS: Remove reference to shmobile / koelsch_defconfig
Geert Uytterhoeven [Wed, 29 Oct 2014 14:28:36 +0000 (15:28 +0100)]
MAINTAINERS: Remove reference to shmobile / koelsch_defconfig

koelsch_defconfig has been removed.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b33a8e137ef62ad8280a58c4aeadd1ffcae89598)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: Remove genmai_defconfig from MAINTAINERS
Simon Horman [Mon, 4 Aug 2014 06:51:48 +0000 (15:51 +0900)]
ARM: shmobile: Remove genmai_defconfig from MAINTAINERS

The genmai defconfig file has been removed by
3ed27bd90d6d0c8b ("ARM: shmobile: genmai: remove defconfig")
so remove its entry in the MAINTAINERS accordingly.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit f7b98477f613a69b74ba4a715856630cc6508c0d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoARM: shmobile: Add DT and defconfigs to MAINTAINERS
Simon Horman [Wed, 14 May 2014 23:48:21 +0000 (08:48 +0900)]
ARM: shmobile: Add DT and defconfigs to MAINTAINERS

There are a number of DT and defconfig files which
are maintained as part of shmobile but have not been
listed as such in the MAINTAINERS file. This creates
confusion from time to time.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 0b514fdb52073e348ade842355f37f6976768e44)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoMerge tag 'backport/v3.14.24-ltsi-rc1/of-20141117' into backport/v3.14.24-ltsi-rc1...
Simon Horman [Fri, 5 Dec 2014 04:32:49 +0000 (13:32 +0900)]
Merge tag 'backport/v3.14.24-ltsi-rc1/of-20141117' into backport/v3.14.24-ltsi-rc1/mach-shmobile

9 years agoof: correct of_console_check()'s return value
Brian Norris [Wed, 3 Sep 2014 18:06:43 +0000 (11:06 -0700)]
of: correct of_console_check()'s return value

The comments above of_console_check() say that it will return TRUE if it
registers a preferred console, but add_preferred_console() uses a
0-equals-success convention, so this leaves of_console_check() with an
inconsistent policy for its return values.

Fortunately, nobody was actually checking the return value of
of_console_check(), so this isn't significant at the moment.

But let's match the comments, so we're doing what we say.

Fixes: 3482f2c52b77 ('of: Create of_console_check() for selecting a console specified in /chosen')
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 5f74d8b7b8546255db6af45b017e9cbb18aed609)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof: Enable console on serial ports specified by /chosen/stdout-path
Grant Likely [Fri, 28 Mar 2014 01:29:46 +0000 (18:29 -0700)]
of: Enable console on serial ports specified by /chosen/stdout-path

If the devicetree specifies a serial port as a stdout device, then the
kernel can use it as the default console if nothing else was selected on
the command line. For any serial port that uses the uart_add_one_port()
feature, the uart_add_one_port() has all the information needed to
automatically enable the console device, which is what this patch does.

With this change applied, a device tree platform can be booted without
any console= parameters on the command line and the kernel will still be
able to determine its console.

Tested on QEMU Versatile model and i.MX

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit a208ffd251d08ed7ba6bdf3ae1e423373fb12d3d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof: Create of_console_check() for selecting a console specified in /chosen
Grant Likely [Fri, 28 Mar 2014 00:18:55 +0000 (17:18 -0700)]
of: Create of_console_check() for selecting a console specified in /chosen

The devicetree has a binding for specifying the console device in the
/chosen node, but the kernel doesn't use it consistently. This change
adds an API for testing if a device node is a console, and adds a
preferred console entry if it is.

At the same time this patch removes the of_device_is_stdout_path() API
since it is unused.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
(cherry picked from commit 3482f2c52b77bf6596e24aae82e204a0603eba66)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoof: Add support for ePAPR "stdout-path" property
Grant Likely [Fri, 28 Mar 2014 00:11:23 +0000 (17:11 -0700)]
of: Add support for ePAPR "stdout-path" property

ePAPR 1.1 defines the "stdout-path" property for specifying the console
device, but Linux currently only handles the older "linux,stdout-path"
property. This patch adds parsing for the new property name.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
(cherry picked from commit 676e1b2fcd9dbb47a59baac13d089621d22c68b8)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoPM / domains: Add late_initcall to disable unused PM domains
Ulf Hansson [Wed, 3 Sep 2014 10:52:26 +0000 (12:52 +0200)]
PM / domains: Add late_initcall to disable unused PM domains

As default behavior let genpd at late init try to disable the unused
PM domains.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 2fe71dcdfd10d3f71bb559609a8ceda9f76b1e2c)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: Document SoC-specific bindings
Geert Uytterhoeven [Mon, 10 Nov 2014 19:00:42 +0000 (20:00 +0100)]
ASoC: rsnd: Document SoC-specific bindings

The documentation only mentioned the generic fallback compatible
property.
Add the missing SoC-specific compatible properties, which are already in
use.

Also drop a bogus 0x unit-address prefix while we're at it.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 56ba98acc398883324c0e70dc8aee1dc53eb2331)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: Add Volume Ramp support
Kuninori Morimoto [Mon, 10 Nov 2014 03:52:06 +0000 (19:52 -0800)]
ASoC: rsnd: Add Volume Ramp support

This patch adds Volume Ramp to Renesas sound driver.

amixer set "DVC Out" 100%
amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
amixer set "DVC Out Ramp" on
aplay xxx.wav &
amixer set "DVC Out"  80%  // Volume Down
amixer set "DVC Out" 100%  // Volume Up

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 3539cacff2031f6d47881c5f3a4932b0ad5ec224)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: fallback to PIO mode if DMA mode was failed
Kuninori Morimoto [Mon, 10 Nov 2014 04:00:58 +0000 (20:00 -0800)]
ASoC: rsnd: fallback to PIO mode if DMA mode was failed

Current Renesas R-Car sound driver probe will be failed
if it try to use DMA mode and it couldn't use for some reasons.
But PIO mode works even though in such case.
This patch try to fallback to PIO mode if DMA mode probing was failed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit d3a768233243b5892a9c74b85896b9e8c017b259)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup debug message format and timing
Kuninori Morimoto [Mon, 10 Nov 2014 04:00:30 +0000 (20:00 -0800)]
ASoC: rsnd: tidyup debug message format and timing

Current Renesas R-Car sound driver debug message
is using random format
(ex "ssi0: xxx" / "SSI0 xxx" / "ssi[0]: xxx")
and confusable timing
("xxx probe failed" and "xxx probed" are shown in same time)
This patch fixes these

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 30cc4faf703955cd5cd07da489bd817ae43e3fec)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: enable enumerated DVC valume settings
Kuninori Morimoto [Wed, 5 Nov 2014 04:28:50 +0000 (20:28 -0800)]
ASoC: rsnd: enable enumerated DVC valume settings

DVC controls some digital volume features.
Volume Ramp is listed as "XX dB / YY steps",
and this enumerated settings are easy for users.
This patch adds rsnd_dvc_cfg_e and care about
enumerated settings.
Compiler will report like below at this point,
but, it will be removed if Volume Ramp was supported.
  warning: '_rsnd_dvc_pcm_new_e' defined but not used

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 018342976ce971944dd4d9309f75e86382079a2b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: enable single DVC valume settings
Kuninori Morimoto [Wed, 5 Nov 2014 04:28:10 +0000 (20:28 -0800)]
ASoC: rsnd: enable single DVC valume settings

DVC controls some digital volume features.
Some of them requests values for "each channels",
but, some of them requests values for "feature".
And, Volume Ramp has "feature" settings.
This patch adds rsnd_dvc_cfg_s and care about
single settings.
Compiler will report like below at this point,
but, it will be removed if Volume Ramp was supported.
  warning: '_rsnd_dvc_pcm_new_s' defined but not used

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ab2e479667507329475c8ef93d61f3dbe654c3c2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: enable multiple DVC valume settings
Kuninori Morimoto [Wed, 5 Nov 2014 04:27:46 +0000 (20:27 -0800)]
ASoC: rsnd: enable multiple DVC valume settings

DVC controls some digital volume features.
Some of them requests values for "each channels",
but, some of them requests values for "feature".
Current dvc.c is supporting Mute/Volume,
and these have "each channels" settings.
This patch adds rsnd_dvc_cfg_m and care about
multiple settings for each channels.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ec14af91a03f7d68b2a72bec20be2ab583d3f63a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: move DVC_DVUER settings under rsnd_dvc_volume_update()
Kuninori Morimoto [Wed, 5 Nov 2014 04:27:18 +0000 (20:27 -0800)]
ASoC: rsnd: move DVC_DVUER settings under rsnd_dvc_volume_update()

We need to Enable/Disable DVC_DVUER register if we set
DVCp_ZCMCR, DVCp_VRCTR, DVCp_VRPDR, DVCp_VRDBR,
DVCp_VOL0R, DVCp_VOL1R, DVCp_VOL2R, DVCp_VOL3R,
DVCp_VOL4R, DVCp_VOL5R, DVCp_VOL6R, DVCp_VOL7R
and, these are controlled under rsnd_dvc_volume_update().
This patch moves DVC_DVUER settings to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 140bab8961eb4047070b46a6dd50ec87496e0cde)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: control DVC_DVUCR under rsnd_dvc_volume_update()
Kuninori Morimoto [Wed, 5 Nov 2014 04:26:53 +0000 (20:26 -0800)]
ASoC: rsnd: control DVC_DVUCR under rsnd_dvc_volume_update()

rsnd_dvc_volume_update() is main function to control
DVC feature like Digital Volume / Mute / Ramp etc.
DVC_DVUCR should be controlled under this function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 1c5d1c988302f324ac396ac13461d59d091be605)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: add struct rsnd_dvc_cfg and control DVC settings
Kuninori Morimoto [Wed, 22 Oct 2014 01:14:14 +0000 (18:14 -0700)]
ASoC: rsnd: add struct rsnd_dvc_cfg and control DVC settings

DVC can control Digital Volume / Mute / Volume Ramp etc,
and these uses different max value.
Current driver is using fixed max value for each settings.
This patch adds new struct rsnd_dvc_cfg, and control these.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 92b9a6991b2e3a4ccf5ffc956730d36835d53a79)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup RSND_DVC_VOLUME_NUM to RSND_DVC_CHANNELS
Kuninori Morimoto [Wed, 22 Oct 2014 01:13:56 +0000 (18:13 -0700)]
ASoC: rsnd: tidyup RSND_DVC_VOLUME_NUM to RSND_DVC_CHANNELS

RSND_DVC_VOLUME_NUM means DVC channel number.
This patch tidyups this un-understandable naming

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 9960ce97432bdb1defc76ed80ac19e37e8778bc6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: tidyup debug information when read/write
Kuninori Morimoto [Wed, 22 Oct 2014 01:13:46 +0000 (18:13 -0700)]
ASoC: rsnd: tidyup debug information when read/write

b8c637864a6904a9ba8e0df556d5bdf9f26b2c54
(ASoC: rsnd: use regmap_mmio instead of original regmap bus)
added regmap_mmio support on Renesas R-Car sound driver.
Then, debug information of register read/write
indicates regmap index, not register address.
This is a little bit confusable information.
This patch tidyup debug message, and added regmap debug hint
on comment area.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit ace0eb1e91a75b84b1be3d610b79509a5bd94df1)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agoASoC: rsnd: remove unsupported PAUSE flag
Kuninori Morimoto [Wed, 29 Oct 2014 04:02:03 +0000 (21:02 -0700)]
ASoC: rsnd: remove unsupported PAUSE flag

R-Car sound doesn't support PAUSE.
Remove SNDRV_PCM_INFO_PAUSE flags from snd_pcm_hardware info

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
(cherry picked from commit 706c66213e5e623e23f521b1acbd8171af7a3549)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agogpio: add flags argument to gpiod_get*() functions
Alexandre Courbot [Fri, 25 Jul 2014 14:38:36 +0000 (23:38 +0900)]
gpio: add flags argument to gpiod_get*() functions

The huge majority of GPIOs have their direction and initial value set
right after being obtained by one of the gpiod_get() functions. The
integer GPIO API had gpio_request_one() that took a convenience flags
parameter allowing to specify an direction and value applied to the
returned GPIO. This feature greatly simplifies client code and ensures
errors are always handled properly.

A similar feature has been requested for the gpiod API. Since setting
the direction of a GPIO is so often the very next action done after
obtaining its descriptor, we prefer to extend the existing functions
instead of introducing new functions that would raise the
number of gpiod getters to 16 (!).

The drawback of this approach is that all gpiod clients need to be
updated. To limit the pain, temporary macros are introduced that allow
gpiod_get*() to be called with or without the extra flags argument. They
will be removed once all consumer code has been updated.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agogpio: include linux/bug.h in interface header
Arnd Bergmann [Thu, 8 May 2014 13:42:25 +0000 (15:42 +0200)]
gpio: include linux/bug.h in interface header

Today's linux-next kernel started showing build errors for the
use of WARN_ON in linux/gpio/consumer.h:

In file included from drivers/video/backlight/pwm_bl.c:13:0:
include/linux/gpio/consumer.h: In function 'gpiod_put':
include/linux/gpio/consumer.h:81:2: error: implicit declaration of function 'WARN_ON' [-Werror=implicit-function-declaration]

It's not clear why this never happened before, but this patch
fixes it by including the header that contains the defintion
of this macro.

Signed-off-by: Arnd Bergmann <arnd@arnd.de>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit cdf86cd233207ed992a647f0b9d42c60735756e7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
9 years agogpio: Add helpers for optional GPIOs
Thierry Reding [Fri, 25 Apr 2014 15:10:06 +0000 (17:10 +0200)]
gpio: Add helpers for optional GPIOs

Introduce gpiod_get_optional() and gpiod_get_index_optional() helpers
that make it easier for drivers to handle optional GPIOs.

Currently in order to handle optional GPIOs, a driver needs to special
case error handling for -ENOENT, such as this:

gpio = gpiod_get(dev, "foo");
if (IS_ERR(gpio)) {
if (PTR_ERR(gpio) != -ENOENT)
return PTR_ERR(gpio);

gpio = NULL;
}

if (gpio) {
/* set up GPIO */
}

With these new helpers the above is reduced to:

gpio = gpiod_get_optional(dev, "foo");
if (IS_ERR(gpio))
return PTR_ERR(gpio);

if (gpio) {
/* set up GPIO */
}

While at it, device-managed variants of these functions are also
provided.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry picked from commit 29a1f2333e07bbbecb920cc78fd035fe8f53207a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>