]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
10 years agoMerge branches 'heads/clock-for-v3.16' and 'heads/dt-for-v3.16' into next
Simon Horman [Tue, 13 May 2014 01:51:12 +0000 (10:51 +0900)]
Merge branches 'heads/clock-for-v3.16' and 'heads/dt-for-v3.16' into next

10 years agoARM: shmobile: r8a7791 dtsi: Add GPIO clocks
Geert Uytterhoeven [Wed, 23 Apr 2014 08:25:28 +0000 (10:25 +0200)]
ARM: shmobile: r8a7791 dtsi: Add GPIO clocks

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>
10 years agoARM: shmobile: r8a7790 dtsi: Add GPIO clocks
Geert Uytterhoeven [Wed, 23 Apr 2014 08:25:27 +0000 (10:25 +0200)]
ARM: shmobile: r8a7790 dtsi: Add GPIO clocks

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>
10 years agoARM: shmobile: r8a7791: Correct SYS-DMAC clock defines
Geert Uytterhoeven [Mon, 12 May 2014 18:49:33 +0000 (20:49 +0200)]
ARM: shmobile: r8a7791: Correct SYS-DMAC clock defines

R-Car M2 has two MSTP bits for SYS-DMAC, not one.
Also bring the naming in sync with the documentation.

This issue was introduced in v3.14, in commit
4d8864c9e94ec727f1c675b9f6921525c360334b ("ARM: shmobile: r8a7791: Add
clock index macros for DT sources").

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>
10 years agoARM: shmobile: dts: Move interrupt-parent property to root node
Laurent Pinchart [Wed, 30 Apr 2014 00:41:28 +0000 (02:41 +0200)]
ARM: shmobile: dts: Move interrupt-parent property to root node

There's no need to duplicate the interrupt-parent property in all DT
nodes as the kernel automatically walks parent nodes to find the
property. Specify it once in the root node only.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branches 'heads/soc-cleanup-for-v3.16' and 'heads/sh-drivers-for-v3.16' into...
Simon Horman [Mon, 12 May 2014 07:11:18 +0000 (16:11 +0900)]
Merge branches 'heads/soc-cleanup-for-v3.16' and 'heads/sh-drivers-for-v3.16' into next

10 years agoARM: shmobile: Remove unused r8a7791_init_early()
Magnus Damm [Sun, 11 May 2014 23:25:37 +0000 (08:25 +0900)]
ARM: shmobile: Remove unused r8a7791_init_early()

Remove the now unused r8a7791_init_early() function.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Use r8a7791 DT CPU Frequency for Koelsch
Magnus Damm [Sun, 11 May 2014 23:25:27 +0000 (08:25 +0900)]
ARM: shmobile: Use r8a7791 DT CPU Frequency for Koelsch

Convert the Koelsch board support to use shmobile_init_delay()
to be able to migrate away from per-SoC delay setup functions.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Use r8a7791 DT CPU Frequency in common case
Magnus Damm [Sun, 11 May 2014 23:25:18 +0000 (08:25 +0900)]
ARM: shmobile: Use r8a7791 DT CPU Frequency in common case

Convert the common C-code-less r8a7791 DT board support
to use shmobile_init_delay() to be able to migrate away
from per-SoC delay setup functions.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agodrivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI
Geert Uytterhoeven [Tue, 6 May 2014 21:26:19 +0000 (23:26 +0200)]
drivers: sh: compile drivers/sh/pm_runtime.c if ARCH_SHMOBILE_MULTI

If the kernel is built to support multi-ARM configuration with shmobile
support built in, then drivers/sh is not built. This contains the PM
runtime code in drivers/sh/pm_runtime.c, which implicitly enables the
module clocks for all devices, and thus is quite essential.
Without this, the state of clocks depends on implicit reset state, or on
the bootloader.

If ARCH_SHMOBILE_MULTI then build the drivers/sh directory, but ensure that
bits that may conflict (drivers/sh/clk if the common clock framework is
enabled) or are not used (drivers/sh/intc), are not built.
Also, only enable the PM runtime code when actually running on a shmobile
SoCs that needs it.

ARCH_SHMOBILE_MULTI was added a while ago by commit
efacfce5f8a523457e9419a25d52fe39db00b26a ("ARM: shmobile: Introduce
ARCH_SHMOBILE_MULTI"), but drivers/sh was compiled for both
ARCH_SHMOBILE_LEGACY and ARCH_SHMOBILE_MULTI until commit
bf98c1eac1d4a6bcf00532e4fa41d8126cd6c187 ("ARM: Rename ARCH_SHMOBILE to
ARCH_SHMOBILE_LEGACY").

Inspired by a patch from Ben Dooks <ben.dooks@codethink.co.uk>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branches 'heads/clock-cleanup-for-v3.16', 'heads/r8a7740-cleanup-for-v3.16...
Simon Horman [Sun, 11 May 2014 12:00:44 +0000 (21:00 +0900)]
Merge branches 'heads/clock-cleanup-for-v3.16', 'heads/r8a7740-cleanup-for-v3.16', 'heads/boards-for-v3.16', 'heads/clock-for-v3.16' and 'heads/dt-for-v3.16' into next

10 years agoARM: shmobile: Minor cleanup of the Armadillo legacy board code
Magnus Damm [Wed, 7 May 2014 23:37:53 +0000 (08:37 +0900)]
ARM: shmobile: Minor cleanup of the Armadillo legacy board code

Cleanup the legacy Armadillo board code slightly by
removing the pointless eva_add_early_devices() function

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Remove unused r8a7740_init_delay()
Magnus Damm [Wed, 7 May 2014 23:32:56 +0000 (08:32 +0900)]
ARM: shmobile: Remove unused r8a7740_init_delay()

Remove the now unused r8a7740_init_delay() function.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Tested-by: Geert Uytterhoeven <geert@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Use r8a7740 DT CPU Frequency for Armadillo DT Ref
Magnus Damm [Wed, 7 May 2014 23:32:47 +0000 (08:32 +0900)]
ARM: shmobile: Use r8a7740 DT CPU Frequency for Armadillo DT Ref

Convert the Armadillo r8a7740 DT reference board support
to use shmobile_init_delay() to be able to migrate away
from per-SoC delay setup functions.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Tested-by: Geert Uytterhoeven <geert@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Use r8a7740 DT CPU Frequency in common case
Magnus Damm [Wed, 7 May 2014 23:32:38 +0000 (08:32 +0900)]
ARM: shmobile: Use r8a7740 DT CPU Frequency in common case

Convert the common C-code-less r8a7740 DT board support
to use shmobile_init_delay() to be able to migrate away
from per-SoC delay setup functions.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Tested-by: Geert Uytterhoeven <geert@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: Add r8a7740 Maximum CPU Frequency to DTS
Magnus Damm [Wed, 7 May 2014 23:32:29 +0000 (08:32 +0900)]
ARM: shmobile: Add r8a7740 Maximum CPU Frequency to DTS

Add 800 MHz to the r8a7740 DTS to describe the maximum CPU frequency.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Tested-by: Geert Uytterhoeven <geert@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r7s72100: Switch to new style MTU2 device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:22 +0000 (13:15 +0200)]
ARM: shmobile: r7s72100: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style MTU2 device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:21 +0000 (13:15 +0200)]
sh: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7779: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:20 +0000 (13:15 +0200)]
ARM: shmobile: r8a7779: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7778: Switch to new style TMU device
Laurent Pinchart [Fri, 2 May 2014 18:21:25 +0000 (20:21 +0200)]
ARM: shmobile: r8a7778: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:18 +0000 (13:15 +0200)]
ARM: shmobile: r8a7740: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh73a0: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:17 +0000 (13:15 +0200)]
ARM: shmobile: sh73a0: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh7372: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:16 +0000 (13:15 +0200)]
ARM: shmobile: sh7372: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style TMU device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:15 +0000 (13:15 +0200)]
sh: Switch to new style TMU device

The TMU (Timer Unit) driver implements a new style of platform data that
handles the timer as a single device with multiple channel. Switch from
the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7791: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:14 +0000 (13:15 +0200)]
ARM: shmobile: r8a7791: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au resolved conflict: use clk_names]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7790: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:13 +0000 (13:15 +0200)]
ARM: shmobile: r8a7790: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
[horms+renesas@verge.net.au resolved conflict: use clk_names]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:12 +0000 (13:15 +0200)]
ARM: shmobile: r8a7740: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a73a4: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:11 +0000 (13:15 +0200)]
ARM: shmobile: r8a73a4: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh73a0: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:10 +0000 (13:15 +0200)]
ARM: shmobile: sh73a0: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: sh7372: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:09 +0000 (13:15 +0200)]
ARM: shmobile: sh7372: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agosh: Switch to new style CMT device
Laurent Pinchart [Wed, 23 Apr 2014 11:15:08 +0000 (13:15 +0200)]
sh: Switch to new style CMT device

The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740: Correct name of DT Ethernet clock
Geert Uytterhoeven [Wed, 7 May 2014 20:32:28 +0000 (22:32 +0200)]
ARM: shmobile: r8a7740: Correct name of DT Ethernet clock

The preferred node name in DT for an Ethernet device is "ethernet".
"sh-eth" was used in preliminary and incomplete bindings.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: armadillo-reference dts: Add Ethernet support
Geert Uytterhoeven [Wed, 7 May 2014 20:32:30 +0000 (22:32 +0200)]
ARM: shmobile: armadillo-reference dts: Add Ethernet support

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: r8a7740 dtsi: Add Ethernet support
Geert Uytterhoeven [Wed, 7 May 2014 20:32:29 +0000 (22:32 +0200)]
ARM: shmobile: r8a7740 dtsi: Add Ethernet support

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: henninger: add MSIOF0 DT support
Sergei Shtylyov [Tue, 6 May 2014 20:47:59 +0000 (00:47 +0400)]
ARM: shmobile: henninger: add MSIOF0 DT support

Define the Henninger board dependent part of the MSIOF0 device node.
Add device node for Renesas R2A11302FT PMIC for which no bindings exist yet.

Based on the Koelsch MSIOF device tree patch by Geert Uytterhoeven.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: henninger: add QSPI DT support
Sergei Shtylyov [Mon, 5 May 2014 22:45:31 +0000 (02:45 +0400)]
ARM: shmobile: henninger: add QSPI DT support

Define the Henninger board dependent part of the QSPI device node.
Add device nodes for Spansion S25FL512S SPI flash and MTD partitions on it.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: henninger: add SDHI0/2 DT support
Sergei Shtylyov [Sat, 3 May 2014 17:04:34 +0000 (21:04 +0400)]
ARM: shmobile: henninger: add SDHI0/2 DT support

Define the Henninger board dependent part of the SDHI0/2 device nodes along with
the necessary voltage regulators (note that the Vcc regulators are dummy -- they
are required but don't actually exist on the board). Also, GPIOs have to be used
for the CD and WP signals due to the SDHI driver constraints...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'dt-for-v3.16' into next
Simon Horman [Fri, 2 May 2014 02:27:11 +0000 (11:27 +0900)]
Merge branch 'dt-for-v3.16' into next

10 years agoARM: shmobile: henninger: specify EXTAL frequency
Sergei Shtylyov [Thu, 1 May 2014 22:56:33 +0000 (02:56 +0400)]
ARM: shmobile: henninger: specify EXTAL frequency

When creating the initial device tree for the Henninger board,  I've overlooked
that EXTAL frequency needs to be overridden there. The 'sh-sci' driver  managed
to work somehow but the SDHI driver that I've tried to enable just hanged with
the default EXTAL frequency of 0...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'heads/dt-for-v3.16' into next
Simon Horman [Mon, 28 Apr 2014 00:12:39 +0000 (09:12 +0900)]
Merge branch 'heads/dt-for-v3.16' into next

10 years agoARM: shmobile: henninger: enable SATA0
Sergei Shtylyov [Fri, 25 Apr 2014 22:51:27 +0000 (02:51 +0400)]
ARM: shmobile: henninger: enable SATA0

Enable SATA0 device for the Henninger board.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'heads/dt-for-v3.16' into next
Simon Horman [Fri, 25 Apr 2014 01:27:00 +0000 (10:27 +0900)]
Merge branch 'heads/dt-for-v3.16' into next

10 years agoARM: shmobile: henninger: add Ether DT support
Sergei Shtylyov [Thu, 24 Apr 2014 22:44:12 +0000 (02:44 +0400)]
ARM: shmobile: henninger: add Ether DT support

Define the Henninger board dependent part of the Ether device node.
Enable DHCP and NFS root for the kernel booting.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoARM: shmobile: henninger: initial device tree
Sergei Shtylyov [Thu, 24 Apr 2014 22:42:41 +0000 (02:42 +0400)]
ARM: shmobile: henninger: initial device tree

Add the initial device tree for the R8A7791 SoC based Henninger board. SCIF0
serial port support is included, so that the serial console can work.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'heads/soc-for-v3.16' into next
Simon Horman [Fri, 25 Apr 2014 01:02:42 +0000 (10:02 +0900)]
Merge branch 'heads/soc-for-v3.16' into next

10 years agoARM: shmobile: Ignore callbacks for subsys generic_pm_domain_data
Ulf Hansson [Fri, 11 Apr 2014 15:26:41 +0000 (17:26 +0200)]
ARM: shmobile: Ignore callbacks for subsys generic_pm_domain_data

There are no active users of these callbacks, thus there are no benefit
of trying to invoke them.

Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
10 years agoMerge branch 'clockevents/cmt-mtu2-tmu-cleanups' of git://git.linaro.org/people/danie...
Simon Horman [Wed, 23 Apr 2014 01:01:02 +0000 (10:01 +0900)]
Merge branch 'clockevents/cmt-mtu2-tmu-cleanups' of git://git.linaro.org/people/daniel.lezcano/linux into cmt-mtu2-tmu-cleanups-for-v3.16

10 years agoMerge tag 'renesas-clock-for-v3.16' into cmt-mtu2-tmu-cleanups-for-v3.16
Simon Horman [Wed, 23 Apr 2014 00:59:40 +0000 (09:59 +0900)]
Merge tag 'renesas-clock-for-v3.16' into cmt-mtu2-tmu-cleanups-for-v3.16

Renesas ARM Based SoC Clock Updates for v3.16

SH Mobile shared clock code
* Introduce shmobile_clk_workaround()

r8a7791 (R-Car M2) SoC
* Rename VSP1_SY clocks to VSP1_S
* Correct the I2C clocks parents

r8a7790 (R-Car H2) SoC
* Remove old style audio clock
* Rename VSP1_(SY|RT) clocks to VSP1_(S|R)
* Fix the I2C clocks parents

r8a7778 (R-Car M1) SoC
* Remove old style audio clock

10 years agoclocksource: sh_mtu2: Sort headers alphabetically
Laurent Pinchart [Tue, 4 Mar 2014 13:11:47 +0000 (14:11 +0100)]
clocksource: sh_mtu2: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Remove FSF mail address from GPL notice
Laurent Pinchart [Tue, 4 Mar 2014 13:12:32 +0000 (14:12 +0100)]
clocksource: sh_mtu2: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Tue, 4 Mar 2014 17:09:15 +0000 (18:09 +0100)]
clocksource: sh_mtu2: Rename clock to "fck" in the non-legacy case

The sh_mtu2 driver gets the MTU2 functional clock using a connection ID
of "mtu2_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "mtu2_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add support for multiple channels per device
Laurent Pinchart [Tue, 4 Mar 2014 17:05:45 +0000 (18:05 +0100)]
clocksource: sh_mtu2: Add support for multiple channels per device

MTU2 hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_mtu2 driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Hardcode MTU2 clock event rating to 200
Laurent Pinchart [Tue, 4 Mar 2014 14:19:41 +0000 (15:19 +0100)]
clocksource: sh_mtu2: Hardcode MTU2 clock event rating to 200

All boards use clock event ratings of 200 for the MTU2, hardcode it in
the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Set cpumask to cpu_possible_mask
Laurent Pinchart [Tue, 4 Mar 2014 14:22:19 +0000 (15:22 +0100)]
clocksource: sh_mtu2: Set cpumask to cpu_possible_mask

The MTU2 is not tied to CPU0, make it usable on any CPU.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 4 Mar 2014 14:16:25 +0000 (15:16 +0100)]
clocksource: sh_mtu2: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Allocate channels dynamically
Laurent Pinchart [Tue, 4 Mar 2014 13:23:00 +0000 (14:23 +0100)]
clocksource: sh_mtu2: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Tue, 4 Mar 2014 13:10:55 +0000 (14:10 +0100)]
clocksource: sh_mtu2: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add index to struct sh_mtu2_channel
Laurent Pinchart [Tue, 4 Mar 2014 13:17:26 +0000 (14:17 +0100)]
clocksource: sh_mtu2: Add index to struct sh_mtu2_channel

Use the index as the timer start/stop bit and when printing messages to
identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Add memory base to sh_mtu2_channel structure
Laurent Pinchart [Tue, 4 Mar 2014 13:04:24 +0000 (14:04 +0100)]
clocksource: sh_mtu2: Add memory base to sh_mtu2_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Constify name argument to sh_mtu2_register()
Laurent Pinchart [Tue, 4 Mar 2014 12:57:14 +0000 (13:57 +0100)]
clocksource: sh_mtu2: Constify name argument to sh_mtu2_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Split channel setup to separate function
Laurent Pinchart [Tue, 4 Mar 2014 12:11:23 +0000 (13:11 +0100)]
clocksource: sh_mtu2: Split channel setup to separate function

Move the channel setup code from sh_mtu2_setup to a new
sh_mtu2_setup_channel function and call it from sh_mtu2_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Rename struct sh_mtu2_priv to sh_mtu2_device
Laurent Pinchart [Tue, 4 Mar 2014 12:04:48 +0000 (13:04 +0100)]
clocksource: sh_mtu2: Rename struct sh_mtu2_priv to sh_mtu2_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Split channel fields from sh_mtu2_priv
Laurent Pinchart [Tue, 4 Mar 2014 11:58:30 +0000 (12:58 +0100)]
clocksource: sh_mtu2: Split channel fields from sh_mtu2_priv

Create a new sh_mtu2_channel structure to hold the channel-specific
fields in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Turn sh_mtu2_priv fields into local variables
Laurent Pinchart [Tue, 4 Mar 2014 11:59:54 +0000 (12:59 +0100)]
clocksource: sh_mtu2: Turn sh_mtu2_priv fields into local variables

The rate and periodic fields are used in a single function only, as
local variables. Remove them from the structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_mtu2: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_mtu2: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
10 years agoclocksource: sh_tmu: Sort headers alphabetically
Laurent Pinchart [Wed, 12 Feb 2014 15:56:44 +0000 (16:56 +0100)]
clocksource: sh_tmu: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Remove FSF mail address from GPL notice
Laurent Pinchart [Fri, 14 Feb 2014 00:25:50 +0000 (01:25 +0100)]
clocksource: sh_tmu: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Thu, 13 Feb 2014 23:35:18 +0000 (00:35 +0100)]
clocksource: sh_tmu: Rename clock to "fck" in the non-legacy case

The sh_tmu driver gets the TMU functional clock using a connection ID of
"tmu_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "tmu_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add support for multiple channels per device
Laurent Pinchart [Tue, 28 Jan 2014 11:36:48 +0000 (12:36 +0100)]
clocksource: sh_tmu: Add support for multiple channels per device

TMU hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_tmu driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200

All boards use clock event and clock source ratings of 200 for the TMU,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 28 Jan 2014 23:33:08 +0000 (00:33 +0100)]
clocksource: sh_tmu: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Allocate channels dynamically
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add index to struct sh_tmu_channel
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Add index to struct sh_tmu_channel

Use the index as the timer start/stop bit and when printing messages to
identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Add memory base to sh_tmu_channel structure
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Add memory base to sh_tmu_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Constify name argument to sh_tmu_register()
Laurent Pinchart [Mon, 17 Feb 2014 15:04:16 +0000 (16:04 +0100)]
clocksource: sh_tmu: Constify name argument to sh_tmu_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Split channel setup to separate function
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Split channel setup to separate function

Move the channel setup code from sh_tmu_setup to a new
sh_tmu_setup_channel function and call it from sh_tmu_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Rename struct sh_tmu_priv to sh_tmu_device
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_tmu: Rename struct sh_tmu_priv to sh_tmu_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Split channel fields from sh_tmu_priv
Laurent Pinchart [Mon, 27 Jan 2014 14:29:19 +0000 (15:29 +0100)]
clocksource: sh_tmu: Split channel fields from sh_tmu_priv

Create a new sh_tmu_channel structure to hold the channel-specific
field in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_tmu: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_tmu: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Request IRQ for clock event device only
Laurent Pinchart [Fri, 21 Feb 2014 00:24:47 +0000 (01:24 +0100)]
clocksource: sh_cmt: Request IRQ for clock event device only

Clock sources don't need an IRQ, request the IRQ only for channels used
as clock event devices.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Sort headers alphabetically
Laurent Pinchart [Wed, 12 Feb 2014 15:56:44 +0000 (16:56 +0100)]
clocksource: sh_cmt: Sort headers alphabetically

This helps locating duplicates and inserting new headers.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Remove FSF mail address from GPL notice
Laurent Pinchart [Fri, 14 Feb 2014 00:25:50 +0000 (01:25 +0100)]
clocksource: sh_cmt: Remove FSF mail address from GPL notice

Do not include the paragraph about writing to the Free Software
Foundation's mailing address from the sample GPL notice. The FSF has
changed addresses in the past, and may do so again. Linux already
includes a copy of the GPL.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename clock to "fck" in the non-legacy case
Laurent Pinchart [Thu, 13 Feb 2014 23:35:18 +0000 (00:35 +0100)]
clocksource: sh_cmt: Rename clock to "fck" in the non-legacy case

The sh_cmt driver gets the CMT functional clock using a connection ID of
"cmt_fck". While all SH SoCs create clock lookup entries with a NULL
device ID and a "cmt_fck" connection ID, the ARM SoCs use the device ID
only with a NULL connection ID. This works on legacy platforms but will
break on ARM with DT boot.

Fix the situation by using a connection ID of "fck" in the non-legacy
platform data case. Clock lookup entries will be renamed to use the
device ID as well as the connection ID as platforms get moved to new
platform data. The legacy code will eventually be dropped, leaving us
with device ID based clock lookup, compatible with DT boot.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add support for multiple channels per device
Laurent Pinchart [Tue, 28 Jan 2014 11:36:48 +0000 (12:36 +0100)]
clocksource: sh_cmt: Add support for multiple channels per device

CMT hardware devices can support multiple channels, with global
registers and per-channel registers. The sh_cmt driver currently models
the hardware with one Linux device per channel. This model makes it
difficult to handle global registers in a clean way.

Add support for a new model that uses one Linux device per timer with
multiple channels per device. This requires changes to platform data,
add new channel configuration fields.

Support for the legacy model is kept and will be removed after all
platforms switch to the new model.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Hardcode CMT clock source rating to 125
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_cmt: Hardcode CMT clock source rating to 125

All boards use or should use a clock source rating of 125 for the CMT,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Hardcode CMT clock event rating to 125
Laurent Pinchart [Wed, 19 Feb 2014 16:00:31 +0000 (17:00 +0100)]
clocksource: sh_cmt: Hardcode CMT clock event rating to 125

All boards use or should use a clock event rating of 125 for the CMT,
hardcode it in the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Set cpumask to cpu_possible_mask
Laurent Pinchart [Wed, 19 Feb 2014 15:19:44 +0000 (16:19 +0100)]
clocksource: sh_cmt: Set cpumask to cpu_possible_mask

The CMT is a global timer not restricted to a single CPU. It has a lower
rating than the TMU or ARM architected timer, but is still useful on
systems where the other timers are stopped during CPU sleep.

When multiple timers are available the timers core selects which timer
to use based on timer ratings.

On SMP systems where timer broadcasting is required, one dummy timer is
instantiated per CPU with a rating of 100. On those systems the CMT
timer has a rating of 80, which makes the dummy timer selected by
default on all CPUs. The CMT is then available, and will be used as a
broadcast timer.

On UP systems no dummy timer is instantiated. The CMT timer has a rating
of 125 on those systems and is used directly as a clock event device for
CPU0 without broadcasting.

The CMT rating shouldn't depend on whether we boot a UP or SMP system.
We can't raise the CMT rating to 125 on SMP systems. This would select
CMT as the clock event device for CPU0 as its rating is higher than the
dummy timer rating, and would leave the system without a broadcast
timer. We could instead lower the rating to 80 on all systems, but that
wouldn't reflect reality as ratings between 1 and 99 are documented as
"unfit for real use".

We should raise the rating above 99 and still have the CMT selected as a
broadcast timer. This can be done by changing the cpumask from
cpumask_of(0) to cpu_possible_mask. In that case the timer selection
logic will prefer the previously probed and already selected dummy timer
for all CPUs based on the fact that already selected per-cpu timers are
preferred over new global timers, regardless of their respective
ratings. This also better reflects reality, as the CMT is not tied to
the boot CPU.

Ideally the timer selection logic should realize that the CMT needs to
be used as a broadcast timer on SMP systems as no other broadcast timer
is available, regardless of the cpumask and rating.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Replace hardcoded register values with macros
Laurent Pinchart [Tue, 28 Jan 2014 23:33:08 +0000 (00:33 +0100)]
clocksource: sh_cmt: Replace hardcoded register values with macros

Define symbolic macros for all used registers bits.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split static information from sh_cmt_device
Laurent Pinchart [Tue, 11 Feb 2014 22:46:48 +0000 (23:46 +0100)]
clocksource: sh_cmt: Split static information from sh_cmt_device

Create a new sh_cmt_info structure to hold static information about the
device model and reference that structure from the sh_cmt_device
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Allocate channels dynamically
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Allocate channels dynamically

This prepares the driver for multi-channel support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Replace kmalloc + memset with kzalloc
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Replace kmalloc + memset with kzalloc

One kzalloc a day keeps the bugs away.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add index to struct sh_cmt_channel
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Add index to struct sh_cmt_channel

Use the index when printing messages to identify the channel.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Add memory base to sh_cmt_channel structure
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Add memory base to sh_cmt_channel structure

The channel memory base is channel-specific, add it to the channel
structure in preparation for support of multiple channels per device.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename mapbase/mapbase_str to mapbase_ch/mapbase
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Rename mapbase/mapbase_str to mapbase_ch/mapbase

The mapbase variable points to the mapped base address of the channel,
rename it to mapbase_sh. mapbase_str points to the mapped base address
of the CMT device, rename it to mapbase.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Constify name argument to sh_cmt_register()
Laurent Pinchart [Mon, 17 Feb 2014 15:04:16 +0000 (16:04 +0100)]
clocksource: sh_cmt: Constify name argument to sh_cmt_register()

The name argument is assigned to const structure fields only, constify
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split channel setup to separate function
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Split channel setup to separate function

Move the channel setup code from sh_cmt_setup to a new
sh_cmt_setup_channel function and call it from sh_cmt_setup.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Rename struct sh_cmt_priv to sh_cmt_device
Laurent Pinchart [Mon, 27 Jan 2014 21:04:17 +0000 (22:04 +0100)]
clocksource: sh_cmt: Rename struct sh_cmt_priv to sh_cmt_device

Channel data is private as well, rename priv to device to make the
distrinction between the core device and the channels clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Split channel fields from sh_cmt_priv
Laurent Pinchart [Mon, 27 Jan 2014 14:29:19 +0000 (15:29 +0100)]
clocksource: sh_cmt: Split channel fields from sh_cmt_priv

Create a new sh_cmt_channel structure to hold the channel-specific
field in preparation for multiple channels per device support.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
10 years agoclocksource: sh_cmt: Use request_irq() instead of setup_irq()
Laurent Pinchart [Mon, 17 Feb 2014 10:27:49 +0000 (11:27 +0100)]
clocksource: sh_cmt: Use request_irq() instead of setup_irq()

The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>