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

Go to the source code of this file.

Data Structures

struct  lp872x
 

Macros

#define LP872X_GENERAL_CFG   0x00
 
#define LP872X_LDO1_VOUT   0x01
 
#define LP872X_LDO2_VOUT   0x02
 
#define LP872X_LDO3_VOUT   0x03
 
#define LP872X_LDO4_VOUT   0x04
 
#define LP872X_LDO5_VOUT   0x05
 
#define LP8720_BUCK_VOUT1   0x06
 
#define LP8720_BUCK_VOUT2   0x07
 
#define LP8720_ENABLE   0x08
 
#define LP8725_LILO1_VOUT   0x06
 
#define LP8725_LILO2_VOUT   0x07
 
#define LP8725_BUCK1_VOUT1   0x08
 
#define LP8725_BUCK1_VOUT2   0x09
 
#define LP8725_BUCK2_VOUT1   0x0A
 
#define LP8725_BUCK2_VOUT2   0x0B
 
#define LP8725_BUCK_CTRL   0x0C
 
#define LP8725_LDO_CTRL   0x0D
 
#define LP872X_VOUT_M   0x1F
 
#define LP872X_START_DELAY_M   0xE0
 
#define LP872X_START_DELAY_S   5
 
#define LP872X_EN_LDO1_M   BIT(0)
 
#define LP872X_EN_LDO2_M   BIT(1)
 
#define LP872X_EN_LDO3_M   BIT(2)
 
#define LP872X_EN_LDO4_M   BIT(3)
 
#define LP872X_EN_LDO5_M   BIT(4)
 
#define LP8720_TIMESTEP_S   0 /* Addr 00h */
 
#define LP8720_TIMESTEP_M   BIT(0)
 
#define LP8720_EXT_DVS_M   BIT(2)
 
#define LP8720_BUCK_FPWM_S   5 /* Addr 07h */
 
#define LP8720_BUCK_FPWM_M   BIT(5)
 
#define LP8720_EN_BUCK_M   BIT(5) /* Addr 08h */
 
#define LP8720_DVS_SEL_M   BIT(7)
 
#define LP8725_TIMESTEP_M   0xC0 /* Addr 00h */
 
#define LP8725_TIMESTEP_S   6
 
#define LP8725_BUCK1_EN_M   BIT(0)
 
#define LP8725_DVS1_M   BIT(2)
 
#define LP8725_DVS2_M   BIT(3)
 
#define LP8725_BUCK2_EN_M   BIT(4)
 
#define LP8725_BUCK_CL_M   0xC0 /* Addr 09h, 0Bh */
 
#define LP8725_BUCK_CL_S   6
 
#define LP8725_BUCK1_FPWM_S   1 /* Addr 0Ch */
 
#define LP8725_BUCK1_FPWM_M   BIT(1)
 
#define LP8725_BUCK2_FPWM_S   5
 
#define LP8725_BUCK2_FPWM_M   BIT(5)
 
#define LP8725_EN_LILO1_M   BIT(5) /* Addr 0Dh */
 
#define LP8725_EN_LILO2_M   BIT(6)
 
#define LP872X_FORCE_PWM   1
 
#define LP872X_AUTO_PWM   0
 
#define LP8720_NUM_REGULATORS   6
 
#define LP8725_NUM_REGULATORS   9
 
#define EXTERN_DVS_USED   0
 
#define MAX_DELAY   6
 
#define LP8720_DEFAULT_DVS   0
 
#define LP8725_DEFAULT_DVS   BIT(2)
 
#define MAX_REGISTERS   0x0F
 
#define EXT_R   0 /* external resistor divider */
 

Enumerations

enum  lp872x_id { LP8720, LP8725 }
 

Functions

 MODULE_DEVICE_TABLE (i2c, lp872x_ids)
 
 module_i2c_driver (lp872x_driver)
 
 MODULE_DESCRIPTION ("TI/National Semiconductor LP872x PMU Regulator Driver")
 
 MODULE_AUTHOR ("Milo Kim")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define EXT_R   0 /* external resistor divider */

Definition at line 137 of file lp872x.c.

#define EXTERN_DVS_USED   0

Definition at line 86 of file lp872x.c.

#define LP8720_BUCK_FPWM_M   BIT(5)

Definition at line 60 of file lp872x.c.

#define LP8720_BUCK_FPWM_S   5 /* Addr 07h */

Definition at line 59 of file lp872x.c.

#define LP8720_BUCK_VOUT1   0x06

Definition at line 31 of file lp872x.c.

#define LP8720_BUCK_VOUT2   0x07

Definition at line 32 of file lp872x.c.

#define LP8720_DEFAULT_DVS   0

Definition at line 90 of file lp872x.c.

#define LP8720_DVS_SEL_M   BIT(7)

Definition at line 62 of file lp872x.c.

#define LP8720_EN_BUCK_M   BIT(5) /* Addr 08h */

Definition at line 61 of file lp872x.c.

#define LP8720_ENABLE   0x08

Definition at line 33 of file lp872x.c.

#define LP8720_EXT_DVS_M   BIT(2)

Definition at line 58 of file lp872x.c.

#define LP8720_NUM_REGULATORS   6

Definition at line 84 of file lp872x.c.

#define LP8720_TIMESTEP_M   BIT(0)

Definition at line 57 of file lp872x.c.

#define LP8720_TIMESTEP_S   0 /* Addr 00h */

Definition at line 56 of file lp872x.c.

#define LP8725_BUCK1_EN_M   BIT(0)

Definition at line 67 of file lp872x.c.

#define LP8725_BUCK1_FPWM_M   BIT(1)

Definition at line 74 of file lp872x.c.

#define LP8725_BUCK1_FPWM_S   1 /* Addr 0Ch */

Definition at line 73 of file lp872x.c.

#define LP8725_BUCK1_VOUT1   0x08

Definition at line 38 of file lp872x.c.

#define LP8725_BUCK1_VOUT2   0x09

Definition at line 39 of file lp872x.c.

#define LP8725_BUCK2_EN_M   BIT(4)

Definition at line 70 of file lp872x.c.

#define LP8725_BUCK2_FPWM_M   BIT(5)

Definition at line 76 of file lp872x.c.

#define LP8725_BUCK2_FPWM_S   5

Definition at line 75 of file lp872x.c.

#define LP8725_BUCK2_VOUT1   0x0A

Definition at line 40 of file lp872x.c.

#define LP8725_BUCK2_VOUT2   0x0B

Definition at line 41 of file lp872x.c.

#define LP8725_BUCK_CL_M   0xC0 /* Addr 09h, 0Bh */

Definition at line 71 of file lp872x.c.

#define LP8725_BUCK_CL_S   6

Definition at line 72 of file lp872x.c.

#define LP8725_BUCK_CTRL   0x0C

Definition at line 42 of file lp872x.c.

#define LP8725_DEFAULT_DVS   BIT(2)

Definition at line 91 of file lp872x.c.

#define LP8725_DVS1_M   BIT(2)

Definition at line 68 of file lp872x.c.

#define LP8725_DVS2_M   BIT(3)

Definition at line 69 of file lp872x.c.

#define LP8725_EN_LILO1_M   BIT(5) /* Addr 0Dh */

Definition at line 77 of file lp872x.c.

#define LP8725_EN_LILO2_M   BIT(6)

Definition at line 78 of file lp872x.c.

#define LP8725_LDO_CTRL   0x0D

Definition at line 43 of file lp872x.c.

#define LP8725_LILO1_VOUT   0x06

Definition at line 36 of file lp872x.c.

#define LP8725_LILO2_VOUT   0x07

Definition at line 37 of file lp872x.c.

#define LP8725_NUM_REGULATORS   9

Definition at line 85 of file lp872x.c.

#define LP8725_TIMESTEP_M   0xC0 /* Addr 00h */

Definition at line 65 of file lp872x.c.

#define LP8725_TIMESTEP_S   6

Definition at line 66 of file lp872x.c.

#define LP872X_AUTO_PWM   0

Definition at line 82 of file lp872x.c.

#define LP872X_EN_LDO1_M   BIT(0)

Definition at line 49 of file lp872x.c.

#define LP872X_EN_LDO2_M   BIT(1)

Definition at line 50 of file lp872x.c.

#define LP872X_EN_LDO3_M   BIT(2)

Definition at line 51 of file lp872x.c.

#define LP872X_EN_LDO4_M   BIT(3)

Definition at line 52 of file lp872x.c.

#define LP872X_EN_LDO5_M   BIT(4)

Definition at line 53 of file lp872x.c.

#define LP872X_FORCE_PWM   1

Definition at line 81 of file lp872x.c.

#define LP872X_GENERAL_CFG   0x00

Definition at line 23 of file lp872x.c.

#define LP872X_LDO1_VOUT   0x01

Definition at line 24 of file lp872x.c.

#define LP872X_LDO2_VOUT   0x02

Definition at line 25 of file lp872x.c.

#define LP872X_LDO3_VOUT   0x03

Definition at line 26 of file lp872x.c.

#define LP872X_LDO4_VOUT   0x04

Definition at line 27 of file lp872x.c.

#define LP872X_LDO5_VOUT   0x05

Definition at line 28 of file lp872x.c.

#define LP872X_START_DELAY_M   0xE0

Definition at line 47 of file lp872x.c.

#define LP872X_START_DELAY_S   5

Definition at line 48 of file lp872x.c.

#define LP872X_VOUT_M   0x1F

Definition at line 46 of file lp872x.c.

#define MAX_DELAY   6

Definition at line 87 of file lp872x.c.

#define MAX_REGISTERS   0x0F

Definition at line 94 of file lp872x.c.

Enumeration Type Documentation

enum lp872x_id
Enumerator:
LP8720 
LP8725 

Definition at line 96 of file lp872x.c.

Function Documentation

MODULE_AUTHOR ( "Milo Kim"  )
MODULE_DESCRIPTION ( "TI/National Semiconductor LP872x PMU Regulator Driver"  )
MODULE_DEVICE_TABLE ( i2c  ,
lp872x_ids   
)
module_i2c_driver ( lp872x_driver  )
MODULE_LICENSE ( "GPL"  )