|
|
@ -10,8 +10,10 @@ Changes from v2: |
|
|
|
- replaced rdc321x_pci_{read,write}
|
|
|
|
- replaced rdc321x_pci_{read,write}
|
|
|
|
- use the pci_dev pointer passed as platform_data
|
|
|
|
- use the pci_dev pointer passed as platform_data
|
|
|
|
|
|
|
|
|
|
|
|
--- a/drivers/watchdog/rdc321x_wdt.c
|
|
|
|
Index: linux-2.6.32.10/drivers/watchdog/rdc321x_wdt.c
|
|
|
|
+++ b/drivers/watchdog/rdc321x_wdt.c
|
|
|
|
===================================================================
|
|
|
|
|
|
|
|
--- linux-2.6.32.10.orig/drivers/watchdog/rdc321x_wdt.c 2010-05-15 22:14:28.000000000 +0200
|
|
|
|
|
|
|
|
+++ linux-2.6.32.10/drivers/watchdog/rdc321x_wdt.c 2010-05-15 22:15:24.000000000 +0200
|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* RDC321x watchdog driver
|
|
|
|
* RDC321x watchdog driver
|
|
|
@ -31,7 +33,7 @@ Changes from v2: |
|
|
|
|
|
|
|
|
|
|
|
#define RDC_WDT_MASK 0x80000000 /* Mask */
|
|
|
|
#define RDC_WDT_MASK 0x80000000 /* Mask */
|
|
|
|
#define RDC_WDT_EN 0x00800000 /* Enable bit */
|
|
|
|
#define RDC_WDT_EN 0x00800000 /* Enable bit */
|
|
|
|
@@ -63,6 +62,8 @@ static struct {
|
|
|
|
@@ -63,6 +62,8 @@
|
|
|
|
int default_ticks;
|
|
|
|
int default_ticks;
|
|
|
|
unsigned long inuse;
|
|
|
|
unsigned long inuse;
|
|
|
|
spinlock_t lock;
|
|
|
|
spinlock_t lock;
|
|
|
@ -40,7 +42,7 @@ Changes from v2: |
|
|
|
} rdc321x_wdt_device;
|
|
|
|
} rdc321x_wdt_device;
|
|
|
|
|
|
|
|
|
|
|
|
/* generic helper functions */
|
|
|
|
/* generic helper functions */
|
|
|
|
@@ -70,14 +71,18 @@ static struct {
|
|
|
|
@@ -70,14 +71,18 @@
|
|
|
|
static void rdc321x_wdt_trigger(unsigned long unused)
|
|
|
|
static void rdc321x_wdt_trigger(unsigned long unused)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long flags;
|
|
|
@ -61,7 +63,7 @@ Changes from v2: |
|
|
|
spin_unlock_irqrestore(&rdc321x_wdt_device.lock, flags);
|
|
|
|
spin_unlock_irqrestore(&rdc321x_wdt_device.lock, flags);
|
|
|
|
|
|
|
|
|
|
|
|
/* requeue?? */
|
|
|
|
/* requeue?? */
|
|
|
|
@@ -105,10 +110,13 @@ static void rdc321x_wdt_start(void)
|
|
|
|
@@ -105,10 +110,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
/* Clear the timer */
|
|
|
|
/* Clear the timer */
|
|
|
|
spin_lock_irqsave(&rdc321x_wdt_device.lock, flags);
|
|
|
|
spin_lock_irqsave(&rdc321x_wdt_device.lock, flags);
|
|
|
@ -77,7 +79,7 @@ Changes from v2: |
|
|
|
spin_unlock_irqrestore(&rdc321x_wdt_device.lock, flags);
|
|
|
|
spin_unlock_irqrestore(&rdc321x_wdt_device.lock, flags);
|
|
|
|
|
|
|
|
|
|
|
|
mod_timer(&rdc321x_wdt_device.timer,
|
|
|
|
mod_timer(&rdc321x_wdt_device.timer,
|
|
|
|
@@ -148,7 +156,7 @@ static long rdc321x_wdt_ioctl(struct fil
|
|
|
|
@@ -148,7 +156,7 @@
|
|
|
|
unsigned long arg)
|
|
|
|
unsigned long arg)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void __user *argp = (void __user *)arg;
|
|
|
|
void __user *argp = (void __user *)arg;
|
|
|
@ -86,7 +88,7 @@ Changes from v2: |
|
|
|
static struct watchdog_info ident = {
|
|
|
|
static struct watchdog_info ident = {
|
|
|
|
.options = WDIOF_CARDRESET,
|
|
|
|
.options = WDIOF_CARDRESET,
|
|
|
|
.identity = "RDC321x WDT",
|
|
|
|
.identity = "RDC321x WDT",
|
|
|
|
@@ -162,9 +170,10 @@ static long rdc321x_wdt_ioctl(struct fil
|
|
|
|
@@ -162,9 +170,10 @@
|
|
|
|
case WDIOC_GETSTATUS:
|
|
|
|
case WDIOC_GETSTATUS:
|
|
|
|
/* Read the value from the DATA register */
|
|
|
|
/* Read the value from the DATA register */
|
|
|
|
spin_lock_irqsave(&rdc321x_wdt_device.lock, flags);
|
|
|
|
spin_lock_irqsave(&rdc321x_wdt_device.lock, flags);
|
|
|
@ -99,20 +101,20 @@ Changes from v2: |
|
|
|
return -EFAULT;
|
|
|
|
return -EFAULT;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case WDIOC_GETSUPPORT:
|
|
|
|
case WDIOC_GETSUPPORT:
|
|
|
|
@@ -219,17 +228,35 @@ static struct miscdevice rdc321x_wdt_mis
|
|
|
|
@@ -219,17 +228,35 @@
|
|
|
|
static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
|
|
|
|
static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
int err;
|
|
|
|
+ struct resource *r;
|
|
|
|
+ struct resource *r;
|
|
|
|
+ struct rdc321x_wdt_pdata *pdata;
|
|
|
|
+ struct rdc321x_wdt_pdata *pdata;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ pdata = pdev->dev.platform_data;
|
|
|
|
+ pdata = platform_get_drvdata(pdev);
|
|
|
|
+ if (!pdata) {
|
|
|
|
+ if (!pdata) {
|
|
|
|
+ dev_err(&pdev->dev, "no platform data supplied\n");
|
|
|
|
+ dev_err(&pdev->dev, "no platform data supplied\n");
|
|
|
|
+ return -ENODEV;
|
|
|
|
+ return -ENODEV;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wdt-reg");
|
|
|
|
+ r = platform_get_resource_byname(pdev, IORESOURCE_IO, "wdt-reg");
|
|
|
|
+ if (!r) {
|
|
|
|
+ if (!r) {
|
|
|
|
+ dev_err(&pdev->dev, "failed to get wdt-reg resource\n");
|
|
|
|
+ dev_err(&pdev->dev, "failed to get wdt-reg resource\n");
|
|
|
|
+ return -ENODEV;
|
|
|
|
+ return -ENODEV;
|
|
|
@ -137,7 +139,7 @@ Changes from v2: |
|
|
|
|
|
|
|
|
|
|
|
init_completion(&rdc321x_wdt_device.stop);
|
|
|
|
init_completion(&rdc321x_wdt_device.stop);
|
|
|
|
rdc321x_wdt_device.queue = 0;
|
|
|
|
rdc321x_wdt_device.queue = 0;
|
|
|
|
@@ -240,7 +267,7 @@ static int __devinit rdc321x_wdt_probe(s
|
|
|
|
@@ -240,7 +267,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
rdc321x_wdt_device.default_ticks = ticks;
|
|
|
|
rdc321x_wdt_device.default_ticks = ticks;
|
|
|
|
|
|
|
|
|
|
|
|