Revert "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_ID_VIO,
33         TPS80031_ID_SMPS1,
34         TPS80031_ID_SMPS2,
35         TPS80031_ID_SMPS3,
36         TPS80031_ID_SMPS4,
37         TPS80031_ID_VANA,
38         TPS80031_ID_LDO1,
39         TPS80031_ID_LDO2,
40         TPS80031_ID_LDO3,
41         TPS80031_ID_LDO4,
42         TPS80031_ID_LDO5,
43         TPS80031_ID_LDO6,
44         TPS80031_ID_LDO7,
45         TPS80031_ID_LDOLN,
46         TPS80031_ID_LDOUSB,
47         TPS80031_ID_VBUS,
48         TPS80031_ID_CHARGER,
49 };
50
51
52 enum {
53         /* USBLDO input selection */
54         USBLDO_INPUT_VSYS       = 0x00000001,
55         USBLDO_INPUT_PMID       = 0x00000002,
56
57         /* LDO3 output mode */
58         LDO3_OUTPUT_VIB         = 0x00000004,
59
60         /* VBUS configuration */
61         VBUS_DISCHRG_EN_PDN     = 0x00000004,
62         VBUS_SW_ONLY            = 0x00000008,
63         VBUS_SW_N_ID            = 0x00000010,
64 };
65
66 /*
67  * struct tps80031_regulator_platform_data - tps80031 regulator platform data.
68  *
69  * @regulator: The regulator init data.
70  * @init_uV: initial micro volts which need to be set.
71  * @init_enable: Enable or do not enable the rails during initialization.
72  * @init_apply: Init parameter applied or not.
73  * @ext_ctrl_flag: External control flag for sleep/power request control.
74  * @flags: Configuration flag to configure the rails. It should be ORed of
75  *       above enums.
76  * @delay_us: Delay in microsecond after setting the desired voltage.
77  * @tolerance_uv: Tolerance micorvolts in minimum side. The voltage min
78  *      will be adjusted to this tolerance like
79  *              actual_vmin = vmin - tolerance_uv
80  */
81
82 struct tps80031_regulator_platform_data {
83         struct regulator_init_data regulator;
84         int init_uV;
85         unsigned init_enable:1;
86         unsigned init_apply:1;
87         unsigned int ext_ctrl_flag;
88         unsigned int flags;
89         int delay_us;
90         unsigned int tolerance_uv;
91 };
92
93 #endif  /* __REGULATOR_TPS80031_H */