Commit ef0a3748 authored by Russell King's avatar Russell King

[ARM] Remove "struct device" from sa1111_init() callers

This didn't follow the LDM model correctly.  The SA1111 is always
a device on the root bus.
parent 287b5050
......@@ -28,7 +28,6 @@
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
#include "sa1111.h"
static int __init adsbitsy_init(void)
{
......@@ -53,7 +52,7 @@ static int __init adsbitsy_init(void)
/*
* Probe for SA1111.
*/
ret = sa1111_init(NULL, 0x18000000, IRQ_GPIO0);
ret = sa1111_init(0x18000000, IRQ_GPIO0);
if (ret < 0)
return ret;
......
......@@ -32,7 +32,6 @@
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
#include "sa1111.h"
static int __init badge4_sa1111_init(void)
{
......@@ -45,7 +44,7 @@ static int __init badge4_sa1111_init(void)
/*
* Probe for SA1111.
*/
return sa1111_init(NULL, BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111);
return sa1111_init(BADGE4_SA1111_BASE, BADGE4_IRQ_GPIO_SA1111);
}
static int __init badge4_init(void)
......
......@@ -25,7 +25,6 @@
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
#include "sa1111.h"
static int __init graphicsmaster_init(void)
{
......@@ -43,7 +42,7 @@ static int __init graphicsmaster_init(void)
/*
* Probe for SA1111.
*/
ret = sa1111_init(NULL, 0x18000000, ADS_EXT_IRQ(0));
ret = sa1111_init(0x18000000, ADS_EXT_IRQ(0));
if (ret < 0)
return ret;
......
......@@ -16,7 +16,6 @@
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
#include "sa1111.h"
#define JORTUCR_VAL 0x20000400
......@@ -46,11 +45,7 @@ static int __init jornada720_init(void)
PPSR &= ~(PPC_LDD3 | PPC_LDD4);
PPDR |= PPC_LDD3 | PPC_LDD4;
/* initialize extra IRQs */
set_GPIO_IRQ_edge(GPIO_GPIO1, GPIO_RISING_EDGE);
sa1111_init_irq(IRQ_GPIO1); /* chained on GPIO 1 */
return 0;
return sa1111_init(0x40000000, IRQ_GPIO1);
}
arch_initcall(jornada720_init);
......
......@@ -11,6 +11,7 @@
#include <linux/ioport.h>
#include <linux/serial_core.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
......@@ -23,13 +24,6 @@
#include <asm/hardware/sa1111.h>
#include <asm/sizes.h>
#include "sa1111.h"
static struct device neponset_device = {
.name = "Neponset",
.bus_id = "nep_bus",
};
/*
* Install handler for Neponset IRQ. Note that we have to loop here
* since the ETHERNET and USAR IRQs are level based, and we need to
......@@ -163,6 +157,52 @@ static struct sa1100_port_fns neponset_port_fns __initdata = {
.get_mctrl = neponset_get_mctrl,
};
/*
* LDM power management.
*/
static int neponset_suspend(struct device *dev, u32 state, u32 level)
{
/*
* Save state.
*/
if (level == SUSPEND_SAVE_STATE ||
level == SUSPEND_DISABLE ||
level == SUSPEND_POWER_DOWN) {
if (!dev->saved_state)
dev->saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
if (!dev->saved_state)
return -ENOMEM;
*(unsigned int *)dev->saved_state = NCR_0;
}
return 0;
}
static int neponset_resume(struct device *dev, u32 level)
{
if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
if (dev->saved_state) {
NCR_0 = *(unsigned int *)dev->saved_state;
kfree(dev->saved_state);
dev->saved_state = NULL;
}
}
return 0;
}
static struct device_driver neponset_device_driver = {
.suspend = neponset_suspend,
.resume = neponset_resume,
};
static struct device neponset_device = {
.name = "Neponset",
.bus_id = "neponset",
.driver = &neponset_device_driver,
};
static int __init neponset_init(void)
{
int ret;
......@@ -191,7 +231,7 @@ static int __init neponset_init(void)
return -ENODEV;
}
ret = device_register(&neponset_device);
ret = register_sys_device(&neponset_device);
if (ret)
return ret;
......@@ -213,7 +253,7 @@ static int __init neponset_init(void)
/*
* Probe and initialise the SA1111.
*/
return sa1111_init(&neponset_device, 0x40000000, IRQ_NEPONSET_SA1111);
return sa1111_init(0x40000000, IRQ_NEPONSET_SA1111);
}
arch_initcall(neponset_init);
......
......@@ -17,7 +17,6 @@
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
#include "sa1111.h"
static int __init pfs168_init(void)
......@@ -36,7 +35,7 @@ static int __init pfs168_init(void)
/*
* Probe for SA1111.
*/
return sa1111_init(NULL, 0x40000000, IRQ_GPIO25);
return sa1111_init(0x40000000, IRQ_GPIO25);
}
arch_initcall(pfs168_init);
......
......@@ -650,7 +650,7 @@ int sa1111_check_dma_bug(dma_addr_t addr)
return 0;
}
int sa1111_init(struct device *parent, unsigned long phys, unsigned int irq)
int sa1111_init(unsigned long phys, unsigned int irq)
{
unsigned int val;
int ret;
......
/*
* linux/arch/arm/mach-sa1100/sa1111.h
*/
struct device;
/*
* Probe for a SA1111 chip.
*/
extern int
sa1111_init(struct device *parent, unsigned long phys, unsigned int irq);
/*
* Wake up a SA1111 chip.
*/
extern void sa1111_wake(void);
/*
* Doze the SA1111 chip.
*/
extern void sa1111_doze(void);
......@@ -56,7 +56,6 @@
#include <linux/serial_core.h>
#include "generic.h"
#include "sa1111.h"
#include <asm/hardware/sa1111.h>
#define DEBUG 1
......@@ -401,7 +400,7 @@ static int __init system3_init(void)
/*
* Probe for a SA1111.
*/
ret = sa1111_init(NULL, PT_SA1111_BASE, IRQ_SYSTEM3_SA1111);
ret = sa1111_init(PT_SA1111_BASE, IRQ_SYSTEM3_SA1111);
if (ret < 0) {
printk( KERN_WARNING"PT Digital Board: no SA1111 found!\n" );
goto DONE;
......
......@@ -580,6 +580,11 @@ struct sa1111_driver {
#define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name)
/*
* Probe for a SA1111 chip.
*/
extern int sa1111_init(unsigned long phys, unsigned int irq);
/*
* These frob the SKPCR register.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment