Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
lp8788-ldo.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/gpio.h>
#include <linux/mfd/lp8788.h>

Go to the source code of this file.

Data Structures

struct  lp8788_ldo
 

Macros

#define LP8788_EN_LDO_A   0x0D /* DLDO 1 ~ 8 */
 
#define LP8788_EN_LDO_B   0x0E /* DLDO 9 ~ 12, ALDO 1 ~ 4 */
 
#define LP8788_EN_LDO_C   0x0F /* ALDO 5 ~ 10 */
 
#define LP8788_EN_SEL   0x10
 
#define LP8788_DLDO1_VOUT   0x2E
 
#define LP8788_DLDO2_VOUT   0x2F
 
#define LP8788_DLDO3_VOUT   0x30
 
#define LP8788_DLDO4_VOUT   0x31
 
#define LP8788_DLDO5_VOUT   0x32
 
#define LP8788_DLDO6_VOUT   0x33
 
#define LP8788_DLDO7_VOUT   0x34
 
#define LP8788_DLDO8_VOUT   0x35
 
#define LP8788_DLDO9_VOUT   0x36
 
#define LP8788_DLDO10_VOUT   0x37
 
#define LP8788_DLDO11_VOUT   0x38
 
#define LP8788_DLDO12_VOUT   0x39
 
#define LP8788_ALDO1_VOUT   0x3A
 
#define LP8788_ALDO2_VOUT   0x3B
 
#define LP8788_ALDO3_VOUT   0x3C
 
#define LP8788_ALDO4_VOUT   0x3D
 
#define LP8788_ALDO5_VOUT   0x3E
 
#define LP8788_ALDO6_VOUT   0x3F
 
#define LP8788_ALDO7_VOUT   0x40
 
#define LP8788_ALDO8_VOUT   0x41
 
#define LP8788_ALDO9_VOUT   0x42
 
#define LP8788_ALDO10_VOUT   0x43
 
#define LP8788_DLDO1_TIMESTEP   0x44
 
#define LP8788_EN_DLDO1_M   BIT(0) /* Addr 0Dh ~ 0Fh */
 
#define LP8788_EN_DLDO2_M   BIT(1)
 
#define LP8788_EN_DLDO3_M   BIT(2)
 
#define LP8788_EN_DLDO4_M   BIT(3)
 
#define LP8788_EN_DLDO5_M   BIT(4)
 
#define LP8788_EN_DLDO6_M   BIT(5)
 
#define LP8788_EN_DLDO7_M   BIT(6)
 
#define LP8788_EN_DLDO8_M   BIT(7)
 
#define LP8788_EN_DLDO9_M   BIT(0)
 
#define LP8788_EN_DLDO10_M   BIT(1)
 
#define LP8788_EN_DLDO11_M   BIT(2)
 
#define LP8788_EN_DLDO12_M   BIT(3)
 
#define LP8788_EN_ALDO1_M   BIT(4)
 
#define LP8788_EN_ALDO2_M   BIT(5)
 
#define LP8788_EN_ALDO3_M   BIT(6)
 
#define LP8788_EN_ALDO4_M   BIT(7)
 
#define LP8788_EN_ALDO5_M   BIT(0)
 
#define LP8788_EN_ALDO6_M   BIT(1)
 
#define LP8788_EN_ALDO7_M   BIT(2)
 
#define LP8788_EN_ALDO8_M   BIT(3)
 
#define LP8788_EN_ALDO9_M   BIT(4)
 
#define LP8788_EN_ALDO10_M   BIT(5)
 
#define LP8788_EN_SEL_DLDO911_M   BIT(0) /* Addr 10h */
 
#define LP8788_EN_SEL_DLDO7_M   BIT(1)
 
#define LP8788_EN_SEL_ALDO7_M   BIT(2)
 
#define LP8788_EN_SEL_ALDO5_M   BIT(3)
 
#define LP8788_EN_SEL_ALDO234_M   BIT(4)
 
#define LP8788_EN_SEL_ALDO1_M   BIT(5)
 
#define LP8788_VOUT_5BIT_M   0x1F /* Addr 2Eh ~ 43h */
 
#define LP8788_VOUT_4BIT_M   0x0F
 
#define LP8788_VOUT_3BIT_M   0x07
 
#define LP8788_VOUT_1BIT_M   0x01
 
#define LP8788_STARTUP_TIME_M   0xF8 /* Addr 44h ~ 59h */
 
#define LP8788_STARTUP_TIME_S   3
 
#define ENABLE_TIME_USEC   32
 
#define ENABLE   GPIOF_OUT_INIT_HIGH
 
#define DISABLE   GPIOF_OUT_INIT_LOW
 

Enumerations

enum  lp8788_enable_mode { REGISTER, EXTPIN }
 
enum  lp8788_ldo_id {
  DLDO1, DLDO2, DLDO3, DLDO4,
  DLDO5, DLDO6, DLDO7, DLDO8,
  DLDO9, DLDO10, DLDO11, DLDO12,
  ALDO1, ALDO2, ALDO3, ALDO4,
  ALDO5, ALDO6, ALDO7, ALDO8,
  ALDO9, ALDO10
}
 

Functions

 subsys_initcall (lp8788_ldo_init)
 
 module_exit (lp8788_ldo_exit)
 
 MODULE_DESCRIPTION ("TI LP8788 LDO Driver")
 
 MODULE_AUTHOR ("Milo Kim")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:lp8788-dldo")
 
 MODULE_ALIAS ("platform:lp8788-aldo")
 

Variables

const int lp8788_dldo1239_vtbl []
 

Macro Definition Documentation

#define DISABLE   GPIOF_OUT_INIT_LOW

Definition at line 89 of file lp8788-ldo.c.

#define ENABLE   GPIOF_OUT_INIT_HIGH

Definition at line 88 of file lp8788-ldo.c.

#define ENABLE_TIME_USEC   32

Definition at line 87 of file lp8788-ldo.c.

#define LP8788_ALDO10_VOUT   0x43

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

#define LP8788_ALDO1_VOUT   0x3A

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

#define LP8788_ALDO2_VOUT   0x3B

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

#define LP8788_ALDO3_VOUT   0x3C

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

#define LP8788_ALDO4_VOUT   0x3D

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

#define LP8788_ALDO5_VOUT   0x3E

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

#define LP8788_ALDO6_VOUT   0x3F

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

#define LP8788_ALDO7_VOUT   0x40

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

#define LP8788_ALDO8_VOUT   0x41

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

#define LP8788_ALDO9_VOUT   0x42

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

#define LP8788_DLDO10_VOUT   0x37

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

#define LP8788_DLDO11_VOUT   0x38

Definition at line 37 of file lp8788-ldo.c.

#define LP8788_DLDO12_VOUT   0x39

Definition at line 38 of file lp8788-ldo.c.

#define LP8788_DLDO1_TIMESTEP   0x44

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

#define LP8788_DLDO1_VOUT   0x2E

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

#define LP8788_DLDO2_VOUT   0x2F

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

#define LP8788_DLDO3_VOUT   0x30

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

#define LP8788_DLDO4_VOUT   0x31

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

#define LP8788_DLDO5_VOUT   0x32

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

#define LP8788_DLDO6_VOUT   0x33

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

#define LP8788_DLDO7_VOUT   0x34

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

#define LP8788_DLDO8_VOUT   0x35

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

#define LP8788_DLDO9_VOUT   0x36

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

#define LP8788_EN_ALDO10_M   BIT(5)

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

#define LP8788_EN_ALDO1_M   BIT(4)

Definition at line 64 of file lp8788-ldo.c.

#define LP8788_EN_ALDO2_M   BIT(5)

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

#define LP8788_EN_ALDO3_M   BIT(6)

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

#define LP8788_EN_ALDO4_M   BIT(7)

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

#define LP8788_EN_ALDO5_M   BIT(0)

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

#define LP8788_EN_ALDO6_M   BIT(1)

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

#define LP8788_EN_ALDO7_M   BIT(2)

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

#define LP8788_EN_ALDO8_M   BIT(3)

Definition at line 71 of file lp8788-ldo.c.

#define LP8788_EN_ALDO9_M   BIT(4)

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

#define LP8788_EN_DLDO10_M   BIT(1)

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

#define LP8788_EN_DLDO11_M   BIT(2)

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

#define LP8788_EN_DLDO12_M   BIT(3)

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

#define LP8788_EN_DLDO1_M   BIT(0) /* Addr 0Dh ~ 0Fh */

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

#define LP8788_EN_DLDO2_M   BIT(1)

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

#define LP8788_EN_DLDO3_M   BIT(2)

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

#define LP8788_EN_DLDO4_M   BIT(3)

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

#define LP8788_EN_DLDO5_M   BIT(4)

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

#define LP8788_EN_DLDO6_M   BIT(5)

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

#define LP8788_EN_DLDO7_M   BIT(6)

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

#define LP8788_EN_DLDO8_M   BIT(7)

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

#define LP8788_EN_DLDO9_M   BIT(0)

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

#define LP8788_EN_LDO_A   0x0D /* DLDO 1 ~ 8 */

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

#define LP8788_EN_LDO_B   0x0E /* DLDO 9 ~ 12, ALDO 1 ~ 4 */

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

#define LP8788_EN_LDO_C   0x0F /* ALDO 5 ~ 10 */

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

#define LP8788_EN_SEL   0x10

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

#define LP8788_EN_SEL_ALDO1_M   BIT(5)

Definition at line 79 of file lp8788-ldo.c.

#define LP8788_EN_SEL_ALDO234_M   BIT(4)

Definition at line 78 of file lp8788-ldo.c.

#define LP8788_EN_SEL_ALDO5_M   BIT(3)

Definition at line 77 of file lp8788-ldo.c.

#define LP8788_EN_SEL_ALDO7_M   BIT(2)

Definition at line 76 of file lp8788-ldo.c.

#define LP8788_EN_SEL_DLDO7_M   BIT(1)

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

#define LP8788_EN_SEL_DLDO911_M   BIT(0) /* Addr 10h */

Definition at line 74 of file lp8788-ldo.c.

#define LP8788_STARTUP_TIME_M   0xF8 /* Addr 44h ~ 59h */

Definition at line 84 of file lp8788-ldo.c.

#define LP8788_STARTUP_TIME_S   3

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

#define LP8788_VOUT_1BIT_M   0x01

Definition at line 83 of file lp8788-ldo.c.

#define LP8788_VOUT_3BIT_M   0x07

Definition at line 82 of file lp8788-ldo.c.

#define LP8788_VOUT_4BIT_M   0x0F

Definition at line 81 of file lp8788-ldo.c.

#define LP8788_VOUT_5BIT_M   0x1F /* Addr 2Eh ~ 43h */

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

Enumeration Type Documentation

Enumerator:
REGISTER 
EXTPIN 

Definition at line 91 of file lp8788-ldo.c.

Enumerator:
DLDO1 
DLDO2 
DLDO3 
DLDO4 
DLDO5 
DLDO6 
DLDO7 
DLDO8 
DLDO9 
DLDO10 
DLDO11 
DLDO12 
ALDO1 
ALDO2 
ALDO3 
ALDO4 
ALDO5 
ALDO6 
ALDO7 
ALDO8 
ALDO9 
ALDO10 

Definition at line 96 of file lp8788-ldo.c.

Function Documentation

MODULE_ALIAS ( "platform:lp8788-dldo"  )
MODULE_ALIAS ( "platform:lp8788-aldo"  )
MODULE_AUTHOR ( "Milo Kim"  )
MODULE_DESCRIPTION ( "TI LP8788 LDO Driver"  )
module_exit ( lp8788_ldo_exit  )
MODULE_LICENSE ( "GPL"  )
subsys_initcall ( lp8788_ldo_init  )

Variable Documentation

const int lp8788_dldo1239_vtbl[]
Initial value:
= {
1800000, 1900000, 2000000, 2100000, 2200000, 2300000, 2400000, 2500000,
2600000, 2700000, 2800000, 2900000, 3000000, 2850000, 2850000, 2850000,
2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000,
2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000, 2850000,
}

Definition at line 129 of file lp8788-ldo.c.