Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
lp3971.c File Reference
#include <linux/bug.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/lp3971.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  lp3971
 

Macros

#define LP3971_SYS_CONTROL1_REG   0x07
 
#define SYS_CONTROL1_INIT_VAL   0x40
 
#define SYS_CONTROL1_INIT_MASK   0xCF
 
#define LP3971_BUCK_VOL_ENABLE_REG   0x10
 
#define LP3971_BUCK_VOL_CHANGE_REG   0x20
 
#define BUCK_VOL_CHANGE_SHIFT(x)   (((!!x) << 2) | (x & ~0x01))
 
#define BUCK_VOL_CHANGE_FLAG_GO   0x01
 
#define BUCK_VOL_CHANGE_FLAG_TARGET   0x02
 
#define BUCK_VOL_CHANGE_FLAG_MASK   0x03
 
#define LP3971_BUCK1_BASE   0x23
 
#define LP3971_BUCK2_BASE   0x29
 
#define LP3971_BUCK3_BASE   0x32
 
#define LP3971_BUCK_TARGET_VOL1_REG(x)   (buck_base_addr[x])
 
#define LP3971_BUCK_TARGET_VOL2_REG(x)   (buck_base_addr[x]+1)
 
#define BUCK_TARGET_VOL_MASK   0x3f
 
#define BUCK_TARGET_VOL_MIN_IDX   0x01
 
#define BUCK_TARGET_VOL_MAX_IDX   0x19
 
#define LP3971_BUCK_RAMP_REG(x)   (buck_base_addr[x]+2)
 
#define LP3971_LDO_ENABLE_REG   0x12
 
#define LP3971_LDO_VOL_CONTR_BASE   0x39
 
#define LP3971_LDO_VOL_CONTR_REG(x)   (LP3971_LDO_VOL_CONTR_BASE + (x >> 1))
 
#define LDO_VOL_CONTR_SHIFT(x)   ((x & 1) << 2)
 
#define LDO_VOL_CONTR_MASK   0x0f
 
#define LDO_VOL_MIN_IDX   0x00
 
#define LDO_VOL_MAX_IDX   0x0f
 

Functions

 MODULE_DEVICE_TABLE (i2c, lp3971_i2c_id)
 
 module_i2c_driver (lp3971_i2c_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Marek Szyprowski <[email protected]>")
 
 MODULE_DESCRIPTION ("LP3971 PMIC driver")
 

Macro Definition Documentation

#define BUCK_TARGET_VOL_MASK   0x3f

Definition at line 75 of file lp3971.c.

#define BUCK_TARGET_VOL_MAX_IDX   0x19

Definition at line 77 of file lp3971.c.

#define BUCK_TARGET_VOL_MIN_IDX   0x01

Definition at line 76 of file lp3971.c.

#define BUCK_VOL_CHANGE_FLAG_GO   0x01

Definition at line 51 of file lp3971.c.

#define BUCK_VOL_CHANGE_FLAG_MASK   0x03

Definition at line 53 of file lp3971.c.

#define BUCK_VOL_CHANGE_FLAG_TARGET   0x02

Definition at line 52 of file lp3971.c.

#define BUCK_VOL_CHANGE_SHIFT (   x)    (((!!x) << 2) | (x & ~0x01))

Definition at line 50 of file lp3971.c.

#define LDO_VOL_CONTR_MASK   0x0f

Definition at line 99 of file lp3971.c.

#define LDO_VOL_CONTR_SHIFT (   x)    ((x & 1) << 2)

Definition at line 98 of file lp3971.c.

#define LDO_VOL_MAX_IDX   0x0f

Definition at line 112 of file lp3971.c.

#define LDO_VOL_MIN_IDX   0x00

Definition at line 111 of file lp3971.c.

#define LP3971_BUCK1_BASE   0x23

Definition at line 55 of file lp3971.c.

#define LP3971_BUCK2_BASE   0x29

Definition at line 56 of file lp3971.c.

#define LP3971_BUCK3_BASE   0x32

Definition at line 57 of file lp3971.c.

#define LP3971_BUCK_RAMP_REG (   x)    (buck_base_addr[x]+2)

Definition at line 79 of file lp3971.c.

#define LP3971_BUCK_TARGET_VOL1_REG (   x)    (buck_base_addr[x])

Definition at line 65 of file lp3971.c.

#define LP3971_BUCK_TARGET_VOL2_REG (   x)    (buck_base_addr[x]+1)

Definition at line 66 of file lp3971.c.

#define LP3971_BUCK_VOL_CHANGE_REG   0x20

Definition at line 43 of file lp3971.c.

#define LP3971_BUCK_VOL_ENABLE_REG   0x10

Definition at line 42 of file lp3971.c.

#define LP3971_LDO_ENABLE_REG   0x12

Definition at line 81 of file lp3971.c.

#define LP3971_LDO_VOL_CONTR_BASE   0x39

Definition at line 82 of file lp3971.c.

#define LP3971_LDO_VOL_CONTR_REG (   x)    (LP3971_LDO_VOL_CONTR_BASE + (x >> 1))

Definition at line 91 of file lp3971.c.

#define LP3971_SYS_CONTROL1_REG   0x07

Definition at line 35 of file lp3971.c.

#define SYS_CONTROL1_INIT_MASK   0xCF

Definition at line 40 of file lp3971.c.

#define SYS_CONTROL1_INIT_VAL   0x40

Definition at line 39 of file lp3971.c.

Function Documentation

MODULE_AUTHOR ( "Marek Szyprowski <[email protected]>"  )
MODULE_DESCRIPTION ( "LP3971 PMIC driver )
MODULE_DEVICE_TABLE ( i2c  ,
lp3971_i2c_id   
)
module_i2c_driver ( lp3971_i2c_driver  )
MODULE_LICENSE ( "GPL"  )