Merge remote-tracking branch 'origin/upstream/linux-linaro-lsk-v3.10-android+android...
[firefly-linux-kernel-4.4.55.git] / include / linux / regulator / rt5025-regulator.h
1 /*
2  *  include/linux/regulator/rt5025-regulator.h
3  *  Include header file to Richtek RT5025 Regulator driver
4  *
5  *  Copyright (C) 2013 Richtek Electronics
6  *  cy_huang <cy_huang@richtek.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  */
12
13 #ifndef __LINUX_RT5025_REGULATOR_H
14 #define __LINUX_RT5025_REGULATOR_H
15
16 #define RT5025_REG_DCDCCTRL1 0x08
17 #define RT5025_REG_DCDCCTRL2 0x09
18 #define RT5025_REG_DCDCCTRL3 0x0A
19 #define RT5025_REG_DCDCCTRL4 0x0B
20 #define RT5025_REG_LDOCTRL1  0x0D
21 #define RT5025_REG_LDOCTRL2  0x0E
22 #define RT5025_REG_LDOCTRL3  0x0F
23 #define RT5025_REG_LDOCTRL4  0x10
24 #define RT5025_REG_LDOCTRL5  0x11
25 #define RT5025_REG_LDOCTRL6  0x12
26 #define RT5025_REG_DCDCEN    0x17
27 #define RT5025_REG_LDOEN     0x18
28 #define RT5025_REG_DCDCVRC   0x0B
29 #define RT5025_REG_LDOVRC    0x00
30
31 #define RT5025_DCDCVOUT1     RT5025_REG_DCDCCTRL1
32 #define RT5025_DCDCVOUT2     RT5025_REG_DCDCCTRL2
33 #define RT5025_DCDCVOUT3     RT5025_REG_DCDCCTRL3
34 #define RT5025_DCDCVOUT4     RT5025_REG_DCDCCTRL4
35 #define RT5025_LDOVOUT1      RT5025_REG_LDOCTRL1
36 #define RT5025_LDOVOUT2      RT5025_REG_LDOCTRL2
37 #define RT5025_LDOVOUT3      RT5025_REG_LDOCTRL3
38 #define RT5025_LDOVOUT4      RT5025_REG_LDOCTRL4
39 #define RT5025_LDOVOUT5      RT5025_REG_LDOCTRL5
40 #define RT5025_LDOVOUT6      RT5025_REG_LDOCTRL6
41
42 #define RT5025_DCDCVOUT_SHIFT1    2
43 #define RT5025_DCDCVOUT_SHIFT2    1
44 #define RT5025_DCDCVOUT_SHIFT3    2
45 #define RT5025_DCDCVOUT_SHIFT4    0
46 #define RT5025_LDOVOUT_SHIFT1     0
47 #define RT5025_LDOVOUT_SHIFT2     0
48 #define RT5025_LDOVOUT_SHIFT3     3
49 #define RT5025_LDOVOUT_SHIFT4     3
50 #define RT5025_LDOVOUT_SHIFT5     3
51 #define RT5025_LDOVOUT_SHIFT6     3
52
53 #define RT5025_DCDCVOUT_MASK1     0xFC
54 #define RT5025_DCDCVOUT_MASK2     0xFE
55 #define RT5025_DCDCVOUT_MASK3     0xFC
56 #define RT5025_DCDCVOUT_MASK4     0x0F
57 #define RT5025_LDOVOUT_MASK1      0x7F
58 #define RT5025_LDOVOUT_MASK2      0x7F
59 #define RT5025_LDOVOUT_MASK3      0xF8
60 #define RT5025_LDOVOUT_MASK4      0xF8
61 #define RT5025_LDOVOUT_MASK5      0xF8
62 #define RT5025_LDOVOUT_MASK6      0xF8
63
64 #define RT5025_DCDC_OUTPUT_EN     RT5025_REG_DCDCEN
65 #define RT5025_LDO_OUTPUT_EN      RT5025_REG_LDOEN
66
67 #define RT5025_DCDCEN_MASK1       0x01
68 #define RT5025_DCDCEN_MASK2       0x02
69 #define RT5025_DCDCEN_MASK3       0x04
70 #define RT5025_DCDCEN_MASK4       0x08
71 #define RT5025_LDOEN_MASK1        0x01
72 #define RT5025_LDOEN_MASK2        0x02
73 #define RT5025_LDOEN_MASK3        0x04
74 #define RT5025_LDOEN_MASK4        0x08
75 #define RT5025_LDOEN_MASK5        0x10
76 #define RT5025_LDOEN_MASK6        0x20
77
78 #define RT5025_DCDCMODE_MASK1     0x40
79 #define RT5025_DCDCMODE_MASK2     0x20
80 #define RT5025_DCDCMODE_MASK3     0x10
81 #define RT5025_DCDCMODE_MASK4     0x00
82 #define RT5025_LDOMODE_MASK1      0x00
83 #define RT5025_LDOMODE_MASK2      0x00
84 #define RT5025_LDOMODE_MASK3      0x00
85 #define RT5025_LDOMODE_MASK4      0x00
86 #define RT5025_LDOMODE_MASK5      0x00
87 #define RT5025_LDOMODE_MASK6      0x00
88
89 #endif  /* __LINUX_RT5025_REGULATOR_H */