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

Go to the source code of this file.

Data Structures

struct  lp8788_buck
 

Macros

#define LP8788_EN_BUCK   0x0C
 
#define LP8788_BUCK_DVS_SEL   0x1D
 
#define LP8788_BUCK1_VOUT0   0x1E
 
#define LP8788_BUCK1_VOUT1   0x1F
 
#define LP8788_BUCK1_VOUT2   0x20
 
#define LP8788_BUCK1_VOUT3   0x21
 
#define LP8788_BUCK2_VOUT0   0x22
 
#define LP8788_BUCK2_VOUT1   0x23
 
#define LP8788_BUCK2_VOUT2   0x24
 
#define LP8788_BUCK2_VOUT3   0x25
 
#define LP8788_BUCK3_VOUT   0x26
 
#define LP8788_BUCK4_VOUT   0x27
 
#define LP8788_BUCK1_TIMESTEP   0x28
 
#define LP8788_BUCK_PWM   0x2D
 
#define LP8788_EN_BUCK1_M   BIT(0) /* Addr 0Ch */
 
#define LP8788_EN_BUCK2_M   BIT(1)
 
#define LP8788_EN_BUCK3_M   BIT(2)
 
#define LP8788_EN_BUCK4_M   BIT(3)
 
#define LP8788_BUCK1_DVS_SEL_M   0x04 /* Addr 1Dh */
 
#define LP8788_BUCK1_DVS_M   0x03
 
#define LP8788_BUCK1_DVS_S   0
 
#define LP8788_BUCK2_DVS_SEL_M   0x40
 
#define LP8788_BUCK2_DVS_M   0x30
 
#define LP8788_BUCK2_DVS_S   4
 
#define LP8788_BUCK1_DVS_I2C   BIT(2)
 
#define LP8788_BUCK2_DVS_I2C   BIT(6)
 
#define LP8788_BUCK1_DVS_PIN   (0 << 2)
 
#define LP8788_BUCK2_DVS_PIN   (0 << 6)
 
#define LP8788_VOUT_M   0x1F /* Addr 1Eh ~ 27h */
 
#define LP8788_STARTUP_TIME_M   0xF8 /* Addr 28h ~ 2Bh */
 
#define LP8788_STARTUP_TIME_S   3
 
#define LP8788_FPWM_BUCK1_M   BIT(0) /* Addr 2Dh */
 
#define LP8788_FPWM_BUCK1_S   0
 
#define LP8788_FPWM_BUCK2_M   BIT(1)
 
#define LP8788_FPWM_BUCK2_S   1
 
#define LP8788_FPWM_BUCK3_M   BIT(2)
 
#define LP8788_FPWM_BUCK3_S   2
 
#define LP8788_FPWM_BUCK4_M   BIT(3)
 
#define LP8788_FPWM_BUCK4_S   3
 
#define INVALID_ADDR   0xFF
 
#define LP8788_FORCE_PWM   1
 
#define LP8788_AUTO_PWM   0
 
#define PIN_LOW   0
 
#define PIN_HIGH   1
 
#define ENABLE_TIME_USEC   32
 
#define BUCK_FPWM_MASK(x)   (1 << (x))
 
#define BUCK_FPWM_SHIFT(x)   (x)
 

Enumerations

enum  lp8788_dvs_state { DVS_LOW = GPIOF_OUT_INIT_LOW, DVS_HIGH = GPIOF_OUT_INIT_HIGH }
 
enum  lp8788_dvs_mode { REGISTER, EXTPIN }
 
enum  lp8788_buck_id { BUCK1, BUCK2, BUCK3, BUCK4 }
 

Functions

 subsys_initcall (lp8788_buck_init)
 
 module_exit (lp8788_buck_exit)
 
 MODULE_DESCRIPTION ("TI LP8788 BUCK Driver")
 
 MODULE_AUTHOR ("Milo Kim")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:lp8788-buck")
 

Macro Definition Documentation

#define BUCK_FPWM_MASK (   x)    (1 << (x))

Definition at line 72 of file lp8788-buck.c.

#define BUCK_FPWM_SHIFT (   x)    (x)

Definition at line 73 of file lp8788-buck.c.

#define ENABLE_TIME_USEC   32

Definition at line 70 of file lp8788-buck.c.

#define INVALID_ADDR   0xFF

Definition at line 65 of file lp8788-buck.c.

#define LP8788_AUTO_PWM   0

Definition at line 67 of file lp8788-buck.c.

#define LP8788_BUCK1_DVS_I2C   BIT(2)

Definition at line 49 of file lp8788-buck.c.

#define LP8788_BUCK1_DVS_M   0x03

Definition at line 44 of file lp8788-buck.c.

#define LP8788_BUCK1_DVS_PIN   (0 << 2)

Definition at line 51 of file lp8788-buck.c.

#define LP8788_BUCK1_DVS_S   0

Definition at line 45 of file lp8788-buck.c.

#define LP8788_BUCK1_DVS_SEL_M   0x04 /* Addr 1Dh */

Definition at line 43 of file lp8788-buck.c.

#define LP8788_BUCK1_TIMESTEP   0x28

Definition at line 35 of file lp8788-buck.c.

#define LP8788_BUCK1_VOUT0   0x1E

Definition at line 25 of file lp8788-buck.c.

#define LP8788_BUCK1_VOUT1   0x1F

Definition at line 26 of file lp8788-buck.c.

#define LP8788_BUCK1_VOUT2   0x20

Definition at line 27 of file lp8788-buck.c.

#define LP8788_BUCK1_VOUT3   0x21

Definition at line 28 of file lp8788-buck.c.

#define LP8788_BUCK2_DVS_I2C   BIT(6)

Definition at line 50 of file lp8788-buck.c.

#define LP8788_BUCK2_DVS_M   0x30

Definition at line 47 of file lp8788-buck.c.

#define LP8788_BUCK2_DVS_PIN   (0 << 6)

Definition at line 52 of file lp8788-buck.c.

#define LP8788_BUCK2_DVS_S   4

Definition at line 48 of file lp8788-buck.c.

#define LP8788_BUCK2_DVS_SEL_M   0x40

Definition at line 46 of file lp8788-buck.c.

#define LP8788_BUCK2_VOUT0   0x22

Definition at line 29 of file lp8788-buck.c.

#define LP8788_BUCK2_VOUT1   0x23

Definition at line 30 of file lp8788-buck.c.

#define LP8788_BUCK2_VOUT2   0x24

Definition at line 31 of file lp8788-buck.c.

#define LP8788_BUCK2_VOUT3   0x25

Definition at line 32 of file lp8788-buck.c.

#define LP8788_BUCK3_VOUT   0x26

Definition at line 33 of file lp8788-buck.c.

#define LP8788_BUCK4_VOUT   0x27

Definition at line 34 of file lp8788-buck.c.

#define LP8788_BUCK_DVS_SEL   0x1D

Definition at line 24 of file lp8788-buck.c.

#define LP8788_BUCK_PWM   0x2D

Definition at line 36 of file lp8788-buck.c.

#define LP8788_EN_BUCK   0x0C

Definition at line 23 of file lp8788-buck.c.

#define LP8788_EN_BUCK1_M   BIT(0) /* Addr 0Ch */

Definition at line 39 of file lp8788-buck.c.

#define LP8788_EN_BUCK2_M   BIT(1)

Definition at line 40 of file lp8788-buck.c.

#define LP8788_EN_BUCK3_M   BIT(2)

Definition at line 41 of file lp8788-buck.c.

#define LP8788_EN_BUCK4_M   BIT(3)

Definition at line 42 of file lp8788-buck.c.

#define LP8788_FORCE_PWM   1

Definition at line 66 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK1_M   BIT(0) /* Addr 2Dh */

Definition at line 56 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK1_S   0

Definition at line 57 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK2_M   BIT(1)

Definition at line 58 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK2_S   1

Definition at line 59 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK3_M   BIT(2)

Definition at line 60 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK3_S   2

Definition at line 61 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK4_M   BIT(3)

Definition at line 62 of file lp8788-buck.c.

#define LP8788_FPWM_BUCK4_S   3

Definition at line 63 of file lp8788-buck.c.

#define LP8788_STARTUP_TIME_M   0xF8 /* Addr 28h ~ 2Bh */

Definition at line 54 of file lp8788-buck.c.

#define LP8788_STARTUP_TIME_S   3

Definition at line 55 of file lp8788-buck.c.

#define LP8788_VOUT_M   0x1F /* Addr 1Eh ~ 27h */

Definition at line 53 of file lp8788-buck.c.

#define PIN_HIGH   1

Definition at line 69 of file lp8788-buck.c.

#define PIN_LOW   0

Definition at line 68 of file lp8788-buck.c.

Enumeration Type Documentation

Enumerator:
BUCK1 
BUCK2 
BUCK3 
BUCK4 

Definition at line 85 of file lp8788-buck.c.

Enumerator:
REGISTER 
EXTPIN 

Definition at line 80 of file lp8788-buck.c.

Enumerator:
DVS_LOW 
DVS_HIGH 

Definition at line 75 of file lp8788-buck.c.

Function Documentation

MODULE_ALIAS ( "platform:lp8788-buck"  )
MODULE_AUTHOR ( "Milo Kim"  )
MODULE_DESCRIPTION ( "TI LP8788 BUCK Driver"  )
module_exit ( lp8788_buck_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( lp8788_buck_init  )