Commit | Line | Data |
---|---|---|
156f2528 | 1 | /* |
2c7e6f57 | 2 | * max8998.h - Voltage regulator driver for the Maxim 8998 |
156f2528 KP |
3 | * |
4 | * Copyright (C) 2009-2010 Samsung Electrnoics | |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | |
6 | * Marek Szyprowski <m.szyprowski@samsung.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 as published by | |
10 | * the Free Software Foundation; either version 2 of the License, or | |
11 | * (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | * GNU General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | */ | |
22 | ||
23 | #ifndef __LINUX_MFD_MAX8998_H | |
24 | #define __LINUX_MFD_MAX8998_H | |
25 | ||
26 | #include <linux/regulator/machine.h> | |
27 | ||
28 | /* MAX 8998 regulator ids */ | |
29 | enum { | |
30 | MAX8998_LDO2 = 2, | |
31 | MAX8998_LDO3, | |
32 | MAX8998_LDO4, | |
33 | MAX8998_LDO5, | |
34 | MAX8998_LDO6, | |
35 | MAX8998_LDO7, | |
36 | MAX8998_LDO8, | |
37 | MAX8998_LDO9, | |
38 | MAX8998_LDO10, | |
39 | MAX8998_LDO11, | |
40 | MAX8998_LDO12, | |
41 | MAX8998_LDO13, | |
42 | MAX8998_LDO14, | |
43 | MAX8998_LDO15, | |
44 | MAX8998_LDO16, | |
45 | MAX8998_LDO17, | |
46 | MAX8998_BUCK1, | |
47 | MAX8998_BUCK2, | |
48 | MAX8998_BUCK3, | |
49 | MAX8998_BUCK4, | |
50 | MAX8998_EN32KHZ_AP, | |
51 | MAX8998_EN32KHZ_CP, | |
52 | MAX8998_ENVICHG, | |
53 | MAX8998_ESAFEOUT1, | |
54 | MAX8998_ESAFEOUT2, | |
55 | }; | |
56 | ||
57 | /** | |
58 | * max8998_regulator_data - regulator data | |
59 | * @id: regulator id | |
60 | * @initdata: regulator init data (contraints, supplies, ...) | |
61 | */ | |
62 | struct max8998_regulator_data { | |
63 | int id; | |
64 | struct regulator_init_data *initdata; | |
65 | }; | |
66 | ||
67 | /** | |
68 | * struct max8998_board - packages regulator init data | |
156f2528 | 69 | * @regulators: array of defined regulators |
2c7e6f57 JS |
70 | * @num_regulators: number of regultors used |
71 | * @irq_base: base IRQ number for max8998, required for IRQs | |
72 | * @ono: power onoff IRQ number for max8998 | |
735a3d9e MH |
73 | * @buck_voltage_lock: Do NOT change the values of the following six |
74 | * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot | |
75 | * be other than the preset values. | |
76 | * @buck1_voltage1: BUCK1 DVS mode 1 voltage register | |
77 | * @buck1_voltage2: BUCK1 DVS mode 2 voltage register | |
78 | * @buck1_voltage3: BUCK1 DVS mode 3 voltage register | |
79 | * @buck1_voltage4: BUCK1 DVS mode 4 voltage register | |
80 | * @buck2_voltage1: BUCK2 DVS mode 1 voltage register | |
81 | * @buck2_voltage2: BUCK2 DVS mode 2 voltage register | |
58aa6334 LM |
82 | * @buck1_set1: BUCK1 gpio pin 1 to set output voltage |
83 | * @buck1_set2: BUCK1 gpio pin 2 to set output voltage | |
735a3d9e | 84 | * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 |
58aa6334 | 85 | * @buck2_set3: BUCK2 gpio pin to set output voltage |
735a3d9e | 86 | * @buck2_default_idx: Default for BUCK2 gpio pin. |
337ce5d1 MH |
87 | * @wakeup: Allow to wake up from suspend |
88 | * @rtc_delay: LP3974 RTC chip bug that requires delay after a register | |
89 | * write before reading it. | |
156f2528 | 90 | */ |
156f2528 | 91 | struct max8998_platform_data { |
156f2528 | 92 | struct max8998_regulator_data *regulators; |
2c7e6f57 JS |
93 | int num_regulators; |
94 | int irq_base; | |
95 | int ono; | |
735a3d9e MH |
96 | bool buck_voltage_lock; |
97 | int buck1_voltage1; | |
98 | int buck1_voltage2; | |
99 | int buck1_voltage3; | |
100 | int buck1_voltage4; | |
101 | int buck2_voltage1; | |
102 | int buck2_voltage2; | |
58aa6334 LM |
103 | int buck1_set1; |
104 | int buck1_set2; | |
735a3d9e | 105 | int buck1_default_idx; |
58aa6334 | 106 | int buck2_set3; |
735a3d9e | 107 | int buck2_default_idx; |
cdd137c9 | 108 | bool wakeup; |
337ce5d1 | 109 | bool rtc_delay; |
156f2528 KP |
110 | }; |
111 | ||
112 | #endif /* __LINUX_MFD_MAX8998_H */ |