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

Go to the source code of this file.

Data Structures

struct  lp3972
 

Macros

#define LP3972_SCR_REG   0x07
 
#define LP3972_OVER1_REG   0x10
 
#define LP3972_OVSR1_REG   0x11
 
#define LP3972_OVER2_REG   0x12
 
#define LP3972_OVSR2_REG   0x13
 
#define LP3972_VCC1_REG   0x20
 
#define LP3972_ADTV1_REG   0x23
 
#define LP3972_ADTV2_REG   0x24
 
#define LP3972_AVRC_REG   0x25
 
#define LP3972_CDTC1_REG   0x26
 
#define LP3972_CDTC2_REG   0x27
 
#define LP3972_SDTV1_REG   0x29
 
#define LP3972_SDTV2_REG   0x2A
 
#define LP3972_MDTV1_REG   0x32
 
#define LP3972_MDTV2_REG   0x33
 
#define LP3972_L2VCR_REG   0x39
 
#define LP3972_L34VCR_REG   0x3A
 
#define LP3972_SCR1_REG   0x80
 
#define LP3972_SCR2_REG   0x81
 
#define LP3972_OEN3_REG   0x82
 
#define LP3972_OSR3_REG   0x83
 
#define LP3972_LOER4_REG   0x84
 
#define LP3972_B2TV_REG   0x85
 
#define LP3972_B3TV_REG   0x86
 
#define LP3972_B32RC_REG   0x87
 
#define LP3972_ISRA_REG   0x88
 
#define LP3972_BCCR_REG   0x89
 
#define LP3972_II1RR_REG   0x8E
 
#define LP3972_II2RR_REG   0x8F
 
#define LP3972_SYS_CONTROL1_REG   LP3972_SCR1_REG
 
#define SYS_CONTROL1_INIT_VAL   0x02
 
#define SYS_CONTROL1_INIT_MASK   0x1F
 
#define LP3972_VOL_CHANGE_REG   LP3972_VCC1_REG
 
#define LP3972_VOL_CHANGE_FLAG_GO   0x01
 
#define LP3972_VOL_CHANGE_FLAG_MASK   0x03
 
#define LP3972_OEN3_L1EN   BIT(0)
 
#define LP3972_OVER2_LDO2_EN   BIT(2)
 
#define LP3972_OVER2_LDO3_EN   BIT(3)
 
#define LP3972_OVER2_LDO4_EN   BIT(4)
 
#define LP3972_OVER1_S_EN   BIT(2)
 
#define LP3972_LDO_OUTPUT_ENABLE_MASK(x)   (ldo_output_enable_mask[x])
 
#define LP3972_LDO_OUTPUT_ENABLE_REG(x)   (ldo_output_enable_addr[x])
 
#define LP3972_LDO_VOL_CONTR_SHIFT(x)   (((x) & 1) << 2)
 
#define LP3972_LDO_VOL_CONTR_REG(x)   (ldo_vol_ctl_addr[x])
 
#define LP3972_LDO_VOL_CHANGE_SHIFT(x)   ((x) ? 4 : 6)
 
#define LP3972_LDO_VOL_MASK(x)   (((x) % 4) ? 0x0f : 0x1f)
 
#define LP3972_LDO_VOL_MIN_IDX(x)   (((x) == 4) ? 0x05 : 0x00)
 
#define LP3972_LDO_VOL_MAX_IDX(x)   ((x) ? (((x) == 4) ? 0x1f : 0x0f) : 0x0c)
 
#define LP3972_BUCK_VOL_ENABLE_REG(x)   (buck_vol_enable_addr[x])
 
#define LP3972_BUCK_VOL1_REG(x)   (buck_base_addr[x])
 
#define LP3972_BUCK_VOL_MASK   0x1f
 
#define LP3972_BUCK_VOL_MIN_IDX(x)   ((x) ? 0x01 : 0x00)
 
#define LP3972_BUCK_VOL_MAX_IDX(x)   ((x) ? 0x19 : 0x1f)
 

Functions

 MODULE_DEVICE_TABLE (i2c, lp3972_i2c_id)
 
 subsys_initcall (lp3972_module_init)
 
 module_exit (lp3972_module_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Axel Lin <[email protected]>")
 
 MODULE_DESCRIPTION ("LP3972 PMIC driver")
 

Macro Definition Documentation

#define LP3972_ADTV1_REG   0x23

Definition at line 36 of file lp3972.c.

#define LP3972_ADTV2_REG   0x24

Definition at line 37 of file lp3972.c.

#define LP3972_AVRC_REG   0x25

Definition at line 38 of file lp3972.c.

#define LP3972_B2TV_REG   0x85

Definition at line 52 of file lp3972.c.

#define LP3972_B32RC_REG   0x87

Definition at line 54 of file lp3972.c.

#define LP3972_B3TV_REG   0x86

Definition at line 53 of file lp3972.c.

#define LP3972_BCCR_REG   0x89

Definition at line 56 of file lp3972.c.

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

Definition at line 166 of file lp3972.c.

#define LP3972_BUCK_VOL_ENABLE_REG (   x)    (buck_vol_enable_addr[x])

Definition at line 165 of file lp3972.c.

#define LP3972_BUCK_VOL_MASK   0x1f

Definition at line 167 of file lp3972.c.

#define LP3972_BUCK_VOL_MAX_IDX (   x)    ((x) ? 0x19 : 0x1f)

Definition at line 169 of file lp3972.c.

#define LP3972_BUCK_VOL_MIN_IDX (   x)    ((x) ? 0x01 : 0x00)

Definition at line 168 of file lp3972.c.

#define LP3972_CDTC1_REG   0x26

Definition at line 39 of file lp3972.c.

#define LP3972_CDTC2_REG   0x27

Definition at line 40 of file lp3972.c.

#define LP3972_II1RR_REG   0x8E

Definition at line 57 of file lp3972.c.

#define LP3972_II2RR_REG   0x8F

Definition at line 58 of file lp3972.c.

#define LP3972_ISRA_REG   0x88

Definition at line 55 of file lp3972.c.

#define LP3972_L2VCR_REG   0x39

Definition at line 45 of file lp3972.c.

#define LP3972_L34VCR_REG   0x3A

Definition at line 46 of file lp3972.c.

#define LP3972_LDO_OUTPUT_ENABLE_MASK (   x)    (ldo_output_enable_mask[x])

Definition at line 149 of file lp3972.c.

#define LP3972_LDO_OUTPUT_ENABLE_REG (   x)    (ldo_output_enable_addr[x])

Definition at line 150 of file lp3972.c.

#define LP3972_LDO_VOL_CHANGE_SHIFT (   x)    ((x) ? 4 : 6)

Definition at line 159 of file lp3972.c.

#define LP3972_LDO_VOL_CONTR_REG (   x)    (ldo_vol_ctl_addr[x])

Definition at line 158 of file lp3972.c.

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

Definition at line 157 of file lp3972.c.

#define LP3972_LDO_VOL_MASK (   x)    (((x) % 4) ? 0x0f : 0x1f)

Definition at line 161 of file lp3972.c.

#define LP3972_LDO_VOL_MAX_IDX (   x)    ((x) ? (((x) == 4) ? 0x1f : 0x0f) : 0x0c)

Definition at line 163 of file lp3972.c.

#define LP3972_LDO_VOL_MIN_IDX (   x)    (((x) == 4) ? 0x05 : 0x00)

Definition at line 162 of file lp3972.c.

#define LP3972_LOER4_REG   0x84

Definition at line 51 of file lp3972.c.

#define LP3972_MDTV1_REG   0x32

Definition at line 43 of file lp3972.c.

#define LP3972_MDTV2_REG   0x33

Definition at line 44 of file lp3972.c.

#define LP3972_OEN3_L1EN   BIT(0)

Definition at line 71 of file lp3972.c.

#define LP3972_OEN3_REG   0x82

Definition at line 49 of file lp3972.c.

#define LP3972_OSR3_REG   0x83

Definition at line 50 of file lp3972.c.

#define LP3972_OVER1_REG   0x10

Definition at line 31 of file lp3972.c.

#define LP3972_OVER1_S_EN   BIT(2)

Definition at line 75 of file lp3972.c.

#define LP3972_OVER2_LDO2_EN   BIT(2)

Definition at line 72 of file lp3972.c.

#define LP3972_OVER2_LDO3_EN   BIT(3)

Definition at line 73 of file lp3972.c.

#define LP3972_OVER2_LDO4_EN   BIT(4)

Definition at line 74 of file lp3972.c.

#define LP3972_OVER2_REG   0x12

Definition at line 33 of file lp3972.c.

#define LP3972_OVSR1_REG   0x11

Definition at line 32 of file lp3972.c.

#define LP3972_OVSR2_REG   0x13

Definition at line 34 of file lp3972.c.

#define LP3972_SCR1_REG   0x80

Definition at line 47 of file lp3972.c.

#define LP3972_SCR2_REG   0x81

Definition at line 48 of file lp3972.c.

#define LP3972_SCR_REG   0x07

Definition at line 30 of file lp3972.c.

#define LP3972_SDTV1_REG   0x29

Definition at line 41 of file lp3972.c.

#define LP3972_SDTV2_REG   0x2A

Definition at line 42 of file lp3972.c.

#define LP3972_SYS_CONTROL1_REG   LP3972_SCR1_REG

Definition at line 60 of file lp3972.c.

#define LP3972_VCC1_REG   0x20

Definition at line 35 of file lp3972.c.

#define LP3972_VOL_CHANGE_FLAG_GO   0x01

Definition at line 67 of file lp3972.c.

#define LP3972_VOL_CHANGE_FLAG_MASK   0x03

Definition at line 68 of file lp3972.c.

#define LP3972_VOL_CHANGE_REG   LP3972_VCC1_REG

Definition at line 66 of file lp3972.c.

#define SYS_CONTROL1_INIT_MASK   0x1F

Definition at line 64 of file lp3972.c.

#define SYS_CONTROL1_INIT_VAL   0x02

Definition at line 63 of file lp3972.c.

Function Documentation

MODULE_AUTHOR ( "Axel Lin <[email protected]>"  )
MODULE_DESCRIPTION ( "LP3972 PMIC driver )
MODULE_DEVICE_TABLE ( i2c  ,
lp3972_i2c_id   
)
module_exit ( lp3972_module_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( lp3972_module_init  )