Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
power.c File Reference
#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.

Macros

#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"
 

Functions

 arch_initcall (power_init)
 
 module_exit (power_exit)
 
 MODULE_AUTHOR ("Helge Deller <[email protected]>")
 
 MODULE_DESCRIPTION ("Soft power switch driver")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 

Macro Definition Documentation

#define __getDIAG (   dr)
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))

Definition at line 61 of file power.c.

#define DRIVER_NAME   "powersw"

Definition at line 50 of file power.c.

#define KTHREAD_NAME   "kpowerswd"

Definition at line 51 of file power.c.

#define MFCPU_C (   dr,
  gr 
)    MFCPU_X(dr, gr, 0, 0x30) /* for dr0 and dr8 only ! */

Definition at line 67 of file power.c.

#define MFCPU_T (   dr,
  gr 
)    MFCPU_X(dr, 0, gr, 0xa0) /* all dr except dr0 and dr8 */

Definition at line 68 of file power.c.

#define MFCPU_X (   rDiagReg,
  t_ch,
  t_th,
  code 
)    (DIAG_CODE(code) + ((rDiagReg)<<21) + ((t_ch)<<16) + ((t_th)<<0) )

Definition at line 63 of file power.c.

#define MTCPU (   dr,
  gr 
)    MFCPU_X(dr, gr, 0, 0x12) /* move value of gr to dr[dr] */

Definition at line 66 of file power.c.

#define POWERSWITCH_DOWN_SEC   2

Definition at line 57 of file power.c.

#define POWERSWITCH_POLL_PER_SEC   2

Definition at line 54 of file power.c.

#define SYSCTL_FILENAME   "sys/kernel/power"

Definition at line 109 of file power.c.

Function Documentation

arch_initcall ( power_init  )
MODULE_AUTHOR ( "Helge Deller <[email protected]>"  )
MODULE_DESCRIPTION ( "Soft power switch driver )
module_exit ( power_exit  )
MODULE_LICENSE ( "Dual BSD/GPL"  )