1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2b59320ccSDaniel Jeong /*
3b59320ccSDaniel Jeong  * LP8755 High Performance Power Management Unit Driver:System Interface Driver
4b59320ccSDaniel Jeong  *
5b59320ccSDaniel Jeong  *			Copyright (C) 2012 Texas Instruments
6b59320ccSDaniel Jeong  *
7b59320ccSDaniel Jeong  * Author: Daniel(Geon Si) Jeong <[email protected]>
8b59320ccSDaniel Jeong  *             G.Shark Jeong <[email protected]>
9b59320ccSDaniel Jeong  */
10b59320ccSDaniel Jeong 
11b59320ccSDaniel Jeong #ifndef _LP8755_H
12b59320ccSDaniel Jeong #define _LP8755_H
13b59320ccSDaniel Jeong 
14b59320ccSDaniel Jeong #include <linux/regulator/consumer.h>
15b59320ccSDaniel Jeong 
16b59320ccSDaniel Jeong #define LP8755_NAME "lp8755-regulator"
17b59320ccSDaniel Jeong /*
18b59320ccSDaniel Jeong  *PWR FAULT : power fault detected
19b59320ccSDaniel Jeong  *OCP : over current protect activated
20b59320ccSDaniel Jeong  *OVP : over voltage protect activated
21b59320ccSDaniel Jeong  *TEMP_WARN : thermal warning
22b59320ccSDaniel Jeong  *TEMP_SHDN : thermal shutdonw detected
23b59320ccSDaniel Jeong  *I_LOAD : current measured
24b59320ccSDaniel Jeong  */
25b59320ccSDaniel Jeong #define LP8755_EVENT_PWR_FAULT REGULATOR_EVENT_FAIL
26b59320ccSDaniel Jeong #define LP8755_EVENT_OCP REGULATOR_EVENT_OVER_CURRENT
27b59320ccSDaniel Jeong #define LP8755_EVENT_OVP 0x10000
28b59320ccSDaniel Jeong #define LP8755_EVENT_TEMP_WARN 0x2000
29b59320ccSDaniel Jeong #define LP8755_EVENT_TEMP_SHDN REGULATOR_EVENT_OVER_TEMP
30b59320ccSDaniel Jeong #define LP8755_EVENT_I_LOAD	0x40000
31b59320ccSDaniel Jeong 
32b59320ccSDaniel Jeong enum lp8755_bucks {
33b59320ccSDaniel Jeong 	LP8755_BUCK0 = 0,
34b59320ccSDaniel Jeong 	LP8755_BUCK1,
35b59320ccSDaniel Jeong 	LP8755_BUCK2,
36b59320ccSDaniel Jeong 	LP8755_BUCK3,
37b59320ccSDaniel Jeong 	LP8755_BUCK4,
38b59320ccSDaniel Jeong 	LP8755_BUCK5,
39b59320ccSDaniel Jeong 	LP8755_BUCK_MAX,
40b59320ccSDaniel Jeong };
41b59320ccSDaniel Jeong 
42b59320ccSDaniel Jeong /**
43b59320ccSDaniel Jeong  * multiphase configuration options
44b59320ccSDaniel Jeong  */
45b59320ccSDaniel Jeong enum lp8755_mphase_config {
46b59320ccSDaniel Jeong 	MPHASE_CONF0,
47b59320ccSDaniel Jeong 	MPHASE_CONF1,
48b59320ccSDaniel Jeong 	MPHASE_CONF2,
49b59320ccSDaniel Jeong 	MPHASE_CONF3,
50b59320ccSDaniel Jeong 	MPHASE_CONF4,
51b59320ccSDaniel Jeong 	MPHASE_CONF5,
52b59320ccSDaniel Jeong 	MPHASE_CONF6,
53b59320ccSDaniel Jeong 	MPHASE_CONF7,
54b59320ccSDaniel Jeong 	MPHASE_CONF8,
55b59320ccSDaniel Jeong 	MPHASE_CONF_MAX
56b59320ccSDaniel Jeong };
57b59320ccSDaniel Jeong 
58b59320ccSDaniel Jeong /**
59b59320ccSDaniel Jeong  * struct lp8755_platform_data
60b59320ccSDaniel Jeong  * @mphase_type : Multiphase Switcher Configurations.
61b59320ccSDaniel Jeong  * @buck_data   : buck0~6 init voltage in uV
62b59320ccSDaniel Jeong  */
63b59320ccSDaniel Jeong struct lp8755_platform_data {
64b59320ccSDaniel Jeong 	int mphase;
65b59320ccSDaniel Jeong 	struct regulator_init_data *buck_data[LP8755_BUCK_MAX];
66b59320ccSDaniel Jeong };
67b59320ccSDaniel Jeong #endif
68