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

ARM: shmobile: r8a7779: 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
e4ae34e2 535ef0d9

+14 -56
+1 -3
arch/arm/mach-shmobile/clock-r8a7779.c
··· 173 173 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 174 174 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 175 175 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 176 - CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ 177 - CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */ 178 - CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */ 176 + CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), /* TMU0 */ 179 177 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 180 178 CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */ 181 179 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
+13 -53
arch/arm/mach-shmobile/setup-r8a7779.c
··· 219 219 R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); 220 220 221 221 /* TMU */ 222 - static struct sh_timer_config tmu00_platform_data = { 223 - .name = "TMU00", 224 - .channel_offset = 0x4, 225 - .timer_bit = 0, 226 - .clockevent_rating = 200, 222 + static struct sh_timer_config tmu0_platform_data = { 223 + .channels_mask = 7, 227 224 }; 228 225 229 - static struct resource tmu00_resources[] = { 230 - [0] = { 231 - .name = "TMU00", 232 - .start = 0xffd80008, 233 - .end = 0xffd80013, 234 - .flags = IORESOURCE_MEM, 235 - }, 236 - [1] = { 237 - .start = gic_iid(0x40), 238 - .flags = IORESOURCE_IRQ, 239 - }, 226 + static struct resource tmu0_resources[] = { 227 + DEFINE_RES_MEM(0xffd80000, 0x30), 228 + DEFINE_RES_IRQ(gic_iid(0x40)), 229 + DEFINE_RES_IRQ(gic_iid(0x41)), 230 + DEFINE_RES_IRQ(gic_iid(0x42)), 240 231 }; 241 232 242 - static struct platform_device tmu00_device = { 243 - .name = "sh_tmu", 233 + static struct platform_device tmu0_device = { 234 + .name = "sh-tmu", 244 235 .id = 0, 245 236 .dev = { 246 - .platform_data = &tmu00_platform_data, 237 + .platform_data = &tmu0_platform_data, 247 238 }, 248 - .resource = tmu00_resources, 249 - .num_resources = ARRAY_SIZE(tmu00_resources), 250 - }; 251 - 252 - static struct sh_timer_config tmu01_platform_data = { 253 - .name = "TMU01", 254 - .channel_offset = 0x10, 255 - .timer_bit = 1, 256 - .clocksource_rating = 200, 257 - }; 258 - 259 - static struct resource tmu01_resources[] = { 260 - [0] = { 261 - .name = "TMU01", 262 - .start = 0xffd80014, 263 - .end = 0xffd8001f, 264 - .flags = IORESOURCE_MEM, 265 - }, 266 - [1] = { 267 - .start = gic_iid(0x41), 268 - .flags = IORESOURCE_IRQ, 269 - }, 270 - }; 271 - 272 - static struct platform_device tmu01_device = { 273 - .name = "sh_tmu", 274 - .id = 1, 275 - .dev = { 276 - .platform_data = &tmu01_platform_data, 277 - }, 278 - .resource = tmu01_resources, 279 - .num_resources = ARRAY_SIZE(tmu01_resources), 239 + .resource = tmu0_resources, 240 + .num_resources = ARRAY_SIZE(tmu0_resources), 280 241 }; 281 242 282 243 /* I2C */ ··· 646 685 &scif3_device, 647 686 &scif4_device, 648 687 &scif5_device, 649 - &tmu00_device, 650 - &tmu01_device, 688 + &tmu0_device, 651 689 }; 652 690 653 691 static struct platform_device *r8a7779_standard_devices[] __initdata = {