fe4e0a553104e14a42cf042be32aef469788c2b0
[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 };
49
50
51 enum {
52         /* USBLDO input selection */
53         USBLDO_INPUT_VSYS       = 0x00000001,
54         USBLDO_INPUT_PMID       = 0x00000002,
55
56         /* LDO3 output mode */
57         LDO3_OUTPUT_VIB         = 0x00000004,
58
59         /* VBUS configuration */
60         VBUS_SW_ONLY            = 0x00000008,
61         VBUS_SW_N_ID            = 0x00000010,
62
63         /* Power requests */
64         PWR_REQ_INPUT_PREQ1     = 0x00000020,
65         PWR_REQ_INPUT_PREQ2     = 0x00000040,
66         PWR_REQ_INPUT_PREQ3     = 0x00000080,
67 };
68
69 /*
70  * struct tps80031_regulator_platform_data - tps80031 regulator platform data.
71  *
72  * @regulator: The regulator init data.
73  * @init_uV: initial micro volts which need to be set.
74  * @init_enable: Enable or do not enable the rails during initialization.
75  * @init_apply: Init parameter applied or not.
76  * @flags: Configuration flag to configure the rails. It should be ORed of
77  *       above enums.
78  */
79
80 struct tps80031_regulator_platform_data {
81         struct regulator_init_data regulator;
82         int init_uV;
83         unsigned init_enable:1;
84         unsigned init_apply:1;
85         unsigned int flags;
86 };
87
88 #endif  /* __REGULATOR_TPS80031_H */