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

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>

authored by

Laurent Pinchart and committed by
Simon Horman
535ef0d9 8ec72e46

+10 -24
+2 -2
arch/arm/mach-shmobile/clock-r8a7778.c
··· 207 207 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ 208 208 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ 209 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 210 CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ 213 211 CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ 214 212 CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ ··· 237 239 CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]), 238 240 CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]), 239 241 CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]), 242 + CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), 243 + CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]), 240 244 }; 241 245 242 246 void __init r8a7778_clock_init(void)
+8 -22
arch/arm/mach-shmobile/setup-r8a7778.c
··· 71 71 sizeof(scif##index##_platform_data)) 72 72 73 73 /* TMU */ 74 - static struct resource sh_tmu0_resources[] __initdata = { 75 - DEFINE_RES_MEM(0xffd80008, 12), 74 + static struct sh_timer_config sh_tmu0_platform_data = { 75 + .channels_mask = 7, 76 + }; 77 + 78 + static struct resource sh_tmu0_resources[] = { 79 + DEFINE_RES_MEM(0xffd80000, 0x30), 76 80 DEFINE_RES_IRQ(gic_iid(0x40)), 77 - }; 78 - 79 - static 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 - }; 85 - 86 - static struct resource sh_tmu1_resources[] __initdata = { 87 - DEFINE_RES_MEM(0xffd80014, 12), 88 81 DEFINE_RES_IRQ(gic_iid(0x41)), 89 - }; 90 - 91 - static struct sh_timer_config sh_tmu1_platform_data __initdata = { 92 - .name = "TMU01", 93 - .channel_offset = 0x10, 94 - .timer_bit = 1, 95 - .clocksource_rating = 200, 82 + DEFINE_RES_IRQ(gic_iid(0x42)), 96 83 }; 97 84 98 85 #define r8a7778_register_tmu(idx) \ 99 86 platform_device_register_resndata( \ 100 - &platform_bus, "sh_tmu", idx, \ 87 + &platform_bus, "sh-tmu", idx, \ 101 88 sh_tmu##idx##_resources, \ 102 89 ARRAY_SIZE(sh_tmu##idx##_resources), \ 103 90 &sh_tmu##idx##_platform_data, \ ··· 299 312 r8a7778_register_scif(4); 300 313 r8a7778_register_scif(5); 301 314 r8a7778_register_tmu(0); 302 - r8a7778_register_tmu(1); 303 315 } 304 316 305 317 /* HPB-DMA */