diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-23 13:15:08 +0200 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-05-11 19:35:26 +0900 |
commit | 9b17e48cd4df4e129976c37660cf9ec644c66059 (patch) | |
tree | 22f1db2ada8bb0029b7d61fb0d5609b146262055 /arch/sh/kernel/cpu/sh2a/setup-sh7264.c | |
parent | 1c41ecb60b3de08d341be13de1dfc3d907b82694 (diff) | |
download | talos-op-linux-9b17e48cd4df4e129976c37660cf9ec644c66059.tar.gz talos-op-linux-9b17e48cd4df4e129976c37660cf9ec644c66059.zip |
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>
Diffstat (limited to 'arch/sh/kernel/cpu/sh2a/setup-sh7264.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 69 |
1 files changed, 13 insertions, 56 deletions
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c index ad5b0f429882..e95250e82752 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c @@ -433,65 +433,24 @@ static struct platform_device scif7_device = { }, }; -static struct sh_timer_config cmt0_platform_data = { - .channel_offset = 0x02, - .timer_bit = 0, - .clockevent_rating = 125, - .clocksource_rating = 0, /* disabled due to code generation issues */ +static struct sh_timer_config cmt_platform_data = { + .channels_mask = 3, }; -static struct resource cmt0_resources[] = { - [0] = { - .name = "CMT0", - .start = 0xfffec002, - .end = 0xfffec007, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 175, - .flags = IORESOURCE_IRQ, - }, +static struct resource cmt_resources[] = { + DEFINE_RES_MEM(0xfffec000, 0x10), + DEFINE_RES_IRQ(175), + DEFINE_RES_IRQ(176), }; -static struct platform_device cmt0_device = { - .name = "sh_cmt", +static struct platform_device cmt_device = { + .name = "sh-cmt-16", .id = 0, .dev = { - .platform_data = &cmt0_platform_data, - }, - .resource = cmt0_resources, - .num_resources = ARRAY_SIZE(cmt0_resources), -}; - -static struct sh_timer_config cmt1_platform_data = { - .name = "CMT1", - .channel_offset = 0x08, - .timer_bit = 1, - .clockevent_rating = 125, - .clocksource_rating = 0, /* disabled due to code generation issues */ -}; - -static struct resource cmt1_resources[] = { - [0] = { - .name = "CMT1", - .start = 0xfffec008, - .end = 0xfffec00d, - .flags = IORESOURCE_MEM, - }, - [1] = { - .start = 176, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device cmt1_device = { - .name = "sh_cmt", - .id = 1, - .dev = { - .platform_data = &cmt1_platform_data, + .platform_data = &cmt_platform_data, }, - .resource = cmt1_resources, - .num_resources = ARRAY_SIZE(cmt1_resources), + .resource = cmt_resources, + .num_resources = ARRAY_SIZE(cmt_resources), }; static struct sh_timer_config mtu2_0_platform_data = { @@ -620,8 +579,7 @@ static struct platform_device *sh7264_devices[] __initdata = { &scif5_device, &scif6_device, &scif7_device, - &cmt0_device, - &cmt1_device, + &cmt_device, &mtu2_0_device, &mtu2_1_device, &rtc_device, @@ -649,8 +607,7 @@ static struct platform_device *sh7264_early_devices[] __initdata = { &scif5_device, &scif6_device, &scif7_device, - &cmt0_device, - &cmt1_device, + &cmt_device, &mtu2_0_device, &mtu2_1_device, }; |