aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-05-02 14:21:25 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-05-11 06:35:28 -0400
commit535ef0d9575b0809915341481ef3bac6bb5d0aaa (patch)
tree179777308fa168ede80ab3375c64e821add84443
parent8ec72e46067d237dd60a08582e6427159c3f4b5f (diff)
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>
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c4
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c28
2 files changed, 9 insertions, 23 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 201fc487e4e1..65f08f75d117 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -207,8 +207,6 @@ static struct clk_lookup lookups[] = {
207 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ 207 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
208 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ 208 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
209 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ 209 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
210 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
211 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
212 CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ 210 CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
213 CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ 211 CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
214 CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ 212 CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
@@ -239,6 +237,8 @@ static struct clk_lookup lookups[] = {
239 CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]), 237 CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
240 CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]), 238 CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
241 CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]), 239 CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
240 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
241 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
242}; 242};
243 243
244void __init r8a7778_clock_init(void) 244void __init r8a7778_clock_init(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 6d694526e4ca..8c02e24f2483 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
71 sizeof(scif##index##_platform_data)) 71 sizeof(scif##index##_platform_data))
72 72
73/* TMU */ 73/* TMU */
74static struct resource sh_tmu0_resources[] __initdata = { 74static struct sh_timer_config sh_tmu0_platform_data = {
75 DEFINE_RES_MEM(0xffd80008, 12), 75 .channels_mask = 7,
76 DEFINE_RES_IRQ(gic_iid(0x40)),
77};
78
79static struct sh_timer_config sh_tmu0_platform_data __initdata = {
80 .name = "TMU00",
81 .channel_offset = 0x4,
82 .timer_bit = 0,
83 .clockevent_rating = 200,
84}; 76};
85 77
86static struct resource sh_tmu1_resources[] __initdata = { 78static struct resource sh_tmu0_resources[] = {
87 DEFINE_RES_MEM(0xffd80014, 12), 79 DEFINE_RES_MEM(0xffd80000, 0x30),
80 DEFINE_RES_IRQ(gic_iid(0x40)),
88 DEFINE_RES_IRQ(gic_iid(0x41)), 81 DEFINE_RES_IRQ(gic_iid(0x41)),
89}; 82 DEFINE_RES_IRQ(gic_iid(0x42)),
90
91static struct sh_timer_config sh_tmu1_platform_data __initdata = {
92 .name = "TMU01",
93 .channel_offset = 0x10,
94 .timer_bit = 1,
95 .clocksource_rating = 200,
96}; 83};
97 84
98#define r8a7778_register_tmu(idx) \ 85#define r8a7778_register_tmu(idx) \
99 platform_device_register_resndata( \ 86 platform_device_register_resndata( \
100 &platform_bus, "sh_tmu", idx, \ 87 &platform_bus, "sh-tmu", idx, \
101 sh_tmu##idx##_resources, \ 88 sh_tmu##idx##_resources, \
102 ARRAY_SIZE(sh_tmu##idx##_resources), \ 89 ARRAY_SIZE(sh_tmu##idx##_resources), \
103 &sh_tmu##idx##_platform_data, \ 90 &sh_tmu##idx##_platform_data, \
@@ -312,7 +299,6 @@ void __init r8a7778_add_dt_devices(void)
312 r8a7778_register_scif(4); 299 r8a7778_register_scif(4);
313 r8a7778_register_scif(5); 300 r8a7778_register_scif(5);
314 r8a7778_register_tmu(0); 301 r8a7778_register_tmu(0);
315 r8a7778_register_tmu(1);
316} 302}
317 303
318/* HPB-DMA */ 304/* HPB-DMA */