xref: /linux/include/linux/mfd/samsung/s2mpa01.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1*39b27ad9SKrzysztof Kozlowski /* SPDX-License-Identifier: GPL-2.0+ */
2ce24991eSSachin Kamat /*
3ce24991eSSachin Kamat  * Copyright (c) 2013 Samsung Electronics Co., Ltd
4ce24991eSSachin Kamat  *		http://www.samsung.com
5ce24991eSSachin Kamat  */
6ce24991eSSachin Kamat 
7ce24991eSSachin Kamat #ifndef __LINUX_MFD_S2MPA01_H
8ce24991eSSachin Kamat #define __LINUX_MFD_S2MPA01_H
9ce24991eSSachin Kamat 
10ce24991eSSachin Kamat /* S2MPA01 registers */
11ce24991eSSachin Kamat enum s2mpa01_reg {
12ce24991eSSachin Kamat 	S2MPA01_REG_ID,
13ce24991eSSachin Kamat 	S2MPA01_REG_INT1,
14ce24991eSSachin Kamat 	S2MPA01_REG_INT2,
15ce24991eSSachin Kamat 	S2MPA01_REG_INT3,
16ce24991eSSachin Kamat 	S2MPA01_REG_INT1M,
17ce24991eSSachin Kamat 	S2MPA01_REG_INT2M,
18ce24991eSSachin Kamat 	S2MPA01_REG_INT3M,
19ce24991eSSachin Kamat 	S2MPA01_REG_ST1,
20ce24991eSSachin Kamat 	S2MPA01_REG_ST2,
21ce24991eSSachin Kamat 	S2MPA01_REG_PWRONSRC,
22ce24991eSSachin Kamat 	S2MPA01_REG_OFFSRC,
23ce24991eSSachin Kamat 	S2MPA01_REG_RTC_BUF,
24ce24991eSSachin Kamat 	S2MPA01_REG_CTRL1,
25ce24991eSSachin Kamat 	S2MPA01_REG_ETC_TEST,
26ce24991eSSachin Kamat 	S2MPA01_REG_RSVD1,
27ce24991eSSachin Kamat 	S2MPA01_REG_BU_CHG,
28ce24991eSSachin Kamat 	S2MPA01_REG_RAMP1,
29ce24991eSSachin Kamat 	S2MPA01_REG_RAMP2,
30ce24991eSSachin Kamat 	S2MPA01_REG_LDO_DSCH1,
31ce24991eSSachin Kamat 	S2MPA01_REG_LDO_DSCH2,
32ce24991eSSachin Kamat 	S2MPA01_REG_LDO_DSCH3,
33ce24991eSSachin Kamat 	S2MPA01_REG_LDO_DSCH4,
34ce24991eSSachin Kamat 	S2MPA01_REG_OTP_ADRL,
35ce24991eSSachin Kamat 	S2MPA01_REG_OTP_ADRH,
36ce24991eSSachin Kamat 	S2MPA01_REG_OTP_DATA,
37ce24991eSSachin Kamat 	S2MPA01_REG_MON1SEL,
38ce24991eSSachin Kamat 	S2MPA01_REG_MON2SEL,
39ce24991eSSachin Kamat 	S2MPA01_REG_LEE,
40ce24991eSSachin Kamat 	S2MPA01_REG_RSVD2,
41ce24991eSSachin Kamat 	S2MPA01_REG_RSVD3,
42ce24991eSSachin Kamat 	S2MPA01_REG_RSVD4,
43ce24991eSSachin Kamat 	S2MPA01_REG_RSVD5,
44ce24991eSSachin Kamat 	S2MPA01_REG_RSVD6,
45ce24991eSSachin Kamat 	S2MPA01_REG_TOP_RSVD,
46ce24991eSSachin Kamat 	S2MPA01_REG_DVS_SEL,
47ce24991eSSachin Kamat 	S2MPA01_REG_DVS_PTR,
48ce24991eSSachin Kamat 	S2MPA01_REG_DVS_DATA,
49ce24991eSSachin Kamat 	S2MPA01_REG_RSVD_NO,
50ce24991eSSachin Kamat 	S2MPA01_REG_UVLO,
51ce24991eSSachin Kamat 	S2MPA01_REG_LEE_NO,
52ce24991eSSachin Kamat 	S2MPA01_REG_B1CTRL1,
53ce24991eSSachin Kamat 	S2MPA01_REG_B1CTRL2,
54ce24991eSSachin Kamat 	S2MPA01_REG_B2CTRL1,
55ce24991eSSachin Kamat 	S2MPA01_REG_B2CTRL2,
56ce24991eSSachin Kamat 	S2MPA01_REG_B3CTRL1,
57ce24991eSSachin Kamat 	S2MPA01_REG_B3CTRL2,
58ce24991eSSachin Kamat 	S2MPA01_REG_B4CTRL1,
59ce24991eSSachin Kamat 	S2MPA01_REG_B4CTRL2,
60ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL1,
61ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL2,
62ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL3,
63ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL4,
64ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL5,
65ce24991eSSachin Kamat 	S2MPA01_REG_B5CTRL6,
66ce24991eSSachin Kamat 	S2MPA01_REG_B6CTRL1,
67ce24991eSSachin Kamat 	S2MPA01_REG_B6CTRL2,
68ce24991eSSachin Kamat 	S2MPA01_REG_B7CTRL1,
69ce24991eSSachin Kamat 	S2MPA01_REG_B7CTRL2,
70ce24991eSSachin Kamat 	S2MPA01_REG_B8CTRL1,
71ce24991eSSachin Kamat 	S2MPA01_REG_B8CTRL2,
72ce24991eSSachin Kamat 	S2MPA01_REG_B9CTRL1,
73ce24991eSSachin Kamat 	S2MPA01_REG_B9CTRL2,
74ce24991eSSachin Kamat 	S2MPA01_REG_B10CTRL1,
75ce24991eSSachin Kamat 	S2MPA01_REG_B10CTRL2,
76ce24991eSSachin Kamat 	S2MPA01_REG_L1CTRL,
77ce24991eSSachin Kamat 	S2MPA01_REG_L2CTRL,
78ce24991eSSachin Kamat 	S2MPA01_REG_L3CTRL,
79ce24991eSSachin Kamat 	S2MPA01_REG_L4CTRL,
80ce24991eSSachin Kamat 	S2MPA01_REG_L5CTRL,
81ce24991eSSachin Kamat 	S2MPA01_REG_L6CTRL,
82ce24991eSSachin Kamat 	S2MPA01_REG_L7CTRL,
83ce24991eSSachin Kamat 	S2MPA01_REG_L8CTRL,
84ce24991eSSachin Kamat 	S2MPA01_REG_L9CTRL,
85ce24991eSSachin Kamat 	S2MPA01_REG_L10CTRL,
86ce24991eSSachin Kamat 	S2MPA01_REG_L11CTRL,
87ce24991eSSachin Kamat 	S2MPA01_REG_L12CTRL,
88ce24991eSSachin Kamat 	S2MPA01_REG_L13CTRL,
89ce24991eSSachin Kamat 	S2MPA01_REG_L14CTRL,
90ce24991eSSachin Kamat 	S2MPA01_REG_L15CTRL,
91ce24991eSSachin Kamat 	S2MPA01_REG_L16CTRL,
92ce24991eSSachin Kamat 	S2MPA01_REG_L17CTRL,
93ce24991eSSachin Kamat 	S2MPA01_REG_L18CTRL,
94ce24991eSSachin Kamat 	S2MPA01_REG_L19CTRL,
95ce24991eSSachin Kamat 	S2MPA01_REG_L20CTRL,
96ce24991eSSachin Kamat 	S2MPA01_REG_L21CTRL,
97ce24991eSSachin Kamat 	S2MPA01_REG_L22CTRL,
98ce24991eSSachin Kamat 	S2MPA01_REG_L23CTRL,
99ce24991eSSachin Kamat 	S2MPA01_REG_L24CTRL,
100ce24991eSSachin Kamat 	S2MPA01_REG_L25CTRL,
101ce24991eSSachin Kamat 	S2MPA01_REG_L26CTRL,
102ce24991eSSachin Kamat 
103ce24991eSSachin Kamat 	S2MPA01_REG_LDO_OVCB1,
104ce24991eSSachin Kamat 	S2MPA01_REG_LDO_OVCB2,
105ce24991eSSachin Kamat 	S2MPA01_REG_LDO_OVCB3,
106ce24991eSSachin Kamat 	S2MPA01_REG_LDO_OVCB4,
107ce24991eSSachin Kamat 
108ce24991eSSachin Kamat };
109ce24991eSSachin Kamat 
110ce24991eSSachin Kamat /* S2MPA01 regulator ids */
111ce24991eSSachin Kamat enum s2mpa01_regulators {
112ce24991eSSachin Kamat 	S2MPA01_LDO1,
113ce24991eSSachin Kamat 	S2MPA01_LDO2,
114ce24991eSSachin Kamat 	S2MPA01_LDO3,
115ce24991eSSachin Kamat 	S2MPA01_LDO4,
116ce24991eSSachin Kamat 	S2MPA01_LDO5,
117ce24991eSSachin Kamat 	S2MPA01_LDO6,
118ce24991eSSachin Kamat 	S2MPA01_LDO7,
119ce24991eSSachin Kamat 	S2MPA01_LDO8,
120ce24991eSSachin Kamat 	S2MPA01_LDO9,
121ce24991eSSachin Kamat 	S2MPA01_LDO10,
122ce24991eSSachin Kamat 	S2MPA01_LDO11,
123ce24991eSSachin Kamat 	S2MPA01_LDO12,
124ce24991eSSachin Kamat 	S2MPA01_LDO13,
125ce24991eSSachin Kamat 	S2MPA01_LDO14,
126ce24991eSSachin Kamat 	S2MPA01_LDO15,
127ce24991eSSachin Kamat 	S2MPA01_LDO16,
128ce24991eSSachin Kamat 	S2MPA01_LDO17,
129ce24991eSSachin Kamat 	S2MPA01_LDO18,
130ce24991eSSachin Kamat 	S2MPA01_LDO19,
131ce24991eSSachin Kamat 	S2MPA01_LDO20,
132ce24991eSSachin Kamat 	S2MPA01_LDO21,
133ce24991eSSachin Kamat 	S2MPA01_LDO22,
134ce24991eSSachin Kamat 	S2MPA01_LDO23,
135ce24991eSSachin Kamat 	S2MPA01_LDO24,
136ce24991eSSachin Kamat 	S2MPA01_LDO25,
137ce24991eSSachin Kamat 	S2MPA01_LDO26,
138ce24991eSSachin Kamat 
139ce24991eSSachin Kamat 	S2MPA01_BUCK1,
140ce24991eSSachin Kamat 	S2MPA01_BUCK2,
141ce24991eSSachin Kamat 	S2MPA01_BUCK3,
142ce24991eSSachin Kamat 	S2MPA01_BUCK4,
143ce24991eSSachin Kamat 	S2MPA01_BUCK5,
144ce24991eSSachin Kamat 	S2MPA01_BUCK6,
145ce24991eSSachin Kamat 	S2MPA01_BUCK7,
146ce24991eSSachin Kamat 	S2MPA01_BUCK8,
147ce24991eSSachin Kamat 	S2MPA01_BUCK9,
148ce24991eSSachin Kamat 	S2MPA01_BUCK10,
149ce24991eSSachin Kamat 
150ce24991eSSachin Kamat 	S2MPA01_REGULATOR_MAX,
151ce24991eSSachin Kamat };
152ce24991eSSachin Kamat 
153ce24991eSSachin Kamat #define S2MPA01_LDO_VSEL_MASK	0x3F
154ce24991eSSachin Kamat #define S2MPA01_BUCK_VSEL_MASK	0xFF
155ce24991eSSachin Kamat #define S2MPA01_ENABLE_MASK	(0x03 << S2MPA01_ENABLE_SHIFT)
156ce24991eSSachin Kamat #define S2MPA01_ENABLE_SHIFT	0x06
157ce24991eSSachin Kamat #define S2MPA01_LDO_N_VOLTAGES	(S2MPA01_LDO_VSEL_MASK + 1)
158ce24991eSSachin Kamat #define S2MPA01_BUCK_N_VOLTAGES (S2MPA01_BUCK_VSEL_MASK + 1)
159ce24991eSSachin Kamat 
160ce24991eSSachin Kamat #define S2MPA01_RAMP_DELAY	12500	/* uV/us */
161ce24991eSSachin Kamat 
162ce24991eSSachin Kamat #define S2MPA01_BUCK16_RAMP_SHIFT	4
163ce24991eSSachin Kamat #define S2MPA01_BUCK24_RAMP_SHIFT	6
164ce24991eSSachin Kamat #define S2MPA01_BUCK3_RAMP_SHIFT	4
165ce24991eSSachin Kamat #define S2MPA01_BUCK5_RAMP_SHIFT	6
166ce24991eSSachin Kamat #define S2MPA01_BUCK7_RAMP_SHIFT	2
167ce24991eSSachin Kamat #define S2MPA01_BUCK8910_RAMP_SHIFT	0
168ce24991eSSachin Kamat 
169ce24991eSSachin Kamat #define S2MPA01_BUCK1_RAMP_EN_SHIFT	3
170ce24991eSSachin Kamat #define S2MPA01_BUCK2_RAMP_EN_SHIFT	2
171ce24991eSSachin Kamat #define S2MPA01_BUCK3_RAMP_EN_SHIFT	1
172ce24991eSSachin Kamat #define S2MPA01_BUCK4_RAMP_EN_SHIFT	0
173ce24991eSSachin Kamat #define S2MPA01_PMIC_EN_SHIFT	6
174ce24991eSSachin Kamat 
175ce24991eSSachin Kamat #endif /*__LINUX_MFD_S2MPA01_H */
176