upload tizen1.0 source
[kernel/linux-2.6.36.git] / include / linux / mfd / max8998.h
1 /*
2  * max8998.h - Voltage regulator driver for the Maxim 8998
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 not provided / owned by Maxim Integrated Products.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24
25 #ifndef __LINUX_MFD_MAX8998_H
26 #define __LINUX_MFD_MAX8998_H
27
28 #include <linux/regulator/machine.h>
29
30 /* MAX 8998 regulator ids */
31 enum {
32         MAX8998_LDO2 = 2,
33         MAX8998_LDO3,
34         MAX8998_LDO4,
35         MAX8998_LDO5,
36         MAX8998_LDO6,
37         MAX8998_LDO7,
38         MAX8998_LDO8,
39         MAX8998_LDO9,
40         MAX8998_LDO10,
41         MAX8998_LDO11,
42         MAX8998_LDO12,
43         MAX8998_LDO13,
44         MAX8998_LDO14,
45         MAX8998_LDO15,
46         MAX8998_LDO16,
47         MAX8998_LDO17,
48         MAX8998_BUCK1,
49         MAX8998_BUCK2,
50         MAX8998_BUCK3,
51         MAX8998_BUCK4,
52         MAX8998_EN32KHZ_AP,
53         MAX8998_EN32KHZ_CP,
54         MAX8998_ENVICHG,
55         MAX8998_ESAFEOUT1,
56         MAX8998_ESAFEOUT2,
57         /*
58          * CHARGER: Controls ON/OFF, current limit of the charger.
59          * However, note that even if CHARGER is ON, CHARGER_ONLINE
60          * can be in "disabled" state by MAX8998 internal control.
61         **/
62         MAX8998_CHARGER,
63 };
64
65 /**
66  * max8998_regulator_data - regulator data
67  * @id: regulator id
68  * @initdata: regulator init data (contraints, supplies, ...)
69  */
70 struct max8998_regulator_data {
71         int                             id;
72         struct regulator_init_data      *initdata;
73 };
74
75 /**
76  * struct max8998_board - packages regulator init data
77  * @regulators: array of defined regulators
78  * @num_regulators: number of regultors used
79  * @irq_base: base IRQ number for max8998, required for IRQs
80  * @ono: power onoff IRQ number for max8998
81  * @buck_voltage_lock: Do NOT change the values of the following six
82  *   registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
83  *   be other than the preset values.
84  * @buck1_voltage1: BUCK1 DVS mode 1 voltage register
85  * @buck1_voltage2: BUCK1 DVS mode 2 voltage register
86  * @buck1_voltage3: BUCK1 DVS mode 3 voltage register
87  * @buck1_voltage4: BUCK1 DVS mode 4 voltage register
88  * @buck2_voltage1: BUCK2 DVS mode 1 voltage register
89  * @buck2_voltage2: BUCK2 DVS mode 2 voltage register
90  * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
91  * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
92  * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2
93  * @buck2_set3: BUCK2 gpio pin to set output voltage
94  * @buck2_default_idx: Default for BUCK2 gpio pin.
95  * @eoc: End of Charge Level: 10 ~ 45% or if it's over 45, in mA.
96  *   If it's under 10, leave it unchanged.
97  * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
98  *   Otherwise, leave it unchanged.
99  * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
100  *  Otherwise, leave it unchanged.
101  */
102 struct max8998_platform_data {
103         struct max8998_regulator_data   *regulators;
104         int                             num_regulators;
105         int                             irq_base;
106         int                             ono;
107         bool                            buck_voltage_lock;
108         int                             buck1_voltage1;
109         int                             buck1_voltage2;
110         int                             buck1_voltage3;
111         int                             buck1_voltage4;
112         int                             buck2_voltage1;
113         int                             buck2_voltage2;
114         int                             buck1_set1;
115         int                             buck1_set2;
116         int                             buck1_default_idx;
117         int                             buck2_set3;
118         int                             buck2_default_idx;
119         bool                            wakeup;
120         int                             eoc;
121         int                             restart;
122         int                             timeout;
123 };
124
125 #endif /*  __LINUX_MFD_MAX8998_H */