Merge commit 'main-jb-2012.08.03-B4' into t114-0806
[linux-2.6.git] / include / linux / regulator / tps80031-regulator.h
1 /*
2  * include/linux/regulator/tps80031-regulator.h
3  *
4  * Interface for regulator driver for TI TPS80031
5  *
6  * Copyright (C) 2011 NVIDIA Corporation
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, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
16  * more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  *
22  */
23
24 #ifndef __REGULATOR_TPS80031_H
25 #define __REGULATOR_TPS80031_H
26
27 #include <linux/regulator/machine.h>
28
29 #define tps80031_rails(_name) "tps80031_"#_name
30
31 enum {
32         TPS80031_REGULATOR_VIO,
33         TPS80031_REGULATOR_SMPS1,
34         TPS80031_REGULATOR_SMPS2,
35         TPS80031_REGULATOR_SMPS3,
36         TPS80031_REGULATOR_SMPS4,
37         TPS80031_REGULATOR_VANA,
38         TPS80031_REGULATOR_LDO1,
39         TPS80031_REGULATOR_LDO2,
40         TPS80031_REGULATOR_LDO3,
41         TPS80031_REGULATOR_LDO4,
42         TPS80031_REGULATOR_LDO5,
43         TPS80031_REGULATOR_LDO6,
44         TPS80031_REGULATOR_LDO7,
45         TPS80031_REGULATOR_LDOLN,
46         TPS80031_REGULATOR_LDOUSB,
47         TPS80031_REGULATOR_VBUS,
48         TPS80031_REGULATOR_REGEN1,
49         TPS80031_REGULATOR_REGEN2,
50         TPS80031_REGULATOR_SYSEN,
51         TPS80031_REGULATOR_CHARGER,
52 };
53
54
55 enum {
56         /* USBLDO input selection */
57         USBLDO_INPUT_VSYS       = 0x00000001,
58         USBLDO_INPUT_PMID       = 0x00000002,
59
60         /* LDO3 output mode */
61         LDO3_OUTPUT_VIB         = 0x00000004,
62
63         /* VBUS configuration */
64         VBUS_DISCHRG_EN_PDN     = 0x00000004,
65         VBUS_SW_ONLY            = 0x00000008,
66         VBUS_SW_N_ID            = 0x00000010,
67 };
68
69 /*
70  * struct tps80031_regulator_platform_data - tps80031 regulator platform data.
71  *
72  * @regulator_id" Regulator ID.
73  * @reg_init_data: The regulator init data.
74  * @init_uV: initial micro volts which need to be set.
75  * @init_enable: Enable or do not enable the rails during initialization.
76  * @init_apply: Init parameter applied or not.
77  * @ext_ctrl_flag: External control flag for sleep/power request control.
78  * @flags: Configuration flag to configure the rails. It should be ORed of
79  *       above enums.
80  * @delay_us: Delay in microsecond after setting the desired voltage.
81  * @tolerance_uv: Tolerance micorvolts in minimum side. The voltage min
82  *      will be adjusted to this tolerance like
83  *              actual_vmin = vmin - tolerance_uv
84  */
85
86 struct tps80031_regulator_platform_data {
87         int regulator_id;
88         struct regulator_init_data *reg_init_data;
89         int init_uV;
90         unsigned init_enable:1;
91         unsigned init_apply:1;
92         unsigned int ext_ctrl_flag;
93         unsigned int flags;
94         int delay_us;
95         unsigned int tolerance_uv;
96 };
97
98 #endif  /* __REGULATOR_TPS80031_H */