ARM: tegra: pluto: add supply for ALS sensor.
[linux-2.6.git] / arch / arm / mach-tegra / board-pluto-power.c
1 /*
2  * arch/arm/mach-tegra/board-pluto-power.c
3  *
4  * Copyright (C) 2012 NVIDIA Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #include <linux/i2c.h>
21 #include <linux/pda_power.h>
22 #include <linux/platform_device.h>
23 #include <linux/resource.h>
24 #include <linux/io.h>
25
26 #include <mach/iomap.h>
27 #include <mach/irqs.h>
28 #include <linux/regulator/fixed.h>
29 #include <linux/mfd/palmas.h>
30 #include <linux/regulator/machine.h>
31
32 #include <asm/mach-types.h>
33
34 #include "pm.h"
35 #include "board.h"
36 #include "board-pluto.h"
37
38 #define PMC_CTRL                0x0
39 #define PMC_CTRL_INTR_LOW       (1 << 17)
40
41 /************************ Pluto based regulator ****************/
42 static struct regulator_consumer_supply palmas_smps123_supply[] = {
43         REGULATOR_SUPPLY("vdd_cpu", NULL),
44 };
45
46 static struct regulator_consumer_supply palmas_smps45_supply[] = {
47         REGULATOR_SUPPLY("vdd_core", NULL),
48 };
49
50 static struct regulator_consumer_supply palmas_smps6_supply[] = {
51         REGULATOR_SUPPLY("vdd_core_bb", NULL),
52 };
53
54 static struct regulator_consumer_supply palmas_smps7_supply[] = {
55         REGULATOR_SUPPLY("vddio_ddr", NULL),
56         REGULATOR_SUPPLY("vddio_lpddr3", NULL),
57         REGULATOR_SUPPLY("vcore2_lpddr3", NULL),
58         REGULATOR_SUPPLY("vcore_audio_1v2", NULL),
59 };
60
61 static struct regulator_consumer_supply palmas_smps8_supply[] = {
62         REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.0"),
63         REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.1"),
64         REGULATOR_SUPPLY("avdd_osc", NULL),
65         REGULATOR_SUPPLY("vddio_sys", NULL),
66         REGULATOR_SUPPLY("vddio_bb", NULL),
67         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.0"),
68         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.3"),
69         REGULATOR_SUPPLY("vdd_emmc", "sdhci-tegra.3"),
70         REGULATOR_SUPPLY("vddio_audio", NULL),
71         REGULATOR_SUPPLY("vddio_uart", NULL),
72         REGULATOR_SUPPLY("vddio_gmi", NULL),
73         REGULATOR_SUPPLY("vddio_cam", "tegra_camera"),
74         REGULATOR_SUPPLY("vdd_gps", NULL),
75         REGULATOR_SUPPLY("vdd_nfc", NULL),
76         REGULATOR_SUPPLY("vdd_sensor", NULL),
77         REGULATOR_SUPPLY("vdd_dtv", NULL),
78         REGULATOR_SUPPLY("vdd_bb", NULL),
79         REGULATOR_SUPPLY("vcore1_lpddr", NULL),
80         REGULATOR_SUPPLY("vcore_lpddr", NULL),
81         REGULATOR_SUPPLY("vddio_lpddr", NULL),
82         REGULATOR_SUPPLY("vdd_rf", NULL),
83         REGULATOR_SUPPLY("vdd_modem2", NULL),
84         REGULATOR_SUPPLY("vdd_dbg", NULL),
85         REGULATOR_SUPPLY("vdd_sim_1v8", NULL),
86         REGULATOR_SUPPLY("vdd_sim1a_1v8", NULL),
87         REGULATOR_SUPPLY("vdd_sim1b_1v8", NULL),
88         REGULATOR_SUPPLY("dvdd_audio", NULL),
89         REGULATOR_SUPPLY("avdd_audio", NULL),
90         REGULATOR_SUPPLY("vdd_mic", NULL),
91         REGULATOR_SUPPLY("vdd_com_1v8", NULL),
92         REGULATOR_SUPPLY("vdd_ts_1v8", NULL),
93         REGULATOR_SUPPLY("avdd_pll_bb", NULL),
94 };
95
96 static struct regulator_consumer_supply palmas_smps9_supply[] = {
97         REGULATOR_SUPPLY("vcore_emmc", NULL),
98         REGULATOR_SUPPLY("vdd_sim_mmc", NULL),
99         REGULATOR_SUPPLY("vdd_sim1a_mmc", NULL),
100         REGULATOR_SUPPLY("vdd_sim1b_mmc", NULL),
101 };
102
103 static struct regulator_consumer_supply palmas_smps10_supply[] = {
104         REGULATOR_SUPPLY("unused_smps10", NULL),
105         REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
106         REGULATOR_SUPPLY("vdd_vbrtr", NULL),
107         REGULATOR_SUPPLY("vdd_lcd", NULL),
108 };
109
110 static struct regulator_consumer_supply palmas_ldo1_supply[] = {
111         REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
112         REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.0"),
113         REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.1"),
114         REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegra_camera"),
115         REGULATOR_SUPPLY("avdd_pllm", NULL),
116         REGULATOR_SUPPLY("avdd_pllu", NULL),
117         REGULATOR_SUPPLY("avdd_plla_p_c", NULL),
118         REGULATOR_SUPPLY("avdd_pllx", NULL),
119         REGULATOR_SUPPLY("vdd_ddr_hs", NULL),
120         REGULATOR_SUPPLY("avdd_plle", NULL),
121 };
122
123 static struct regulator_consumer_supply palmas_ldo2_supply[] = {
124         REGULATOR_SUPPLY("avdd_lcd", NULL),
125 };
126
127 static struct regulator_consumer_supply palmas_ldo3_supply[] = {
128         REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.0"),
129         REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.1"),
130         REGULATOR_SUPPLY("avdd_dsi_csi", "tegra_camera"),
131         REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.0"),
132         REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.1"),
133         REGULATOR_SUPPLY("vddio_hsic_bb", NULL),
134         REGULATOR_SUPPLY("vddio_hsic_modem2", NULL),
135 };
136
137 static struct regulator_consumer_supply palmas_ldo4_supply[] = {
138         REGULATOR_SUPPLY("vdd_spare", NULL),
139 };
140
141 static struct regulator_consumer_supply palmas_ldo5_supply[] = {
142         REGULATOR_SUPPLY("avdd_cam1", NULL),
143 };
144
145 static struct regulator_consumer_supply palmas_ldo6_supply[] = {
146         REGULATOR_SUPPLY("vdd_temp", NULL),
147         REGULATOR_SUPPLY("vdd_mb", NULL),
148         REGULATOR_SUPPLY("avdd_ts_3v0", NULL),
149         REGULATOR_SUPPLY("vdd_nfc_3v0", NULL),
150         REGULATOR_SUPPLY("vdd_irled", NULL),
151         REGULATOR_SUPPLY("vdd_sensor_3v0", NULL),
152         REGULATOR_SUPPLY("vdd_3v0_pm", NULL),
153         REGULATOR_SUPPLY("vaux_3v3", NULL),
154         REGULATOR_SUPPLY("vdd", "0-0044"),
155 };
156
157 static struct regulator_consumer_supply palmas_ldo7_supply[] = {
158         REGULATOR_SUPPLY("vdd_af_cam1", NULL),
159 };
160 static struct regulator_consumer_supply palmas_ldo8_supply[] = {
161         REGULATOR_SUPPLY("vdd_rtc", NULL),
162 };
163 static struct regulator_consumer_supply palmas_ldo9_supply[] = {
164         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.2"),
165 };
166 static struct regulator_consumer_supply palmas_ldoln_supply[] = {
167         REGULATOR_SUPPLY("avdd_cam2", NULL),
168 };
169
170 static struct regulator_consumer_supply palmas_ldousb_supply[] = {
171         REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.0"),
172         REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.1"),
173         REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.2"),
174         REGULATOR_SUPPLY("hvdd_usb", "tegra-ehci.2"),
175         REGULATOR_SUPPLY("avdd_hdmi", "tegradc.1"),
176         REGULATOR_SUPPLY("vddio_hv", "tegradc.1"),
177         REGULATOR_SUPPLY("vdd_dtv_3v3", NULL),
178
179 };
180
181 #define PALMAS_PDATA_INIT(_name, _minmv, _maxmv, _supply_reg, _always_on, \
182         _boot_on, _apply_uv)                                            \
183         static struct regulator_init_data reg_idata_##_name = {         \
184                 .constraints = {                                        \
185                         .name = palmas_rails(_name),                    \
186                         .min_uV = (_minmv)*1000,                        \
187                         .max_uV = (_maxmv)*1000,                        \
188                         .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
189                                         REGULATOR_MODE_STANDBY),        \
190                         .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
191                                         REGULATOR_CHANGE_STATUS |       \
192                                         REGULATOR_CHANGE_VOLTAGE),      \
193                         .always_on = _always_on,                        \
194                         .boot_on = _boot_on,                            \
195                         .apply_uV = _apply_uv,                          \
196                 },                                                      \
197                 .num_consumer_supplies =                                \
198                         ARRAY_SIZE(palmas_##_name##_supply),            \
199                 .consumer_supplies = palmas_##_name##_supply,           \
200                 .supply_regulator = _supply_reg,                        \
201         }
202
203 PALMAS_PDATA_INIT(smps123, 900,  1300, NULL, 0, 0, 0);
204 PALMAS_PDATA_INIT(smps45, 900,  1400, NULL, 0, 0, 0);
205 PALMAS_PDATA_INIT(smps6, 1000,  3300, NULL, 0, 0, 0);
206 PALMAS_PDATA_INIT(smps7, 1200,  1200, NULL, 0, 0, 1);
207 PALMAS_PDATA_INIT(smps8, 1800,  1800, NULL, 0, 1, 1);
208 PALMAS_PDATA_INIT(smps9, 2800,  2800, NULL, 0, 0, 1);
209 PALMAS_PDATA_INIT(smps10, 5000,  5000, NULL, 0, 0, 0);
210 PALMAS_PDATA_INIT(ldo1, 1050,  1050, palmas_rails(smps7), 0, 0, 1);
211 PALMAS_PDATA_INIT(ldo2, 2800,  2800, NULL, 0, 0, 1);
212 PALMAS_PDATA_INIT(ldo3, 1200,  1200, palmas_rails(smps8), 0, 0, 1);
213 PALMAS_PDATA_INIT(ldo4, 900,  3300, NULL, 0, 0, 0);
214 PALMAS_PDATA_INIT(ldo5, 2700,  2700, NULL, 0, 0, 1);
215 PALMAS_PDATA_INIT(ldo6, 3000,  3000, NULL, 0, 0, 1);
216 PALMAS_PDATA_INIT(ldo7, 2800,  2800, NULL, 0, 0, 1);
217 PALMAS_PDATA_INIT(ldo8, 1150,  1150, NULL, 1, 1, 1);
218 PALMAS_PDATA_INIT(ldo9, 1800,  3300, palmas_rails(smps9), 0, 0, 1);
219 PALMAS_PDATA_INIT(ldoln, 2700, 2700, NULL, 0, 0, 1);
220 PALMAS_PDATA_INIT(ldousb, 3300,  3300, NULL, 0, 0, 1);
221
222 #define PALMAS_REG_PDATA(_sname) &reg_idata_##_sname
223
224 static struct regulator_init_data *pluto_reg_data[] = {
225         NULL,
226         PALMAS_REG_PDATA(smps123),
227         NULL,
228         PALMAS_REG_PDATA(smps45),
229         NULL,
230         PALMAS_REG_PDATA(smps6),
231         PALMAS_REG_PDATA(smps7),
232         PALMAS_REG_PDATA(smps8),
233         PALMAS_REG_PDATA(smps9),
234         PALMAS_REG_PDATA(smps10),
235         PALMAS_REG_PDATA(ldo1),
236         PALMAS_REG_PDATA(ldo2),
237         PALMAS_REG_PDATA(ldo3),
238         PALMAS_REG_PDATA(ldo4),
239         PALMAS_REG_PDATA(ldo5),
240         PALMAS_REG_PDATA(ldo6),
241         PALMAS_REG_PDATA(ldo7),
242         PALMAS_REG_PDATA(ldo8),
243         PALMAS_REG_PDATA(ldo9),
244         PALMAS_REG_PDATA(ldoln),
245         PALMAS_REG_PDATA(ldousb),
246 };
247
248 #define PALMAS_REG_INIT(_name, _warm_reset, _roof_floor, _mode_sleep,   \
249                 _tstep, _vsel)                                          \
250         static struct palmas_reg_init reg_init_data_##_name = {         \
251                 .warm_reset = _warm_reset,                              \
252                 .roof_floor =   _roof_floor,                            \
253                 .mode_sleep = _mode_sleep,              \
254                 .tstep = _tstep,                        \
255                 .vsel = _vsel,          \
256         }
257
258 PALMAS_REG_INIT(smps12, 0, 0, 0, 0, 0);
259 PALMAS_REG_INIT(smps123, 0, 0, 0, 0, 0);
260 PALMAS_REG_INIT(smps3, 0, 0, 0, 0, 0);
261 PALMAS_REG_INIT(smps45, 0, 0, 0, 0, 0);
262 PALMAS_REG_INIT(smps457, 0, 0, 0, 0, 0);
263 PALMAS_REG_INIT(smps6, 0, 0, 0, 0, 0);
264 PALMAS_REG_INIT(smps7, 0, 0, 0, 0, 0);
265 PALMAS_REG_INIT(smps8, 0, 0, 0, 0, 0);
266 PALMAS_REG_INIT(smps9, 0, 0, 0, 0, 0);
267 PALMAS_REG_INIT(smps10, 0, 0, 0, 0, 0);
268 PALMAS_REG_INIT(ldo1, 0, 0, 0, 0, 0);
269 PALMAS_REG_INIT(ldo2, 0, 0, 0, 0, 0);
270 PALMAS_REG_INIT(ldo3, 0, 0, 0, 0, 0);
271 PALMAS_REG_INIT(ldo4, 0, 0, 0, 0, 0);
272 PALMAS_REG_INIT(ldo5, 0, 0, 0, 0, 0);
273 PALMAS_REG_INIT(ldo6, 0, 0, 0, 0, 0);
274 PALMAS_REG_INIT(ldo7, 0, 0, 0, 0, 0);
275 PALMAS_REG_INIT(ldo8, 0, 0, 0, 0, 0);
276 PALMAS_REG_INIT(ldo9, 0, 0, 0, 0, 0);
277 PALMAS_REG_INIT(ldoln, 0, 0, 0, 0, 0);
278 PALMAS_REG_INIT(ldousb, 0, 0, 0, 0, 0);
279
280 #define PALMAS_REG_INIT_DATA(_sname) &reg_init_data_##_sname
281 static struct palmas_reg_init *pluto_reg_init[] = {
282         PALMAS_REG_INIT_DATA(smps12),
283         PALMAS_REG_INIT_DATA(smps123),
284         PALMAS_REG_INIT_DATA(smps3),
285         PALMAS_REG_INIT_DATA(smps45),
286         PALMAS_REG_INIT_DATA(smps457),
287         PALMAS_REG_INIT_DATA(smps6),
288         PALMAS_REG_INIT_DATA(smps7),
289         PALMAS_REG_INIT_DATA(smps8),
290         PALMAS_REG_INIT_DATA(smps9),
291         PALMAS_REG_INIT_DATA(smps10),
292         PALMAS_REG_INIT_DATA(ldo1),
293         PALMAS_REG_INIT_DATA(ldo2),
294         PALMAS_REG_INIT_DATA(ldo3),
295         PALMAS_REG_INIT_DATA(ldo4),
296         PALMAS_REG_INIT_DATA(ldo5),
297         PALMAS_REG_INIT_DATA(ldo6),
298         PALMAS_REG_INIT_DATA(ldo7),
299         PALMAS_REG_INIT_DATA(ldo8),
300         PALMAS_REG_INIT_DATA(ldo9),
301         PALMAS_REG_INIT_DATA(ldoln),
302         PALMAS_REG_INIT_DATA(ldousb),
303 };
304
305 static int ac_online(void)
306 {
307         return 1;
308 }
309
310 static struct resource pluto_pda_resources[] = {
311         [0] = {
312                 .name   = "ac",
313         },
314 };
315
316 static struct pda_power_pdata pluto_pda_data = {
317         .is_ac_online   = ac_online,
318 };
319
320 static struct platform_device pluto_pda_power_device = {
321         .name           = "pda-power",
322         .id             = -1,
323         .resource       = pluto_pda_resources,
324         .num_resources  = ARRAY_SIZE(pluto_pda_resources),
325         .dev    = {
326                 .platform_data  = &pluto_pda_data,
327         },
328 };
329
330 /* Always ON /Battery regulator */
331 static struct regulator_consumer_supply fixed_reg_en_battery_supply[] = {
332                 REGULATOR_SUPPLY("vdd_sys_cam", NULL),
333 };
334
335 static struct regulator_consumer_supply fixed_reg_en_vdd_1v8_cam_supply[] = {
336         REGULATOR_SUPPLY("vddio_cam_mb", NULL),
337         REGULATOR_SUPPLY("vdd_1v8_cam12", NULL),
338 };
339
340 static struct regulator_consumer_supply fixed_reg_en_vdd_1v2_cam_supply[] = {
341         REGULATOR_SUPPLY("vdd_1v2_cam", NULL),
342 };
343
344 static struct regulator_consumer_supply fixed_reg_en_avdd_usb3_1v05_supply[] = {
345         REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.2"),
346         REGULATOR_SUPPLY("avddio_usb", "tegra-ehci.2"),
347 };
348
349 static struct regulator_consumer_supply fixed_reg_en_vdd_mmc_sdmmc3_supply[] = {
350         REGULATOR_SUPPLY("vdd_sd_slot", "sdhci-tegra.2"),
351 };
352
353 static struct regulator_consumer_supply fixed_reg_en_vdd_lcd_1v8_supply[] = {
354         REGULATOR_SUPPLY("vdd_lcd_1v8_s", NULL),
355 };
356
357 static struct regulator_consumer_supply fixed_reg_en_vdd_lcd_mmc_supply[] = {
358         REGULATOR_SUPPLY("vdd_lcd_mmc_s_f", NULL),
359 };
360
361 static struct regulator_consumer_supply fixed_reg_en_vdd_1v8_mic_supply[] = {
362         REGULATOR_SUPPLY("unused_fixed_reg_en_vdd_1v8_mic", NULL),
363 };
364
365 static struct regulator_consumer_supply fixed_reg_en_vdd_hdmi_5v0_supply[] = {
366         REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.1"),
367 };
368
369 static struct regulator_consumer_supply fixed_reg_en_vpp_fuse_supply[] = {
370         REGULATOR_SUPPLY("vpp_fuse", NULL),
371         REGULATOR_SUPPLY("v_efuse", NULL),
372 };
373
374 /* Macro for defining fixed regulator sub device data */
375 #define FIXED_SUPPLY(_name) "fixed_reg_en"#_name
376 #define FIXED_REG(_id, _var, _name, _in_supply, _always_on, _boot_on,   \
377         _gpio_nr, _open_drain, _active_high, _boot_state, _millivolts)  \
378         static struct regulator_init_data ri_data_##_var =              \
379         {                                                               \
380                 .supply_regulator = _in_supply,                         \
381                 .num_consumer_supplies =                                \
382                         ARRAY_SIZE(fixed_reg_en_##_name##_supply),      \
383                 .consumer_supplies = fixed_reg_en_##_name##_supply,     \
384                 .constraints = {                                        \
385                         .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
386                                         REGULATOR_MODE_STANDBY),        \
387                         .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
388                                         REGULATOR_CHANGE_STATUS |       \
389                                         REGULATOR_CHANGE_VOLTAGE),      \
390                         .always_on = _always_on,                        \
391                         .boot_on = _boot_on,                            \
392                 },                                                      \
393         };                                                              \
394         static struct fixed_voltage_config fixed_reg_en_##_var##_pdata = \
395         {                                                               \
396                 .supply_name = FIXED_SUPPLY(_name),                     \
397                 .microvolts = _millivolts * 1000,                       \
398                 .gpio = _gpio_nr,                                       \
399                 .gpio_is_open_drain = _open_drain,                      \
400                 .enable_high = _active_high,                            \
401                 .enabled_at_boot = _boot_state,                         \
402                 .init_data = &ri_data_##_var,                           \
403         };                                                              \
404         static struct platform_device fixed_reg_en_##_var##_dev = {     \
405                 .name = "reg-fixed-voltage",                            \
406                 .id = _id,                                              \
407                 .dev = {                                                \
408                         .platform_data = &fixed_reg_en_##_var##_pdata,  \
409                 },                                                      \
410         }
411
412 FIXED_REG(0,    battery,        battery,
413         NULL,   0,      0,
414         -1,     false, true,    0,      3300);
415
416 FIXED_REG(1,    vdd_1v8_cam,    vdd_1v8_cam,
417         palmas_rails(smps8),    0,      0,
418         PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO1,  false, true,    0,      1800);
419
420 FIXED_REG(2,    vdd_1v2_cam,    vdd_1v2_cam,
421         palmas_rails(smps7),    0,      0,
422         PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO2,  false, true,    0,      1200);
423
424 FIXED_REG(3,    avdd_usb3_1v05, avdd_usb3_1v05,
425         palmas_rails(smps8),    0,      0,
426         TEGRA_GPIO_PK5, false,  true,   0,      1050);
427
428 FIXED_REG(4,    vdd_mmc_sdmmc3, vdd_mmc_sdmmc3,
429         palmas_rails(smps9),    0,      0,
430         TEGRA_GPIO_PK1, false,  true,   0,      3300);
431
432 FIXED_REG(5,    vdd_lcd_1v8,    vdd_lcd_1v8,
433         palmas_rails(smps8),    0,      0,
434         PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO4,  false,  true,   0,      1800);
435
436 FIXED_REG(6,    vdd_lcd_mmc,    vdd_lcd_mmc,
437         palmas_rails(smps9),    0,      0,
438         TEGRA_GPIO_PI4, false,  true,   0,      1800);
439
440 FIXED_REG(7,    vdd_1v8_mic,    vdd_1v8_mic,
441         palmas_rails(smps8),    0,      0,
442         -1,     false,  true,   0,      1800);
443
444 FIXED_REG(8,    vdd_hdmi_5v0,   vdd_hdmi_5v0,
445         palmas_rails(smps10),   0,      0,
446         TEGRA_GPIO_PK6, true,   true,   0,      5000);
447
448 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
449 FIXED_REG(9,    vpp_fuse,       vpp_fuse,
450         palmas_rails(smps8),    0,      0,
451         TEGRA_GPIO_PX4, false,  true,   0,      1800);
452 #else
453 FIXED_REG(9,    vpp_fuse,       vpp_fuse,
454         palmas_rails(smps8),    0,      0,
455         TEGRA_GPIO_PX0, false,  true,   0,      1800);
456 #endif
457
458 /*
459  * Creating the fixed regulator device tables
460  */
461 #define ADD_FIXED_REG(_name)    (&fixed_reg_en_##_name##_dev)
462
463 #define E1580_COMMON_FIXED_REG                  \
464         ADD_FIXED_REG(battery),                 \
465         ADD_FIXED_REG(vdd_1v8_cam),             \
466         ADD_FIXED_REG(vdd_1v2_cam),             \
467         ADD_FIXED_REG(avdd_usb3_1v05),          \
468         ADD_FIXED_REG(vdd_mmc_sdmmc3),          \
469         ADD_FIXED_REG(vdd_lcd_1v8),             \
470         ADD_FIXED_REG(vdd_lcd_mmc),             \
471         ADD_FIXED_REG(vdd_1v8_mic),             \
472         ADD_FIXED_REG(vdd_hdmi_5v0),
473
474 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
475 #define E1580_T114_FIXED_REG                    \
476         ADD_FIXED_REG(vpp_fuse),
477 #endif
478
479 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
480 #define E1580_T30_FIXED_REG                     \
481         ADD_FIXED_REG(vpp_fuse),
482 #endif
483
484 /* Gpio switch regulator platform data for Pluto E1580 */
485 static struct platform_device *pfixed_reg_devs[] = {
486         E1580_COMMON_FIXED_REG
487 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
488         E1580_T114_FIXED_REG
489 #endif
490 #ifdef CONFIG_ARCH_TEGRA_3x_SOC
491         E1580_T30_FIXED_REG
492 #endif
493 };
494
495 static struct palmas_pmic_platform_data pmic_platform = {
496         .reg_data = pluto_reg_data,
497         .reg_init = pluto_reg_init,
498 };
499
500 static struct palmas_platform_data palmas_pdata = {
501         .gpio_base = PALMAS_TEGRA_GPIO_BASE,
502         .irq_base = PALMAS_TEGRA_IRQ_BASE,
503         .pmic_pdata = &pmic_platform,
504         .mux_from_pdata = true,
505         .pad1 = 0,
506         .pad2 = 0,
507 };
508
509 static struct i2c_board_info palma_device[] = {
510         {
511                 I2C_BOARD_INFO("tps65913", 0x58),
512                 .irq            = INT_EXTERNAL_PMU,
513                 .platform_data  = &palmas_pdata,
514         },
515 };
516
517 int __init pluto_regulator_init(void)
518 {
519         void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
520         u32 pmc_ctrl;
521
522         /* TPS65913: Normal state of INT request line is LOW.
523          * configure the power management controller to trigger PMU
524          * interrupts when HIGH.
525          */
526         pmc_ctrl = readl(pmc + PMC_CTRL);
527         writel(pmc_ctrl & ~PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
528
529         platform_device_register(&pluto_pda_power_device);
530         i2c_register_board_info(4, palma_device,
531                         ARRAY_SIZE(palma_device));
532         return 0;
533 }
534
535 static int __init pluto_fixed_regulator_init(void)
536 {
537         if (!machine_is_tegra_pluto())
538                 return 0;
539
540         return platform_add_devices(pfixed_reg_devs,
541                         ARRAY_SIZE(pfixed_reg_devs));
542 }
543 subsys_initcall_sync(pluto_fixed_regulator_init);
544
545 static struct tegra_suspend_platform_data pluto_suspend_data = {
546         .cpu_timer      = 2000,
547         .cpu_off_timer  = 0,
548         .suspend_mode   = TEGRA_SUSPEND_NONE,
549         .core_timer     = 0x7e7e,
550         .core_off_timer = 0,
551         .corereq_high   = false,
552         .sysclkreq_high = true,
553 };
554
555 int __init pluto_suspend_init(void)
556 {
557         tegra_init_suspend(&pluto_suspend_data);
558         return 0;
559 }
560