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

ARM: shmobile: sh73a0: 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
3df592bc 8e8236a9

+14 -45
+1 -2
arch/arm/mach-shmobile/clock-sh73a0.c
··· 633 633 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */ 634 634 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */ 635 635 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */ 636 - CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */ 637 - CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */ 638 636 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ 639 637 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 640 638 CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */ ··· 681 683 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk), 682 684 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk), 683 685 CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), /* CMT1 */ 686 + CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */ 684 687 }; 685 688 686 689 void __init sh73a0_clock_init(void)
+13 -43
arch/arm/mach-shmobile/setup-sh73a0.c
··· 124 124 }; 125 125 126 126 /* TMU */ 127 - static struct sh_timer_config tmu00_platform_data = { 128 - .name = "TMU00", 129 - .channel_offset = 0x4, 130 - .timer_bit = 0, 131 - .clockevent_rating = 200, 127 + static struct sh_timer_config tmu0_platform_data = { 128 + .channels_mask = 7, 132 129 }; 133 130 134 - static struct resource tmu00_resources[] = { 135 - [0] = DEFINE_RES_MEM(0xfff60008, 0xc), 136 - [1] = { 137 - .start = intcs_evt2irq(0x0e80), /* TMU0_TUNI00 */ 138 - .flags = IORESOURCE_IRQ, 139 - }, 131 + static struct resource tmu0_resources[] = { 132 + DEFINE_RES_MEM(0xfff60000, 0x2c), 133 + DEFINE_RES_IRQ(intcs_evt2irq(0xe80)), 134 + DEFINE_RES_IRQ(intcs_evt2irq(0xea0)), 135 + DEFINE_RES_IRQ(intcs_evt2irq(0xec0)), 140 136 }; 141 137 142 - static struct platform_device tmu00_device = { 143 - .name = "sh_tmu", 138 + static struct platform_device tmu0_device = { 139 + .name = "sh-tmu", 144 140 .id = 0, 145 141 .dev = { 146 - .platform_data = &tmu00_platform_data, 142 + .platform_data = &tmu0_platform_data, 147 143 }, 148 - .resource = tmu00_resources, 149 - .num_resources = ARRAY_SIZE(tmu00_resources), 150 - }; 151 - 152 - static struct sh_timer_config tmu01_platform_data = { 153 - .name = "TMU01", 154 - .channel_offset = 0x10, 155 - .timer_bit = 1, 156 - .clocksource_rating = 200, 157 - }; 158 - 159 - static struct resource tmu01_resources[] = { 160 - [0] = DEFINE_RES_MEM(0xfff60014, 0xc), 161 - [1] = { 162 - .start = intcs_evt2irq(0x0ea0), /* TMU0_TUNI01 */ 163 - .flags = IORESOURCE_IRQ, 164 - }, 165 - }; 166 - 167 - static struct platform_device tmu01_device = { 168 - .name = "sh_tmu", 169 - .id = 1, 170 - .dev = { 171 - .platform_data = &tmu01_platform_data, 172 - }, 173 - .resource = tmu01_resources, 174 - .num_resources = ARRAY_SIZE(tmu01_resources), 144 + .resource = tmu0_resources, 145 + .num_resources = ARRAY_SIZE(tmu0_resources), 175 146 }; 176 147 177 148 static struct resource i2c0_resources[] = { ··· 709 738 }; 710 739 711 740 static struct platform_device *sh73a0_early_devices[] __initdata = { 712 - &tmu00_device, 713 - &tmu01_device, 741 + &tmu0_device, 714 742 &ipmmu_device, 715 743 }; 716 744