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

Commit 8786c952 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: heartbeat driver update.



Add some flags for the heartbeat driver, and kill off some duplication
in the bit positions for the boards that don't have special cases.

This also allows for variable access widths and inversion.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2eb0303c
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <asm/machvec.h>
#include <asm/r7780rp.h>
#include <asm/clock.h>
#include <asm/heartbeat.h>
#include <asm/io.h>

static struct resource r8a66597_usb_host_resources[] = {
@@ -108,16 +109,23 @@ static struct platform_device cf_ide_device = {
	},
};

static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };

static struct resource heartbeat_resources[] = {
	[0] = {
		.start	= PA_OBLED,
		.end	= PA_OBLED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
		.end	= PA_OBLED + 8 - 1,
		.flags	= IORESOURCE_MEM,
	},
};

#ifndef CONFIG_SH_R7785RP
static unsigned char heartbeat_bit_pos[] = { 2, 1, 0, 3, 6, 5, 4, 7 };

static struct heartbeat_data heartbeat_data = {
	.bit_pos	= heartbeat_bit_pos,
	.nr_bits	= ARRAY_SIZE(heartbeat_bit_pos),
};
#endif

static struct platform_device heartbeat_device = {
	.name		= "heartbeat",
	.id		= -1,
@@ -125,7 +133,7 @@ static struct platform_device heartbeat_device = {
	/* R7785RP has a slightly more sensible FPGA.. */
#ifndef CONFIG_SH_R7785RP
	.dev	= {
		.platform_data	= heartbeat_bit_pos,
		.platform_data	= heartbeat_data,
	},
#endif
	.num_resources	= ARRAY_SIZE(heartbeat_resources),
+7 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <asm/se7206.h>
#include <asm/io.h>
#include <asm/machvec.h>
#include <asm/heartbeat.h>

static struct resource smc91x_resources[] = {
	[0] = {
@@ -37,6 +38,11 @@ static struct platform_device smc91x_device = {

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),
};

static struct resource heartbeat_resources[] = {
	[0] = {
		.start	= PA_LED,
@@ -49,7 +55,7 @@ static struct platform_device heartbeat_device = {
	.name		= "heartbeat",
	.id		= -1,
	.dev	= {
		.platform_data	= heartbeat_bit_pos,
		.platform_data	= heartbeat_data,
	},
	.num_resources	= ARRAY_SIZE(heartbeat_resources),
	.resource	= heartbeat_resources,
+7 −1
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <asm/se.h>
#include <asm/io.h>
#include <asm/smc37c93x.h>
#include <asm/heartbeat.h>

void init_se_IRQ(void);

@@ -90,6 +91,11 @@ static struct platform_device cf_ide_device = {

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),
};

static struct resource heartbeat_resources[] = {
	[0] = {
		.start	= PA_LED,
@@ -102,7 +108,7 @@ static struct platform_device heartbeat_device = {
	.name		= "heartbeat",
	.id		= -1,
	.dev	= {
		.platform_data	= heartbeat_bit_pos,
		.platform_data	= heartbeat_data,
	},
	.num_resources	= ARRAY_SIZE(heartbeat_resources),
	.resource	= heartbeat_resources,
+2 −7
Original line number Diff line number Diff line
@@ -18,12 +18,10 @@
#include <asm/io.h>

/* Heartbeat */
static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3, 4, 5, 6, 7 };

static struct resource heartbeat_resources[] = {
	[0] = {
		.start  = PA_LED,
		.end    = PA_LED + ARRAY_SIZE(heartbeat_bit_pos) - 1,
		.end    = PA_LED + 8 - 1,
		.flags  = IORESOURCE_MEM,
	},
};
@@ -31,9 +29,6 @@ static struct resource heartbeat_resources[] = {
static struct platform_device heartbeat_device = {
	.name           = "heartbeat",
	.id             = -1,
	.dev    = {
		.platform_data  = heartbeat_bit_pos,
	},
	.num_resources  = ARRAY_SIZE(heartbeat_resources),
	.resource       = heartbeat_resources,
};
+7 −1
Original line number Diff line number Diff line
@@ -13,9 +13,15 @@
#include <asm/machvec.h>
#include <asm/se7751.h>
#include <asm/io.h>
#include <asm/heartbeat.h>

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),
};

static struct resource heartbeat_resources[] = {
	[0] = {
		.start	= PA_LED,
@@ -28,7 +34,7 @@ static struct platform_device heartbeat_device = {
	.name		= "heartbeat",
	.id		= -1,
	.dev	= {
		.platform_data	= heartbeat_bit_pos,
		.platform_data	= heartbeat_data,
	},
	.num_resources	= ARRAY_SIZE(heartbeat_resources),
	.resource	= heartbeat_resources,
Loading