sh: Switch to new style CMT device
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 23 Apr 2014 11:15:08 +0000 (13:15 +0200)
committerSimon Horman <horms+renesas@verge.net.au>
Sun, 11 May 2014 10:35:26 +0000 (19:35 +0900)
The CMT (Compare Match Timer) 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>
19 files changed:
arch/sh/kernel/cpu/clock-cpg.c
arch/sh/kernel/cpu/sh2/setup-sh7619.c
arch/sh/kernel/cpu/sh2a/clock-sh7264.c
arch/sh/kernel/cpu/sh2a/clock-sh7269.c
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
arch/sh/kernel/cpu/sh2a/setup-sh7264.c
arch/sh/kernel/cpu/sh2a/setup-sh7269.c
arch/sh/kernel/cpu/sh3/setup-sh7720.c
arch/sh/kernel/cpu/sh4a/clock-sh7343.c
arch/sh/kernel/cpu/sh4a/clock-sh7366.c
arch/sh/kernel/cpu/sh4a/clock-sh7722.c
arch/sh/kernel/cpu/sh4a/clock-sh7723.c
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c

index f59b1f30d44ba37f39b687cc19cfed409a17413f..8de314b8e5df3c70d4912caa4fa7d1fa724bd94e 100644 (file)
@@ -58,7 +58,8 @@ int __init __deprecated cpg_clk_init(void)
 
        clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL);
        clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
-       clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
        clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL);
 
        return ret;
index 3860b0be56c770b831349f681c0d217bfa4a8b94..58c19adae900975b2a4dc9f366dcf046ba4e4674 100644 (file)
@@ -152,62 +152,24 @@ static struct platform_device eth_device = {
        .resource = eth_resources,
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 3,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .start  = 0xf84a0072,
-               .end    = 0xf84a0077,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 86,
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0xf84a0070, 0x10),
+       DEFINE_RES_IRQ(86),
+       DEFINE_RES_IRQ(87),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-16",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .channel_offset = 0x08,
-       .timer_bit = 1,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .start  = 0xf84a0078,
-               .end    = 0xf84a007d,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 87,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct platform_device *sh7619_devices[] __initdata = {
@@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = {
        &scif1_device,
        &scif2_device,
        &eth_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
 };
 
 static int __init sh7619_devices_setup(void)
@@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif2_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
 };
 
 #define STBCR3 0xf80a0000
index fdf585c95289f7a3bc66a6029f32a1438e3ae625..c7f3c666a0acee1ee863cc68aa77ba045b64df33 100644 (file)
@@ -117,7 +117,7 @@ static struct clk_lookup lookups[] = {
        /* MSTP clocks */
        CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
        CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
        CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
        CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
        CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
index 6b787620de99bf444953244cec878a32761529dd..4f47464f2fb692b91233d1d2c994da3152ed026f 100644 (file)
@@ -158,7 +158,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
        CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
        CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
        CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
index d55a0f30ada394fece4fd926ce5ba18c77576e41..374f8c09d9249ff68666e8116f37eb97732561a0 100644 (file)
@@ -265,62 +265,24 @@ static struct platform_device scif3_device = {
        },
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 3,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .start  = 0xfffec002,
-               .end    = 0xfffec007,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 142,
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0xfffec000, 0x10),
+       DEFINE_RES_IRQ(142),
+       DEFINE_RES_IRQ(143),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-16",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .channel_offset = 0x08,
-       .timer_bit = 1,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .start  = 0xfffec008,
-               .end    = 0xfffec00d,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 143,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct sh_timer_config mtu2_0_platform_data = {
@@ -404,8 +366,7 @@ static struct platform_device *sh7203_devices[] __initdata = {
        &scif1_device,
        &scif2_device,
        &scif3_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
        &rtc_device,
@@ -428,8 +389,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = {
        &scif1_device,
        &scif2_device,
        &scif3_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
 };
index 241e745e3ced58260fbb0ead642f5c1fff72208a..d00e6fd998ec2f1ee9addcc231415cdc77aaaf49 100644 (file)
@@ -217,62 +217,24 @@ static struct platform_device scif3_device = {
        },
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 3,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .start  = 0xfffec002,
-               .end    = 0xfffec007,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 140,
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0xfffec000, 0x10),
+       DEFINE_RES_IRQ(140),
+       DEFINE_RES_IRQ(144),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-16",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .channel_offset = 0x08,
-       .timer_bit = 1,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .start  = 0xfffec008,
-               .end    = 0xfffec00d,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 144,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct sh_timer_config mtu2_0_platform_data = {
@@ -364,8 +326,7 @@ static struct platform_device *sh7206_devices[] __initdata = {
        &scif1_device,
        &scif2_device,
        &scif3_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
        &mtu2_2_device,
@@ -388,8 +349,7 @@ static struct platform_device *sh7206_early_devices[] __initdata = {
        &scif1_device,
        &scif2_device,
        &scif3_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
        &mtu2_2_device,
index ad5b0f429882a70e4b2b1604995051370c214f8d..e95250e8275236c4c481799a31f01dbb6dd22e53 100644 (file)
@@ -433,65 +433,24 @@ static struct platform_device scif7_device = {
        },
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 3,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .name   = "CMT0",
-               .start  = 0xfffec002,
-               .end    = 0xfffec007,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 175,
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0xfffec000, 0x10),
+       DEFINE_RES_IRQ(175),
+       DEFINE_RES_IRQ(176),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-16",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .name = "CMT1",
-       .channel_offset = 0x08,
-       .timer_bit = 1,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .name   = "CMT1",
-               .start  = 0xfffec008,
-               .end    = 0xfffec00d,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 176,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct sh_timer_config mtu2_0_platform_data = {
@@ -620,8 +579,7 @@ static struct platform_device *sh7264_devices[] __initdata = {
        &scif5_device,
        &scif6_device,
        &scif7_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
        &rtc_device,
@@ -649,8 +607,7 @@ static struct platform_device *sh7264_early_devices[] __initdata = {
        &scif5_device,
        &scif6_device,
        &scif7_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
 };
index 3995119f65dc748078d66527d3f096af8d4c25e7..0191e1ae8411db155b1079eb18714c1f2bcfe368 100644 (file)
@@ -455,62 +455,24 @@ static struct platform_device scif7_device = {
        },
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 3,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .start  = 0xfffec002,
-               .end    = 0xfffec007,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 188,
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0xfffec000, 0x10),
+       DEFINE_RES_IRQ(188),
+       DEFINE_RES_IRQ(189),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-16",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .channel_offset = 0x08,
-       .timer_bit = 1,
-       .clockevent_rating = 125,
-       .clocksource_rating = 0, /* disabled due to code generation issues */
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .start  = 0xfffec008,
-               .end    = 0xfffec00d,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 189,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct sh_timer_config mtu2_0_platform_data = {
@@ -629,8 +591,7 @@ static struct platform_device *sh7269_devices[] __initdata = {
        &scif5_device,
        &scif6_device,
        &scif7_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
        &rtc_device,
@@ -658,8 +619,7 @@ static struct platform_device *sh7269_early_devices[] __initdata = {
        &scif5_device,
        &scif6_device,
        &scif7_device,
-       &cmt0_device,
-       &cmt1_device,
+       &cmt_device,
        &mtu2_0_device,
        &mtu2_1_device,
 };
index 1d5729dc072401d76faf8fffd622dbaa9995afd9..a53d21925b9422695fef43154302becbe77a91be 100644 (file)
@@ -152,141 +152,23 @@ static struct platform_device usbf_device = {
        .resource       = usbf_resources,
 };
 
-static struct sh_timer_config cmt0_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 0,
-       .clockevent_rating = 125,
-       .clocksource_rating = 125,
+static struct sh_timer_config cmt_platform_data = {
+       .channels_mask = 0x1f,
 };
 
-static struct resource cmt0_resources[] = {
-       [0] = {
-               .start  = 0x044a0010,
-               .end    = 0x044a001b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+static struct resource cmt_resources[] = {
+       DEFINE_RES_MEM(0x044a0000, 0x60),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
-static struct platform_device cmt0_device = {
-       .name           = "sh_cmt",
+static struct platform_device cmt_device = {
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
-               .platform_data  = &cmt0_platform_data,
-       },
-       .resource       = cmt0_resources,
-       .num_resources  = ARRAY_SIZE(cmt0_resources),
-};
-
-static struct sh_timer_config cmt1_platform_data = {
-       .channel_offset = 0x20,
-       .timer_bit = 1,
-};
-
-static struct resource cmt1_resources[] = {
-       [0] = {
-               .start  = 0x044a0020,
-               .end    = 0x044a002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt1_device = {
-       .name           = "sh_cmt",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &cmt1_platform_data,
-       },
-       .resource       = cmt1_resources,
-       .num_resources  = ARRAY_SIZE(cmt1_resources),
-};
-
-static struct sh_timer_config cmt2_platform_data = {
-       .channel_offset = 0x30,
-       .timer_bit = 2,
-};
-
-static struct resource cmt2_resources[] = {
-       [0] = {
-               .start  = 0x044a0030,
-               .end    = 0x044a003b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt2_device = {
-       .name           = "sh_cmt",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &cmt2_platform_data,
-       },
-       .resource       = cmt2_resources,
-       .num_resources  = ARRAY_SIZE(cmt2_resources),
-};
-
-static struct sh_timer_config cmt3_platform_data = {
-       .channel_offset = 0x40,
-       .timer_bit = 3,
-};
-
-static struct resource cmt3_resources[] = {
-       [0] = {
-               .start  = 0x044a0040,
-               .end    = 0x044a004b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt3_device = {
-       .name           = "sh_cmt",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &cmt3_platform_data,
-       },
-       .resource       = cmt3_resources,
-       .num_resources  = ARRAY_SIZE(cmt3_resources),
-};
-
-static struct sh_timer_config cmt4_platform_data = {
-       .channel_offset = 0x50,
-       .timer_bit = 4,
-};
-
-static struct resource cmt4_resources[] = {
-       [0] = {
-               .start  = 0x044a0050,
-               .end    = 0x044a005b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device cmt4_device = {
-       .name           = "sh_cmt",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &cmt4_platform_data,
+               .platform_data  = &cmt_platform_data,
        },
-       .resource       = cmt4_resources,
-       .num_resources  = ARRAY_SIZE(cmt4_resources),
+       .resource       = cmt_resources,
+       .num_resources  = ARRAY_SIZE(cmt_resources),
 };
 
 static struct sh_timer_config tmu0_platform_data = {
@@ -375,11 +257,7 @@ static struct platform_device tmu2_device = {
 static struct platform_device *sh7720_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
-       &cmt0_device,
-       &cmt1_device,
-       &cmt2_device,
-       &cmt3_device,
-       &cmt4_device,
+       &cmt_device,
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
@@ -398,11 +276,7 @@ arch_initcall(sh7720_devices_setup);
 static struct platform_device *sh7720_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
-       &cmt0_device,
-       &cmt1_device,
-       &cmt2_device,
-       &cmt3_device,
-       &cmt4_device,
+       &cmt_device,
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
index 53638e231cd02f91bcb7678a9e1990de6338b8fd..9edc06c02dcf1b9cf7b4599d95ab95d0a9413a76 100644 (file)
@@ -227,7 +227,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
        CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
        CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]),
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),
        CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
        CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
        CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
index 22e485d1990b598c698c1f34344589f01a2b7683..955b9add781063609539ccfd2b70aab5e527785b 100644 (file)
@@ -225,7 +225,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
        CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
        CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]),
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),
        CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
        CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
        CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
index c4cb740e4d10180d3034526d18cb0457b81ca301..40974934512aa5f6594d8b9ea88ae60eb09b26d5 100644 (file)
@@ -207,7 +207,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]),
        CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
 
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
        CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
        CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
 
index 37c41c7747a3b73a2a70400a79dab3e8a07a4b7c..da64734b0fd3b3583f5e31353338504f26c91729 100644 (file)
@@ -236,7 +236,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
        CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
        CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
        CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
        CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
        CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
index 0128af3399b7f69bb7e534247289a1c73b666b63..f917f192650785ad340d844895e64374281f802c 100644 (file)
@@ -309,7 +309,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
        CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
 
-       CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]),
+       CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]),
        CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
        CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
 
index 245d19254489a011b0b246d31e381580857c6450..ad96492f290d090efb180ce131e1553b252244ec 100644 (file)
@@ -228,26 +228,16 @@ static struct platform_device jpu_device = {
 };
 
 static struct sh_timer_config cmt_platform_data = {
-       .channel_offset = 0x60,
-       .timer_bit = 5,
-       .clockevent_rating = 125,
-       .clocksource_rating = 200,
+       .channels_mask = 0x20,
 };
 
 static struct resource cmt_resources[] = {
-       [0] = {
-               .start  = 0x044a0060,
-               .end    = 0x044a006b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0x044a0000, 0x70),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
 static struct platform_device cmt_device = {
-       .name           = "sh_cmt",
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
                .platform_data  = &cmt_platform_data,
index 6f56cbd76b20f162885ab69080db5e488ee7df86..4e4985d95e53ae2288dccbfb00b49eb9e91ee3f4 100644 (file)
@@ -176,26 +176,16 @@ static struct platform_device veu1_device = {
 };
 
 static struct sh_timer_config cmt_platform_data = {
-       .channel_offset = 0x60,
-       .timer_bit = 5,
-       .clockevent_rating = 125,
-       .clocksource_rating = 200,
+       .channels_mask = 0x20,
 };
 
 static struct resource cmt_resources[] = {
-       [0] = {
-               .start  = 0x044a0060,
-               .end    = 0x044a006b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0x044a0000, 0x70),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
 static struct platform_device cmt_device = {
-       .name           = "sh_cmt",
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
                .platform_data  = &cmt_platform_data,
index 5a94efc8d4ceed884d3d094a3b02a466bad6f614..4e3218f288e781e9880903e12e878682fe1bdac1 100644 (file)
@@ -413,26 +413,16 @@ static struct platform_device jpu_device = {
 };
 
 static struct sh_timer_config cmt_platform_data = {
-       .channel_offset = 0x60,
-       .timer_bit = 5,
-       .clockevent_rating = 125,
-       .clocksource_rating = 125,
+       .channels_mask = 0x20,
 };
 
 static struct resource cmt_resources[] = {
-       [0] = {
-               .start  = 0x044a0060,
-               .end    = 0x044a006b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0x044a0000, 0x70),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
 static struct platform_device cmt_device = {
-       .name           = "sh_cmt",
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
                .platform_data  = &cmt_platform_data,
index 3c5eb0993a75526f088afb015d3f0aa0f07f2c70..5dfdb850126200019a7e67baa86c596e395640f5 100644 (file)
@@ -245,26 +245,16 @@ static struct platform_device veu1_device = {
 };
 
 static struct sh_timer_config cmt_platform_data = {
-       .channel_offset = 0x60,
-       .timer_bit = 5,
-       .clockevent_rating = 125,
-       .clocksource_rating = 125,
+       .channels_mask = 0x20,
 };
 
 static struct resource cmt_resources[] = {
-       [0] = {
-               .start  = 0x044a0060,
-               .end    = 0x044a006b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0x044a0000, 0x70),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
 static struct platform_device cmt_device = {
-       .name           = "sh_cmt",
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
                .platform_data  = &cmt_platform_data,
index 60ebbc6842ff1e74d573853429b991e57ef48ef5..b435f076f29271cd7d2d9ba802c768b82a8a8a76 100644 (file)
@@ -648,26 +648,16 @@ static struct platform_device beu1_device = {
 };
 
 static struct sh_timer_config cmt_platform_data = {
-       .channel_offset = 0x60,
-       .timer_bit = 5,
-       .clockevent_rating = 125,
-       .clocksource_rating = 200,
+       .channels_mask = 0x20,
 };
 
 static struct resource cmt_resources[] = {
-       [0] = {
-               .start  = 0x044a0060,
-               .end    = 0x044a006b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xf00),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0x044a0000, 0x70),
+       DEFINE_RES_IRQ(evt2irq(0xf00)),
 };
 
 static struct platform_device cmt_device = {
-       .name           = "sh_cmt",
+       .name           = "sh-cmt-32",
        .id             = 0,
        .dev = {
                .platform_data  = &cmt_platform_data,