aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/wimax/samsung/max8893.h
blob: 9c7a4ec8dc412a146101a3a40a30202a4ed6a672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
*
*	MAX8893 PMIC driver for WiMAX with CMC732.
*	This is not a regulator driver.
*/

#ifndef MAX8893_H
#define MAX8993_H __FILE__
/*
*
*
*		Default/Reset values of MAX8893C registers
*
*
*
*/
/*
#define DEF_VAL_MAX8893_REG_ONOFF 0x01
#define DEF_VAL_MAX8893_REG_DISCHARGE	0xff
#define DEF_VAL_MAX8893_REG_LSTIME	0x08
#define DEF_VAL_MAX8893_REG_DVSRAMP	0x09
#define DEF_VAL_MAX8893_REG_BUCK	0x02
#define DEF_VAL_MAX8893_REG_LDO1	0x02
#define DEF_VAL_MAX8893_REG_LDO2	0x0e
#define DEF_VAL_MAX8893_REG_LDO3	0x11
#define DEF_VAL_MAX8893_REG_LDO4	0x19
#define DEF_VAL_MAX8893_REG_LDO5	0x16
*/
/*
*
*		Register address of MAX8893 A/B/C
*		BUCK is marked as LDO "-1"
*/

#define BUCK (-1)
#define LDO1 1
#define LDO2 2
#define LDO3 3
#define LDO4 4
#define LDO5 5
#define DISABLE_USB 6
#define MAX8893_REG_ONOFF 0x00
#define MAX8893_REG_DISCHARGE	0x01
#define MAX8893_REG_LSTIME	0x02
#define MAX8893_REG_DVSRAMP	0x03
#define MAX8893_REG_LDO(x) ((x+1) ? (4+x) : 4)
#define ON 1
#define OFF 0

/*
*	The maximum and minimum voltage an LDO can provide
*	Buck, x = -1
*/

#define MAX_VOLTAGE(x) ((x+1) ? 3300 : 2400)
#define MIN_VOLTAGE(x) ((0x04&x) ? 800 : ((0x01&x) ? 1600 : 1200))
/*
*
*
*ENABLE_LDO(x) generates a mask which needs
*to be ORed with the contents of onoff reg
*
*DISABLE_LDO(x) generates a mask which needs
*to be ANDed with contents of the off reg
*
*For BUCK, x=-1
*/
#define ENABLE_LDO(x) (0x80>>(x+1))
#define DISABLE_LDO(x) (~(0x80>>(x+1)))

int wimax_pmic_set_voltage(void);
#endif