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

ARM: shmobile: r7s72100: Switch to new style MTU2 device

The MTU2 (Multi-Function Timer Pulse Unit 2) 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>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

authored by

Laurent Pinchart and committed by
Simon Horman
c17fcfbc 5204601c

+10 -18
+1 -1
arch/arm/mach-shmobile/clock-r7s72100.c
··· 204 204 CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]), 205 205 CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]), 206 206 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]), 207 - CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]), 208 207 209 208 /* ICK */ 210 209 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]), ··· 214 215 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), 215 216 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), 216 217 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), 218 + CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP33]), 217 219 }; 218 220 219 221 void __init r7s72100_clock_init(void)
+9 -17
arch/arm/mach-shmobile/setup-r7s72100.c
··· 62 62 sizeof(scif##index##_platform_data)) 63 63 64 64 65 - static struct sh_timer_config mtu2_0_platform_data __initdata = { 66 - .name = "MTU2_0", 67 - .timer_bit = 0, 68 - .channel_offset = -0x80, 69 - .clockevent_rating = 200, 65 + static struct resource mtu2_resources[] __initdata = { 66 + DEFINE_RES_MEM(0xfcff0000, 0x400), 67 + DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"), 70 68 }; 71 69 72 - static struct resource mtu2_0_resources[] __initdata = { 73 - DEFINE_RES_MEM(0xfcff0300, 0x27), 74 - DEFINE_RES_IRQ(gic_iid(139)), /* MTU2 TGI0A */ 75 - }; 76 - 77 - #define r7s72100_register_mtu2(idx) \ 78 - platform_device_register_resndata(&platform_bus, "sh_mtu2", \ 79 - idx, mtu2_##idx##_resources, \ 80 - ARRAY_SIZE(mtu2_##idx##_resources), \ 81 - &mtu2_##idx##_platform_data, \ 82 - sizeof(struct sh_timer_config)) 70 + #define r7s72100_register_mtu2() \ 71 + platform_device_register_resndata(&platform_bus, "sh-mtu2", \ 72 + -1, mtu2_resources, \ 73 + ARRAY_SIZE(mtu2_resources), \ 74 + NULL, 0) 83 75 84 76 void __init r7s72100_add_dt_devices(void) 85 77 { ··· 83 91 r7s72100_register_scif(5); 84 92 r7s72100_register_scif(6); 85 93 r7s72100_register_scif(7); 86 - r7s72100_register_mtu2(0); 94 + r7s72100_register_mtu2(); 87 95 } 88 96 89 97 void __init r7s72100_init_early(void)