aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2010-08-20 01:43:56 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-10-28 17:40:31 -0400
commit202f4f53e503ae09b431459131b5b3a99fa6d839 (patch)
tree71f4597427f8bc9011aca93f873bd01154f2d25d /include/linux/regulator
parent2d3b07c07b39c4b7d9b6641052a02d996cd5d87c (diff)
MAX8952 PMIC Driver Initial Release
MAX8952 PMIC is used to provide voltage output between 770mV - 1400mV with DVS support. In this initial release, users can set voltages for four DVS modes, RAMP delay values, and SYNC frequency. Controlling FPWM/SYNC_MODE/Pull-Down/Ramp Modes and reading CHIP_ID is not supported in this release. If GPIO of EN is not valid in platform data, the driver assumes that it is always-on. If GPIO of VID0 or VID1 is invalid, the driver pulls down VID0 and VID1 to fix DVS mode as 0 and disables DVS support. We assume that V_OUT is capable to provide every voltage from 770mV to 1.40V in 10mV steps although the data sheet has some ambiguity on it. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> -- v2: - Style correction - Can accept platform_data with invalid GPIOs - Removed unnecessary features - Improved error handling Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/max8952.h135
1 files changed, 135 insertions, 0 deletions
diff --git a/include/linux/regulator/max8952.h b/include/linux/regulator/max8952.h
new file mode 100644
index 000000000000..45e42855ad05
--- /dev/null
+++ b/include/linux/regulator/max8952.h
@@ -0,0 +1,135 @@
1/*
2 * max8952.h - Voltage regulation for the Maxim 8952
3 *
4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#ifndef REGULATOR_MAX8952
23#define REGULATOR_MAX8952
24
25#include <linux/regulator/machine.h>
26
27enum {
28 MAX8952_DVS_MODE0,
29 MAX8952_DVS_MODE1,
30 MAX8952_DVS_MODE2,
31 MAX8952_DVS_MODE3,
32};
33
34enum {
35 MAX8952_DVS_770mV = 0,
36 MAX8952_DVS_780mV,
37 MAX8952_DVS_790mV,
38 MAX8952_DVS_800mV,
39 MAX8952_DVS_810mV,
40 MAX8952_DVS_820mV,
41 MAX8952_DVS_830mV,
42 MAX8952_DVS_840mV,
43 MAX8952_DVS_850mV,
44 MAX8952_DVS_860mV,
45 MAX8952_DVS_870mV,
46 MAX8952_DVS_880mV,
47 MAX8952_DVS_890mV,
48 MAX8952_DVS_900mV,
49 MAX8952_DVS_910mV,
50 MAX8952_DVS_920mV,
51 MAX8952_DVS_930mV,
52 MAX8952_DVS_940mV,
53 MAX8952_DVS_950mV,
54 MAX8952_DVS_960mV,
55 MAX8952_DVS_970mV,
56 MAX8952_DVS_980mV,
57 MAX8952_DVS_990mV,
58 MAX8952_DVS_1000mV,
59 MAX8952_DVS_1010mV,
60 MAX8952_DVS_1020mV,
61 MAX8952_DVS_1030mV,
62 MAX8952_DVS_1040mV,
63 MAX8952_DVS_1050mV,
64 MAX8952_DVS_1060mV,
65 MAX8952_DVS_1070mV,
66 MAX8952_DVS_1080mV,
67 MAX8952_DVS_1090mV,
68 MAX8952_DVS_1100mV,
69 MAX8952_DVS_1110mV,
70 MAX8952_DVS_1120mV,
71 MAX8952_DVS_1130mV,
72 MAX8952_DVS_1140mV,
73 MAX8952_DVS_1150mV,
74 MAX8952_DVS_1160mV,
75 MAX8952_DVS_1170mV,
76 MAX8952_DVS_1180mV,
77 MAX8952_DVS_1190mV,
78 MAX8952_DVS_1200mV,
79 MAX8952_DVS_1210mV,
80 MAX8952_DVS_1220mV,
81 MAX8952_DVS_1230mV,
82 MAX8952_DVS_1240mV,
83 MAX8952_DVS_1250mV,
84 MAX8952_DVS_1260mV,
85 MAX8952_DVS_1270mV,
86 MAX8952_DVS_1280mV,
87 MAX8952_DVS_1290mV,
88 MAX8952_DVS_1300mV,
89 MAX8952_DVS_1310mV,
90 MAX8952_DVS_1320mV,
91 MAX8952_DVS_1330mV,
92 MAX8952_DVS_1340mV,
93 MAX8952_DVS_1350mV,
94 MAX8952_DVS_1360mV,
95 MAX8952_DVS_1370mV,
96 MAX8952_DVS_1380mV,
97 MAX8952_DVS_1390mV,
98 MAX8952_DVS_1400mV,
99};
100
101enum {
102 MAX8952_SYNC_FREQ_26MHZ, /* Default */
103 MAX8952_SYNC_FREQ_13MHZ,
104 MAX8952_SYNC_FREQ_19_2MHZ,
105};
106
107enum {
108 MAX8952_RAMP_32mV_us = 0, /* Default */
109 MAX8952_RAMP_16mV_us,
110 MAX8952_RAMP_8mV_us,
111 MAX8952_RAMP_4mV_us,
112 MAX8952_RAMP_2mV_us,
113 MAX8952_RAMP_1mV_us,
114 MAX8952_RAMP_0_5mV_us,
115 MAX8952_RAMP_0_25mV_us,
116};
117
118#define MAX8952_NUM_DVS_MODE 4
119
120struct max8952_platform_data {
121 int gpio_vid0;
122 int gpio_vid1;
123 int gpio_en;
124
125 u8 default_mode;
126 u8 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
127
128 u8 sync_freq;
129 u8 ramp_speed;
130
131 struct regulator_init_data reg_data;
132};
133
134
135#endif /* REGULATOR_MAX8952 */