Commit | Line | Data |
---|---|---|
dae8a969 JL |
1 | /* |
2 | * max77686.h - Driver for the Maxim 77686 | |
3 | * | |
4 | * Copyright (C) 2012 Samsung Electrnoics | |
5 | * Chiwoong Byun <woong.byun@samsung.com> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | * | |
21 | * This driver is based on max8997.h | |
22 | * | |
23 | * MAX77686 has PMIC, RTC devices. | |
24 | * The devices share the same I2C bus and included in | |
25 | * this mfd driver. | |
26 | */ | |
27 | ||
28 | #ifndef __LINUX_MFD_MAX77686_H | |
29 | #define __LINUX_MFD_MAX77686_H | |
30 | ||
31 | #include <linux/regulator/consumer.h> | |
32 | ||
33 | /* MAX77686 regulator IDs */ | |
34 | enum max77686_regulators { | |
35 | MAX77686_LDO1 = 0, | |
36 | MAX77686_LDO2, | |
37 | MAX77686_LDO3, | |
38 | MAX77686_LDO4, | |
39 | MAX77686_LDO5, | |
40 | MAX77686_LDO6, | |
41 | MAX77686_LDO7, | |
42 | MAX77686_LDO8, | |
43 | MAX77686_LDO9, | |
44 | MAX77686_LDO10, | |
45 | MAX77686_LDO11, | |
46 | MAX77686_LDO12, | |
47 | MAX77686_LDO13, | |
48 | MAX77686_LDO14, | |
49 | MAX77686_LDO15, | |
50 | MAX77686_LDO16, | |
51 | MAX77686_LDO17, | |
52 | MAX77686_LDO18, | |
53 | MAX77686_LDO19, | |
54 | MAX77686_LDO20, | |
55 | MAX77686_LDO21, | |
56 | MAX77686_LDO22, | |
57 | MAX77686_LDO23, | |
58 | MAX77686_LDO24, | |
59 | MAX77686_LDO25, | |
60 | MAX77686_LDO26, | |
61 | MAX77686_BUCK1, | |
62 | MAX77686_BUCK2, | |
63 | MAX77686_BUCK3, | |
64 | MAX77686_BUCK4, | |
65 | MAX77686_BUCK5, | |
66 | MAX77686_BUCK6, | |
67 | MAX77686_BUCK7, | |
68 | MAX77686_BUCK8, | |
69 | MAX77686_BUCK9, | |
dae8a969 JL |
70 | |
71 | MAX77686_REG_MAX, | |
72 | }; | |
73 | ||
74 | struct max77686_regulator_data { | |
75 | int id; | |
76 | struct regulator_init_data *initdata; | |
2c58e266 | 77 | struct device_node *of_node; |
dae8a969 JL |
78 | }; |
79 | ||
80 | enum max77686_opmode { | |
81 | MAX77686_OPMODE_NORMAL, | |
82 | MAX77686_OPMODE_LP, | |
83 | MAX77686_OPMODE_STANDBY, | |
84 | }; | |
85 | ||
86 | struct max77686_opmode_data { | |
87 | int id; | |
88 | int mode; | |
89 | }; | |
90 | ||
91 | struct max77686_platform_data { | |
92 | /* IRQ */ | |
93 | int irq_gpio; | |
94 | int ono; | |
95 | int wakeup; | |
96 | ||
97 | /* ---- PMIC ---- */ | |
98 | struct max77686_regulator_data *regulators; | |
99 | int num_regulators; | |
100 | ||
101 | struct max77686_opmode_data *opmode_data; | |
102 | ||
103 | /* | |
104 | * GPIO-DVS feature is not enabled with the current version of | |
105 | * MAX77686 driver. Buck2/3/4_voltages[0] is used as the default | |
106 | * voltage at probe. DVS/SELB gpios are set as OUTPUT-LOW. | |
107 | */ | |
108 | int buck234_gpio_dvs[3]; /* GPIO of [0]DVS1, [1]DVS2, [2]DVS3 */ | |
109 | int buck234_gpio_selb[3]; /* [0]SELB2, [1]SELB3, [2]SELB4 */ | |
110 | unsigned int buck2_voltage[8]; /* buckx_voltage in uV */ | |
111 | unsigned int buck3_voltage[8]; | |
112 | unsigned int buck4_voltage[8]; | |
113 | }; | |
114 | ||
115 | #endif /* __LINUX_MFD_MAX77686_H */ |