summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
diff options
context:
space:
mode:
authorLaurent Pinchart2014-04-23 13:15:21 +0200
committerSimon Horman2014-05-11 12:35:28 +0200
commit5204601c0877b3ffc90e417bf30fccc9bdf47962 (patch)
treec1125e8cd65378b5e7ec1b3d8b827b0723080125 /arch/sh/kernel/cpu/sh2a/setup-sh7203.c
parentARM: shmobile: r8a7779: Switch to new style TMU device (diff)
downloadkernel-qcow2-linux-5204601c0877b3ffc90e417bf30fccc9bdf47962.tar.gz
kernel-qcow2-linux-5204601c0877b3ffc90e417bf30fccc9bdf47962.tar.xz
kernel-qcow2-linux-5204601c0877b3ffc90e417bf30fccc9bdf47962.zip
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>
Diffstat (limited to 'arch/sh/kernel/cpu/sh2a/setup-sh7203.c')
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7203.c67
1 files changed, 11 insertions, 56 deletions
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index 374f8c09d924..3b4894cba92f 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -285,60 +285,17 @@ static struct platform_device cmt_device = {
.num_resources = ARRAY_SIZE(cmt_resources),
};
-static struct sh_timer_config mtu2_0_platform_data = {
- .channel_offset = -0x80,
- .timer_bit = 0,
- .clockevent_rating = 200,
+static struct resource mtu2_resources[] = {
+ DEFINE_RES_MEM(0xfffe4000, 0x400),
+ DEFINE_RES_IRQ_NAMED(146, "tgi0a"),
+ DEFINE_RES_IRQ_NAMED(153, "tgi1a"),
};
-static struct resource mtu2_0_resources[] = {
- [0] = {
- .start = 0xfffe4300,
- .end = 0xfffe4326,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 146,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device mtu2_0_device = {
- .name = "sh_mtu2",
- .id = 0,
- .dev = {
- .platform_data = &mtu2_0_platform_data,
- },
- .resource = mtu2_0_resources,
- .num_resources = ARRAY_SIZE(mtu2_0_resources),
-};
-
-static struct sh_timer_config mtu2_1_platform_data = {
- .channel_offset = -0x100,
- .timer_bit = 1,
- .clockevent_rating = 200,
-};
-
-static struct resource mtu2_1_resources[] = {
- [0] = {
- .start = 0xfffe4380,
- .end = 0xfffe4390,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 153,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device mtu2_1_device = {
- .name = "sh_mtu2",
- .id = 1,
- .dev = {
- .platform_data = &mtu2_1_platform_data,
- },
- .resource = mtu2_1_resources,
- .num_resources = ARRAY_SIZE(mtu2_1_resources),
+static struct platform_device mtu2_device = {
+ .name = "sh-mtu2",
+ .id = -1,
+ .resource = mtu2_resources,
+ .num_resources = ARRAY_SIZE(mtu2_resources),
};
static struct resource rtc_resources[] = {
@@ -367,8 +324,7 @@ static struct platform_device *sh7203_devices[] __initdata = {
&scif2_device,
&scif3_device,
&cmt_device,
- &mtu2_0_device,
- &mtu2_1_device,
+ &mtu2_device,
&rtc_device,
};
@@ -390,8 +346,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = {
&scif2_device,
&scif3_device,
&cmt_device,
- &mtu2_0_device,
- &mtu2_1_device,
+ &mtu2_device,
};
#define STBCR3 0xfffe0408