LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_power.c File Reference
#include <asm/types.h>
#include "../../lms2012/source/lms2012.h"
#include "../../lms2012/source/am1808.h"
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/hrtimer.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <linux/ioport.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define HW_ID_SUPPORT
 
#define MODULE_NAME   "power_module"
 
#define DEVICE1_NAME   POWER_DEVICE
 
#define __USE_POSIX
 
#define POWEROn
 
#define ACCUFloat
 
#define ACCURead   ((*PowerPin[SW_RECHARGE].pGpio).in_data & PowerPin[SW_RECHARGE].Mask)
 
#define TESTOn
 
#define TESTOff
 

Enumerations

enum  PowerPins {
  P_EN, PENON, SW_RECHARGE, TESTPIN,
  POWER_PINS
}
 

Functions

 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("The LEGO Group")
 
 MODULE_DESCRIPTION (MODULE_NAME)
 
 MODULE_SUPPORTED_DEVICE (DEVICE1_NAME)
 
 module_init (ModuleInit)
 
 module_exit (ModuleExit)
 
void SetGpio (int Pin)
 
void InitGpio (void)
 
 module_param (HwId, charp, 0)
 

Variables

int Hw = 0
 
INPIN PowerPin [POWER_PINS]
 
INPINpPowerPin []
 

Macro Definition Documentation

#define __USE_POSIX

Definition at line 46 of file d_power.c.

#define ACCUFloat
Value:
{\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN PowerPin[POWER_PINS]
Definition: d_power.c:101

Definition at line 224 of file d_power.c.

#define ACCURead   ((*PowerPin[SW_RECHARGE].pGpio).in_data & PowerPin[SW_RECHARGE].Mask)

Definition at line 229 of file d_power.c.

#define DEVICE1_NAME   POWER_DEVICE

Definition at line 41 of file d_power.c.

#define HW_ID_SUPPORT

Definition at line 34 of file d_power.c.

#define MODULE_NAME   "power_module"

Definition at line 40 of file d_power.c.

#define POWEROn
Value:
{\
(*PowerPin[P_EN].pGpio).set_data = PowerPin[P_EN].Mask;\
(*PowerPin[P_EN].pGpio).dir &= ~PowerPin[P_EN].Mask;\
(*PowerPin[PENON].pGpio).set_data = PowerPin[PENON].Mask;\
(*PowerPin[PENON].pGpio).dir &= ~PowerPin[PENON].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
Definition: d_power.c:93
INPIN PowerPin[POWER_PINS]
Definition: d_power.c:101
Definition: d_power.c:94

Definition at line 216 of file d_power.c.

#define TESTOff
Value:
{\
(*PowerPin[TESTPIN].pGpio).clr_data = PowerPin[TESTPIN].Mask;\
(*PowerPin[TESTPIN].pGpio).dir &= ~PowerPin[TESTPIN].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN PowerPin[POWER_PINS]
Definition: d_power.c:101

Definition at line 237 of file d_power.c.

#define TESTOn
Value:
{\
(*PowerPin[TESTPIN].pGpio).set_data = PowerPin[TESTPIN].Mask;\
(*PowerPin[TESTPIN].pGpio).dir &= ~PowerPin[TESTPIN].Mask;\
}
GPIOC pGpio
Definition: am1808.h:225
INPIN PowerPin[POWER_PINS]
Definition: d_power.c:101

Definition at line 232 of file d_power.c.

Enumeration Type Documentation

enum PowerPins
Enumerator
P_EN 
PENON 
SW_RECHARGE 
TESTPIN 
POWER_PINS 

Definition at line 91 of file d_power.c.

Function Documentation

void InitGpio ( void  )

Definition at line 184 of file d_power.c.

MODULE_AUTHOR ( "The LEGO Group"  )
MODULE_DESCRIPTION ( MODULE_NAME  )
module_exit ( ModuleExit  )
module_init ( ModuleInit  )
MODULE_LICENSE ( "GPL"  )
module_param ( HwId  ,
charp  ,
 
)
MODULE_SUPPORTED_DEVICE ( DEVICE1_NAME  )
void SetGpio ( int  Pin)

Definition at line 154 of file d_power.c.

Variable Documentation

int Hw = 0

Definition at line 89 of file d_power.c.

INPIN PowerPin[POWER_PINS]

Definition at line 101 of file d_power.c.

INPIN* pPowerPin[]
Initial value:
=
{
[FINAL] = FINAL_PowerPin,
[FINALB] = FINALB_PowerPin,
[EP2] = EP2_PowerPin,
}
#define EP2
Schematics revision D.
Definition: lms2012.h:99
#define FINAL
Final prototype.
Definition: lms2012.h:101
#define FINALB
Schematics revision B and C.
Definition: lms2012.h:100

Definition at line 142 of file d_power.c.