sh: Switch to new style MTU2 device
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / sh / kernel / cpu / sh2a / setup-mxg.c
index 63e996f..26fcdbd 100644 (file)
@@ -114,88 +114,18 @@ static struct intc_mask_reg mask_registers[] __initdata = {
 static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
                         mask_registers, prio_registers, NULL);
 
-static struct sh_timer_config mtu2_0_platform_data = {
-       .channel_offset = -0x80,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+static struct resource mtu2_resources[] = {
+       DEFINE_RES_MEM(0xff801000, 0x400),
+       DEFINE_RES_IRQ_NAMED(228, "tgi0a"),
+       DEFINE_RES_IRQ_NAMED(234, "tgi1a"),
+       DEFINE_RES_IRQ_NAMED(240, "tgi2a"),
 };
 
-static struct resource mtu2_0_resources[] = {
-       [0] = {
-               .start  = 0xff801300,
-               .end    = 0xff801326,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 228,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device mtu2_0_device = {
-       .name           = "sh_mtu2",
-       .id             = 0,
-       .dev = {
-               .platform_data  = &mtu2_0_platform_data,
-       },
-       .resource       = mtu2_0_resources,
-       .num_resources  = ARRAY_SIZE(mtu2_0_resources),
-};
-
-static struct sh_timer_config mtu2_1_platform_data = {
-       .channel_offset = -0x100,
-       .timer_bit = 1,
-       .clockevent_rating = 200,
-};
-
-static struct resource mtu2_1_resources[] = {
-       [0] = {
-               .start  = 0xff801380,
-               .end    = 0xff801390,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 234,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device mtu2_1_device = {
-       .name           = "sh_mtu2",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &mtu2_1_platform_data,
-       },
-       .resource       = mtu2_1_resources,
-       .num_resources  = ARRAY_SIZE(mtu2_1_resources),
-};
-
-static struct sh_timer_config mtu2_2_platform_data = {
-       .channel_offset = 0x80,
-       .timer_bit = 2,
-       .clockevent_rating = 200,
-};
-
-static struct resource mtu2_2_resources[] = {
-       [0] = {
-               .start  = 0xff801000,
-               .end    = 0xff80100a,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 240,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device mtu2_2_device = {
-       .name           = "sh_mtu2",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &mtu2_2_platform_data,
-       },
-       .resource       = mtu2_2_resources,
-       .num_resources  = ARRAY_SIZE(mtu2_2_resources),
+static struct platform_device mtu2_device = {
+       .name           = "sh-mtu2",
+       .id             = -1,
+       .resource       = mtu2_resources,
+       .num_resources  = ARRAY_SIZE(mtu2_resources),
 };
 
 static struct plat_sci_port scif0_platform_data = {
@@ -221,9 +151,7 @@ static struct platform_device scif0_device = {
 
 static struct platform_device *mxg_devices[] __initdata = {
        &scif0_device,
-       &mtu2_0_device,
-       &mtu2_1_device,
-       &mtu2_2_device,
+       &mtu2_device,
 };
 
 static int __init mxg_devices_setup(void)
@@ -240,9 +168,7 @@ void __init plat_irq_setup(void)
 
 static struct platform_device *mxg_early_devices[] __initdata = {
        &scif0_device,
-       &mtu2_0_device,
-       &mtu2_1_device,
-       &mtu2_2_device,
+       &mtu2_device,
 };
 
 void __init plat_early_device_setup(void)