Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a09d2831 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: heartbeat: Update boards for access size hinting.



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: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2267c787
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -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] = {
static struct resource heartbeat_resource = {
	.start	= PORT_PCDR,
	.end	= PORT_PCDR,
		.flags	= IORESOURCE_MEM,
	},
	.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 = {
+6 −15
Original line number Diff line number Diff line
@@ -32,26 +32,17 @@
 * 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] = {
static struct resource heartbeat_resource = {
	.start	= PLD_LEDCR,
	.end	= PLD_LEDCR,
		.flags	= IORESOURCE_MEM,
	},
};

static struct heartbeat_data heartbeat_data = {
	.regsize = 8,
	.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[] = {
+6 −15
Original line number Diff line number Diff line
@@ -50,26 +50,17 @@
 */

/* HeartBeat */
static struct resource heartbeat_resources[] = {
	[0] = {
static struct resource heartbeat_resource = {
	.start	= BOARDREG(SLEDR),
	.end	= BOARDREG(SLEDR),
		.flags	= IORESOURCE_MEM,
	},
};

static struct heartbeat_data heartbeat_data = {
	.regsize = 16,
	.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 */
+7 −9
Original line number Diff line number Diff line
@@ -64,18 +64,16 @@

/* 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] = {
static struct resource heartbeat_resource = {
	.start  = 0xA405012C, /* PTG */
	.end    = 0xA405012E - 1,
		.flags  = IORESOURCE_MEM,
	},
	.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 */
+7 −16
Original line number Diff line number Diff line
@@ -20,27 +20,18 @@

#define GPIO_PECR        0xFFEA0008

//* Heartbeat */
static struct heartbeat_data heartbeat_data = {
	.regsize = 16,
};

static struct resource heartbeat_resources[] = {
	[0] = {
/* Heartbeat */
static struct resource heartbeat_resource = {
	.start  = PA_LED,
	.end    = PA_LED,
		.flags  = IORESOURCE_MEM,
	},
	.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 */
Loading