diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-23 07:15:18 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-05-11 06:35:28 -0400 |
commit | 8ec72e46067d237dd60a08582e6427159c3f4b5f (patch) | |
tree | 672105aa635ff4ec367bbc2698b961e06edca197 | |
parent | 3df592bc335a6efe30c88c9e39d29ceb5c20bbfb (diff) |
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>
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7740.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7740.c | 97 |
2 files changed, 15 insertions, 90 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index cdb303c657e1..2c1044a55769 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c | |||
@@ -548,15 +548,9 @@ static struct clk_lookup lookups[] = { | |||
548 | 548 | ||
549 | /* MSTP32 clocks */ | 549 | /* MSTP32 clocks */ |
550 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), | 550 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), |
551 | CLKDEV_DEV_ID("sh_tmu.3", &mstp_clks[MSTP111]), | ||
552 | CLKDEV_DEV_ID("sh_tmu.4", &mstp_clks[MSTP111]), | ||
553 | CLKDEV_DEV_ID("sh_tmu.5", &mstp_clks[MSTP111]), | ||
554 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), | 551 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), |
555 | CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), | 552 | CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), |
556 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), | 553 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), |
557 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), | ||
558 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), | ||
559 | CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP125]), | ||
560 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), | 554 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), |
561 | CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), | 555 | CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), |
562 | 556 | ||
@@ -603,6 +597,8 @@ static struct clk_lookup lookups[] = { | |||
603 | CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]), | 597 | CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]), |
604 | 598 | ||
605 | /* ICK */ | 599 | /* ICK */ |
600 | CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP111]), | ||
601 | CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), | ||
606 | CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), | 602 | CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), |
607 | CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), | 603 | CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), |
608 | CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]), | 604 | CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]), |
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 495e9bd66040..b7a09bb45fc9 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -257,94 +257,25 @@ static struct platform_device cmt1_device = { | |||
257 | }; | 257 | }; |
258 | 258 | ||
259 | /* TMU */ | 259 | /* TMU */ |
260 | static struct sh_timer_config tmu00_platform_data = { | 260 | static struct sh_timer_config tmu0_platform_data = { |
261 | .name = "TMU00", | 261 | .channels_mask = 7, |
262 | .channel_offset = 0x4, | ||
263 | .timer_bit = 0, | ||
264 | .clockevent_rating = 200, | ||
265 | }; | 262 | }; |
266 | 263 | ||
267 | static struct resource tmu00_resources[] = { | 264 | static struct resource tmu0_resources[] = { |
268 | [0] = { | 265 | DEFINE_RES_MEM(0xfff80000, 0x2c), |
269 | .name = "TMU00", | 266 | DEFINE_RES_IRQ(gic_spi(198)), |
270 | .start = 0xfff80008, | 267 | DEFINE_RES_IRQ(gic_spi(199)), |
271 | .end = 0xfff80014 - 1, | 268 | DEFINE_RES_IRQ(gic_spi(200)), |
272 | .flags = IORESOURCE_MEM, | ||
273 | }, | ||
274 | [1] = { | ||
275 | .start = gic_spi(198), | ||
276 | .flags = IORESOURCE_IRQ, | ||
277 | }, | ||
278 | }; | 269 | }; |
279 | 270 | ||
280 | static struct platform_device tmu00_device = { | 271 | static struct platform_device tmu0_device = { |
281 | .name = "sh_tmu", | 272 | .name = "sh-tmu", |
282 | .id = 0, | 273 | .id = 0, |
283 | .dev = { | 274 | .dev = { |
284 | .platform_data = &tmu00_platform_data, | 275 | .platform_data = &tmu0_platform_data, |
285 | }, | ||
286 | .resource = tmu00_resources, | ||
287 | .num_resources = ARRAY_SIZE(tmu00_resources), | ||
288 | }; | ||
289 | |||
290 | static struct sh_timer_config tmu01_platform_data = { | ||
291 | .name = "TMU01", | ||
292 | .channel_offset = 0x10, | ||
293 | .timer_bit = 1, | ||
294 | .clocksource_rating = 200, | ||
295 | }; | ||
296 | |||
297 | static struct resource tmu01_resources[] = { | ||
298 | [0] = { | ||
299 | .name = "TMU01", | ||
300 | .start = 0xfff80014, | ||
301 | .end = 0xfff80020 - 1, | ||
302 | .flags = IORESOURCE_MEM, | ||
303 | }, | ||
304 | [1] = { | ||
305 | .start = gic_spi(199), | ||
306 | .flags = IORESOURCE_IRQ, | ||
307 | }, | ||
308 | }; | ||
309 | |||
310 | static struct platform_device tmu01_device = { | ||
311 | .name = "sh_tmu", | ||
312 | .id = 1, | ||
313 | .dev = { | ||
314 | .platform_data = &tmu01_platform_data, | ||
315 | }, | ||
316 | .resource = tmu01_resources, | ||
317 | .num_resources = ARRAY_SIZE(tmu01_resources), | ||
318 | }; | ||
319 | |||
320 | static struct sh_timer_config tmu02_platform_data = { | ||
321 | .name = "TMU02", | ||
322 | .channel_offset = 0x1C, | ||
323 | .timer_bit = 2, | ||
324 | .clocksource_rating = 200, | ||
325 | }; | ||
326 | |||
327 | static struct resource tmu02_resources[] = { | ||
328 | [0] = { | ||
329 | .name = "TMU02", | ||
330 | .start = 0xfff80020, | ||
331 | .end = 0xfff8002C - 1, | ||
332 | .flags = IORESOURCE_MEM, | ||
333 | }, | ||
334 | [1] = { | ||
335 | .start = gic_spi(200), | ||
336 | .flags = IORESOURCE_IRQ, | ||
337 | }, | ||
338 | }; | ||
339 | |||
340 | static struct platform_device tmu02_device = { | ||
341 | .name = "sh_tmu", | ||
342 | .id = 2, | ||
343 | .dev = { | ||
344 | .platform_data = &tmu02_platform_data, | ||
345 | }, | 276 | }, |
346 | .resource = tmu02_resources, | 277 | .resource = tmu0_resources, |
347 | .num_resources = ARRAY_SIZE(tmu02_resources), | 278 | .num_resources = ARRAY_SIZE(tmu0_resources), |
348 | }; | 279 | }; |
349 | 280 | ||
350 | /* IPMMUI (an IPMMU module for ICB/LMB) */ | 281 | /* IPMMUI (an IPMMU module for ICB/LMB) */ |
@@ -396,9 +327,7 @@ static struct platform_device *r8a7740_early_devices[] __initdata = { | |||
396 | &irqpin1_device, | 327 | &irqpin1_device, |
397 | &irqpin2_device, | 328 | &irqpin2_device, |
398 | &irqpin3_device, | 329 | &irqpin3_device, |
399 | &tmu00_device, | 330 | &tmu0_device, |
400 | &tmu01_device, | ||
401 | &tmu02_device, | ||
402 | &ipmmu_device, | 331 | &ipmmu_device, |
403 | }; | 332 | }; |
404 | 333 | ||