sh: heartbeat: Update boards for access size hinting.
authorPaul Mundt <lethal@linux-sh.org>
Fri, 15 Jan 2010 03:24:34 +0000 (12:24 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 15 Jan 2010 03:24:34 +0000 (12:24 +0900)
This updates the existing boards that specify the register width through
platform data to use the resource flags instead. This eliminates platform
data completely in most cases, and permits further improvement in the
heartbeat driver as well as shrinking the overall private data size.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
12 files changed:
arch/sh/boards/board-polaris.c
arch/sh/boards/board-sh7785lcr.c
arch/sh/boards/board-urquell.c
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-sdk7780/setup.c
arch/sh/boards/mach-se/7206/setup.c
arch/sh/boards/mach-se/7343/setup.c
arch/sh/boards/mach-se/770x/setup.c
arch/sh/boards/mach-se/7721/setup.c
arch/sh/boards/mach-se/7722/setup.c
arch/sh/boards/mach-se/7724/setup.c
arch/sh/boards/mach-se/7780/setup.c

index 62607eb5100444985c164b29df04ccaec9d980da..5bc126900ce36f8ebe2234a76ef62945c873b514 100644 (file)
@@ -59,15 +59,12 @@ static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 };
 static struct heartbeat_data heartbeat_data = {
        .bit_pos        = heartbeat_bit_pos,
        .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 8,
 };
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PORT_PCDR,
-               .end    = PORT_PCDR,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PORT_PCDR,
+       .end    = PORT_PCDR,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
 };
 
 static struct platform_device heartbeat_device = {
@@ -76,8 +73,8 @@ static struct platform_device heartbeat_device = {
        .dev    = {
                .platform_data  = &heartbeat_data,
        },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 static struct platform_device *polaris_devices[] __initdata = {
index e5a8a2fde39c12b61c6afe53f30a45ef47649f39..7eea90db6cea1a0fdbc2692a482ae3941c9bb1a5 100644 (file)
  * NOTE: This board has 2 physical memory maps.
  *      Please look at include/asm-sh/sh7785lcr.h or hardware manual.
  */
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PLD_LEDCR,
-               .end    = PLD_LEDCR,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 8,
+static struct resource heartbeat_resource = {
+       .start  = PLD_LEDCR,
+       .end    = PLD_LEDCR,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 static struct mtd_partition nor_flash_partitions[] = {
index 36b8bac9b1247f25ad1fa88c3d010af9b7e4f131..268f09e46568185d2a79aea347be03522ff6f7f2 100644 (file)
  */
 
 /* HeartBeat */
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = BOARDREG(SLEDR),
-               .end    = BOARDREG(SLEDR),
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
+static struct resource heartbeat_resource = {
+       .start  = BOARDREG(SLEDR),
+       .end    = BOARDREG(SLEDR),
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev    = {
-               .platform_data  = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1
+       .resource       = &heartbeat_resource,
 };
 
 /* LAN91C111 */
index 6a8861b39f05cd169138c9dbf5c5a254ad236a8a..a6b223332d15f287743a0833e41da2a3f472847a 100644 (file)
 
 /* Heartbeat */
 static unsigned char led_pos[] = { 0, 1, 2, 3 };
+
 static struct heartbeat_data heartbeat_data = {
-       .regsize = 8,
        .nr_bits = 4,
        .bit_pos = led_pos,
 };
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = 0xA405012C, /* PTG */
-               .end    = 0xA405012E - 1,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = 0xA405012C, /* PTG */
+       .end    = 0xA405012E - 1,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
 };
 
 static struct platform_device heartbeat_device = {
@@ -84,8 +82,8 @@ static struct platform_device heartbeat_device = {
        .dev = {
                .platform_data = &heartbeat_data,
        },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 /* MTD */
index aad94a78dc702a3c98b3673d0d99f9596cc48dc0..1d04657e992d8b2ab9f7faa3471fc3262b5429c6 100644 (file)
 
 #define GPIO_PECR        0xFFEA0008
 
-//* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+/* Heartbeat */
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1
+       .resource       = &heartbeat_resource,
 };
 
 /* SMC91x */
index f5466384972ec8f3be07160a359d25f9ef0c685c..8f5c65d43d1d85a6e1db054cd5f065ee3aa72119 100644 (file)
@@ -50,15 +50,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
 static struct heartbeat_data heartbeat_data = {
        .bit_pos        = heartbeat_bit_pos,
        .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 32,
 };
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
 };
 
 static struct platform_device heartbeat_device = {
@@ -67,8 +64,8 @@ static struct platform_device heartbeat_device = {
        .dev    = {
                .platform_data  = &heartbeat_data,
        },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 static struct platform_device *se7206_devices[] __initdata = {
index 292cc47d853f604c5dfc966e45db724195bc1a87..3412bb2973aecc28414b52cad17096edc5f15b28 100644 (file)
 #include <asm/irq.h>
 #include <asm/io.h>
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 static struct mtd_partition nor_flash_partitions[] = {
index 527eb6b12610289248be45bff91d28dc66b993fc..66d39d1b0901de5a9b6da4c7fb7978223b18b502 100644 (file)
@@ -93,15 +93,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
 static struct heartbeat_data heartbeat_data = {
        .bit_pos        = heartbeat_bit_pos,
        .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
 };
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
@@ -110,8 +107,8 @@ static struct platform_device heartbeat_device = {
        .dev    = {
                .platform_data  = &heartbeat_data,
        },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 #if defined(CONFIG_CPU_SUBTYPE_SH7710) ||\
index 55af4c36b43a1f9d52b45f91edd00b8b56af11a6..460da53b4961abfcbab7274d7076a380aeb7039c 100644 (file)
@@ -23,15 +23,12 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 };
 static struct heartbeat_data heartbeat_data = {
        .bit_pos        = heartbeat_bit_pos,
        .nr_bits        = ARRAY_SIZE(heartbeat_bit_pos),
-       .regsize        = 16,
 };
 
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
@@ -40,8 +37,8 @@ static struct platform_device heartbeat_device = {
        .dev    = {
                .platform_data  = &heartbeat_data,
        },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 static struct resource cf_ide_resources[] = {
index b1cb9425b600a8b78ea1ae6d30ccb817f1481e89..93675418171d7d9df596a657bccdf0d7a4a0b350 100644 (file)
 #include <cpu/sh7722.h>
 
 /* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 /* SMC91x */
index 5d0f70b46c97435dab2e565498ec33cf98ba34f3..cbfba783ee49f8871122f1a5dbcbca703ff077bd 100644 (file)
  */
 
 /* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 /* LAN91C111 */
index 1d3a867e94e3ad90fd653086705b181898605105..f7bfb3f83692f2d8bb74d5d6c4502a281d493960 100644 (file)
 #include <asm/heartbeat.h>
 
 /* Heartbeat */
-static struct heartbeat_data heartbeat_data = {
-       .regsize = 16,
-};
-
-static struct resource heartbeat_resources[] = {
-       [0] = {
-               .start  = PA_LED,
-               .end    = PA_LED,
-               .flags  = IORESOURCE_MEM,
-       },
+static struct resource heartbeat_resource = {
+       .start  = PA_LED,
+       .end    = PA_LED,
+       .flags  = IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
 };
 
 static struct platform_device heartbeat_device = {
        .name           = "heartbeat",
        .id             = -1,
-       .dev = {
-               .platform_data = &heartbeat_data,
-       },
-       .num_resources  = ARRAY_SIZE(heartbeat_resources),
-       .resource       = heartbeat_resources,
+       .num_resources  = 1,
+       .resource       = &heartbeat_resource,
 };
 
 /* SMC91x */
This page took 0.034592 seconds and 5 git commands to generate.