Commit e86bd43b authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

watchdog: sa1100: use platform device registration



Rather than relying on machine specific headers to
pass down the reboot status and the register locations,
use resources and platform_data.

Aside from this, keep the changes to a minimum.

Cc: Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org
Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent ee84cbd5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@
#include <linux/platform_data/mmp_dma.h>
#include <linux/platform_data/mtd-nand-pxa3xx.h>

#include <mach/regs-ost.h>
#include <mach/reset.h>
#include "devices.h"
#include "generic.h"

@@ -1118,3 +1120,12 @@ void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata)
{
	pxa_register_device(&pxa2xx_pxa_dma, dma_pdata);
}

void __init pxa_register_wdt(unsigned int reset_status)
{
	struct resource res = DEFINE_RES_MEM(OST_PHYS, OST_LEN);

	reset_status &= RESET_STATUS_WATCHDOG;
	platform_device_register_resndata(NULL, "sa1100_wdt", -1, &res, 1,
					  &reset_status, sizeof(reset_status));
}
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@
/*
 * OS Timer & Match Registers
 */
#define OST_PHYS	0x40A00000
#define OST_LEN		0x00000020

#define OSMR0		io_p2v(0x40A00000)  /* */
#define OSMR1		io_p2v(0x40A00004)  /* */
+1 −1
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@
#define RESET_STATUS_GPIO	(1 << 3)	/* GPIO Reset */
#define RESET_STATUS_ALL	(0xf)

extern unsigned int reset_status;
extern void clear_reset_status(unsigned int mask);
extern void pxa_register_wdt(unsigned int reset_status);

/**
 * init_gpio_reset() - register GPIO as reset generator
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ static int __init pxa25x_init(void)

	if (cpu_is_pxa25x()) {

		reset_status = RCSR;
		pxa_register_wdt(RCSR);

		pxa25x_init_pm();

+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ static int __init pxa27x_init(void)

	if (cpu_is_pxa27x()) {

		reset_status = RCSR;
		pxa_register_wdt(RCSR);

		pxa27x_init_pm();

Loading