ARM: shmobile: sh73a0: Switch to new style TMU device
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 23 Apr 2014 11:15:17 +0000 (13:15 +0200)
committerSimon Horman <horms+renesas@verge.net.au>
Sun, 11 May 2014 10:35:28 +0000 (19:35 +0900)
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>
arch/arm/mach-shmobile/clock-sh73a0.c
arch/arm/mach-shmobile/setup-sh73a0.c

index ca03989c0d784df278c64ca49ff5d0d6f7e645b9..0d9cd1fe02124fdb8573bf66da0cbc8b5a33e9c7 100644 (file)
@@ -633,8 +633,6 @@ static struct clk_lookup lookups[] = {
        CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */
        CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */
        CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */
-       CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
-       CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
        CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */
        CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
        CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */
@@ -683,6 +681,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
        CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
        CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), /* CMT1 */
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */
 };
 
 void __init sh73a0_clock_init(void)
index 71d0e4460a104aaf95fbafc3b759416bde8b0c79..ad00724a2269ffd5ce8daa68c5a829a5473bf7b1 100644 (file)
@@ -124,54 +124,25 @@ static struct platform_device cmt1_device = {
 };
 
 /* TMU */
-static struct sh_timer_config tmu00_platform_data = {
-       .name = "TMU00",
-       .channel_offset = 0x4,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+static struct sh_timer_config tmu0_platform_data = {
+       .channels_mask = 7,
 };
 
-static struct resource tmu00_resources[] = {
-       [0] = DEFINE_RES_MEM(0xfff60008, 0xc),
-       [1] = {
-               .start  = intcs_evt2irq(0x0e80), /* TMU0_TUNI00 */
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource tmu0_resources[] = {
+       DEFINE_RES_MEM(0xfff60000, 0x2c),
+       DEFINE_RES_IRQ(intcs_evt2irq(0xe80)),
+       DEFINE_RES_IRQ(intcs_evt2irq(0xea0)),
+       DEFINE_RES_IRQ(intcs_evt2irq(0xec0)),
 };
 
-static struct platform_device tmu00_device = {
-       .name           = "sh_tmu",
+static struct platform_device tmu0_device = {
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
-               .platform_data  = &tmu00_platform_data,
-       },
-       .resource       = tmu00_resources,
-       .num_resources  = ARRAY_SIZE(tmu00_resources),
-};
-
-static struct sh_timer_config tmu01_platform_data = {
-       .name = "TMU01",
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu01_resources[] = {
-       [0] = DEFINE_RES_MEM(0xfff60014, 0xc),
-       [1] = {
-               .start  = intcs_evt2irq(0x0ea0), /* TMU0_TUNI01 */
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu01_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu01_platform_data,
+               .platform_data  = &tmu0_platform_data,
        },
-       .resource       = tmu01_resources,
-       .num_resources  = ARRAY_SIZE(tmu01_resources),
+       .resource       = tmu0_resources,
+       .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
 static struct resource i2c0_resources[] = {
@@ -738,8 +709,7 @@ static struct platform_device *sh73a0_devices_dt[] __initdata = {
 };
 
 static struct platform_device *sh73a0_early_devices[] __initdata = {
-       &tmu00_device,
-       &tmu01_device,
+       &tmu0_device,
        &ipmmu_device,
 };