Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Laurent Pinchart and committed by
Simon Horman
8ec72e46 3df592bc

+15 -90
+2 -6
arch/arm/mach-shmobile/clock-r8a7740.c
··· 548 548 549 549 /* MSTP32 clocks */ 550 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 551 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), 555 552 CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), 556 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 554 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), 561 555 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), 562 556 ··· 597 603 CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]), 598 604 599 605 /* ICK */ 606 + CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP111]), 607 + CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), 600 608 CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), 601 609 CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), 602 610 CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]),
+13 -84
arch/arm/mach-shmobile/setup-r8a7740.c
··· 257 257 }; 258 258 259 259 /* TMU */ 260 - static struct sh_timer_config tmu00_platform_data = { 261 - .name = "TMU00", 262 - .channel_offset = 0x4, 263 - .timer_bit = 0, 264 - .clockevent_rating = 200, 260 + static struct sh_timer_config tmu0_platform_data = { 261 + .channels_mask = 7, 265 262 }; 266 263 267 - static struct resource tmu00_resources[] = { 268 - [0] = { 269 - .name = "TMU00", 270 - .start = 0xfff80008, 271 - .end = 0xfff80014 - 1, 272 - .flags = IORESOURCE_MEM, 273 - }, 274 - [1] = { 275 - .start = gic_spi(198), 276 - .flags = IORESOURCE_IRQ, 277 - }, 264 + static struct resource tmu0_resources[] = { 265 + DEFINE_RES_MEM(0xfff80000, 0x2c), 266 + DEFINE_RES_IRQ(gic_spi(198)), 267 + DEFINE_RES_IRQ(gic_spi(199)), 268 + DEFINE_RES_IRQ(gic_spi(200)), 278 269 }; 279 270 280 - static struct platform_device tmu00_device = { 281 - .name = "sh_tmu", 271 + static struct platform_device tmu0_device = { 272 + .name = "sh-tmu", 282 273 .id = 0, 283 274 .dev = { 284 - .platform_data = &tmu00_platform_data, 275 + .platform_data = &tmu0_platform_data, 285 276 }, 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 - }, 346 - .resource = tmu02_resources, 347 - .num_resources = ARRAY_SIZE(tmu02_resources), 277 + .resource = tmu0_resources, 278 + .num_resources = ARRAY_SIZE(tmu0_resources), 348 279 }; 349 280 350 281 /* IPMMUI (an IPMMU module for ICB/LMB) */ ··· 327 396 &irqpin1_device, 328 397 &irqpin2_device, 329 398 &irqpin3_device, 330 - &tmu00_device, 331 - &tmu01_device, 332 - &tmu02_device, 399 + &tmu0_device, 333 400 &ipmmu_device, 334 401 }; 335 402