#include <asm/mach/serial_sa1100.h>
#include "generic.h"
-#include "sa1111.h"
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;
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
-#include "sa1111.h"
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)
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
-#include "sa1111.h"
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;
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
-#include "sa1111.h"
#define JORTUCR_VAL 0x20000400
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);
#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>
#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
.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;
return -ENODEV;
}
- ret = device_register(&neponset_device);
+ ret = register_sys_device(&neponset_device);
if (ret)
return ret;
/*
* 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);
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
-#include "sa1111.h"
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);
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;
+++ /dev/null
-/*
- * 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);
#include <linux/serial_core.h>
#include "generic.h"
-#include "sa1111.h"
#include <asm/hardware/sa1111.h>
#define DEBUG 1
/*
* 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;
#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.
*/