#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/pm.h>
#include <asm/pdc.h>
#include <asm/io.h>
#include <asm/led.h>
Go to the source code of this file.
|
| #define | DRIVER_NAME "powersw" |
| |
| #define | KTHREAD_NAME "kpowerswd" |
| |
| #define | POWERSWITCH_POLL_PER_SEC 2 |
| |
| #define | POWERSWITCH_DOWN_SEC 2 |
| |
| #define | DIAG_CODE(code) (0x14000000 + ((code)<<5)) |
| |
| #define | MFCPU_X(rDiagReg, t_ch, t_th, code) (DIAG_CODE(code) + ((rDiagReg)<<21) + ((t_ch)<<16) + ((t_th)<<0) ) |
| |
| #define | MTCPU(dr, gr) MFCPU_X(dr, gr, 0, 0x12) /* move value of gr to dr[dr] */ |
| |
| #define | MFCPU_C(dr, gr) MFCPU_X(dr, gr, 0, 0x30) /* for dr0 and dr8 only ! */ |
| |
| #define | MFCPU_T(dr, gr) MFCPU_X(dr, 0, gr, 0xa0) /* all dr except dr0 and dr8 */ |
| |
| #define | __getDIAG(dr) |
| |
| #define | SYSCTL_FILENAME "sys/kernel/power" |
| |
Value:( { \
register unsigned long __res asm("r28");\
__asm__ __volatile__ ( \
".word %1" :
"=&r" (__res) :
"i" (
MFCPU_T(dr,28) ) \
); \
__res; \
} )
Definition at line 70 of file power.c.
| #define DIAG_CODE |
( |
|
code | ) |
(0x14000000 + ((code)<<5)) |
| #define DRIVER_NAME "powersw" |
| #define KTHREAD_NAME "kpowerswd" |
| #define MFCPU_C |
( |
|
dr, |
|
|
|
gr |
|
) |
| MFCPU_X(dr, gr, 0, 0x30) /* for dr0 and dr8 only ! */ |
| #define MFCPU_T |
( |
|
dr, |
|
|
|
gr |
|
) |
| MFCPU_X(dr, 0, gr, 0xa0) /* all dr except dr0 and dr8 */ |
| #define MFCPU_X |
( |
|
rDiagReg, |
|
|
|
t_ch, |
|
|
|
t_th, |
|
|
|
code |
|
) |
| (DIAG_CODE(code) + ((rDiagReg)<<21) + ((t_ch)<<16) + ((t_th)<<0) ) |
| #define MTCPU |
( |
|
dr, |
|
|
|
gr |
|
) |
| MFCPU_X(dr, gr, 0, 0x12) /* move value of gr to dr[dr] */ |
| #define POWERSWITCH_DOWN_SEC 2 |
| #define POWERSWITCH_POLL_PER_SEC 2 |
| #define SYSCTL_FILENAME "sys/kernel/power" |
| arch_initcall |
( |
power_init |
| ) |
|
| MODULE_DESCRIPTION |
( |
"Soft power switch driver" |
| ) |
|
| module_exit |
( |
power_exit |
| ) |
|
| MODULE_LICENSE |
( |
"Dual BSD/GPL" |
| ) |
|