regulator: max77663: convert regulator init data to pointer
[linux-2.6.git] / arch / arm / mach-tegra / board-dalmore-power.c
1 /*
2  * arch/arm/mach-tegra/board-dalmore-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 #include <linux/regulator/machine.h>
26 #include <linux/regulator/driver.h>
27 #include <linux/regulator/fixed.h>
28 #include <linux/mfd/max77663-core.h>
29 #include <linux/regulator/max77663-regulator.h>
30 #include <linux/regulator/tps51632-regulator.h>
31
32 #include <asm/mach-types.h>
33
34 #include <mach/iomap.h>
35 #include <mach/irqs.h>
36 #include <mach/gpio-tegra.h>
37
38 #include "pm.h"
39 #include "board.h"
40 #include "board-dalmore.h"
41
42 #define PMC_CTRL                0x0
43 #define PMC_CTRL_INTR_LOW       (1 << 17)
44
45 static struct regulator_consumer_supply max77663_sd0_supply[] = {
46         REGULATOR_SUPPLY("vdd_core", NULL),
47 };
48
49 static struct regulator_consumer_supply max77663_sd1_supply[] = {
50         REGULATOR_SUPPLY("vddio_ddr", NULL),
51 };
52
53 static struct regulator_consumer_supply max77663_sd2_supply[] = {
54         REGULATOR_SUPPLY("avdd_usb_pll", NULL),
55         REGULATOR_SUPPLY("vddio_cam", NULL),
56         REGULATOR_SUPPLY("avdd_osc", NULL),
57         REGULATOR_SUPPLY("vddio_sys", NULL),
58         REGULATOR_SUPPLY("vddio_bb", NULL),
59         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.0"),
60         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.3"),
61         REGULATOR_SUPPLY("vddio_audio", NULL),
62         REGULATOR_SUPPLY("vddio_uart", NULL),
63         REGULATOR_SUPPLY("vddio_gmi", NULL),
64 };
65
66 static struct regulator_consumer_supply max77663_sd3_supply[] = {
67         REGULATOR_SUPPLY("vdd_emmc_core", NULL),
68 };
69
70 static struct regulator_consumer_supply max77663_ldo0_supply[] = {
71         REGULATOR_SUPPLY("avdd_plla_p_c_s", NULL),
72         REGULATOR_SUPPLY("avdd_pllx", NULL),
73         REGULATOR_SUPPLY("avdd_pllm", NULL),
74         REGULATOR_SUPPLY("avdd_pllu", NULL),
75         REGULATOR_SUPPLY("avdd_hdmmi_pll", NULL),
76         REGULATOR_SUPPLY("avdd_csi_dsi_pll", NULL),
77 };
78
79 static struct regulator_consumer_supply max77663_ldo1_supply[] = {
80         REGULATOR_SUPPLY("vdd_ddr_hs", NULL),
81 };
82
83 static struct regulator_consumer_supply max77663_ldo2_supply[] = {
84         REGULATOR_SUPPLY("vdd_sensor_2v8", NULL),
85 };
86
87 static struct regulator_consumer_supply max77663_ldo3_supply[] = {
88         REGULATOR_SUPPLY("avdd_hdmi_pll", NULL),
89         REGULATOR_SUPPLY("avdd_usb3_pll", NULL),
90         REGULATOR_SUPPLY("avddio_usb3", NULL),
91 };
92
93 static struct regulator_consumer_supply max77663_ldo4_supply[] = {
94         REGULATOR_SUPPLY("vdd_rtc", NULL),
95 };
96
97 static struct regulator_consumer_supply max77663_ldo5_supply[] = {
98         REGULATOR_SUPPLY("avdd_dsi_csi", NULL),
99         REGULATOR_SUPPLY("vddio_hsic", NULL),
100 };
101
102 static struct regulator_consumer_supply max77663_ldo6_supply[] = {
103         REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.2"),
104 };
105
106 static struct regulator_consumer_supply max77663_ldo7_supply[] = {
107         REGULATOR_SUPPLY("avdd_cam1", NULL),
108 };
109
110 static struct regulator_consumer_supply max77663_ldo8_supply[] = {
111         REGULATOR_SUPPLY("avdd_cam2", NULL),
112 };
113
114 static struct max77663_regulator_fps_cfg max77663_fps_cfgs[] = {
115         {
116                 .src = FPS_SRC_0,
117                 .en_src = FPS_EN_SRC_EN0,
118                 .time_period = FPS_TIME_PERIOD_DEF,
119         },
120         {
121                 .src = FPS_SRC_1,
122                 .en_src = FPS_EN_SRC_EN1,
123                 .time_period = FPS_TIME_PERIOD_DEF,
124         },
125         {
126                 .src = FPS_SRC_2,
127                 .en_src = FPS_EN_SRC_EN0,
128                 .time_period = FPS_TIME_PERIOD_DEF,
129         },
130 };
131
132 #define MAX77663_PDATA_INIT(_id, _min_uV, _max_uV, _supply_reg,         \
133                 _always_on, _boot_on, _apply_uV,                        \
134                 _init_apply, _init_enable, _init_uV,                    \
135                 _fps_src, _fps_pu_period, _fps_pd_period, _flags)       \
136         static struct regulator_init_data max77663_regulator_idata_##_id = {   \
137                 .supply_regulator = _supply_reg,                        \
138                 .constraints = {                                        \
139                         .name = max77663_rails(_id),                    \
140                         .min_uV = _min_uV,                              \
141                         .max_uV = _max_uV,                              \
142                         .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
143                                              REGULATOR_MODE_STANDBY),   \
144                         .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
145                                            REGULATOR_CHANGE_STATUS |    \
146                                            REGULATOR_CHANGE_VOLTAGE),   \
147                         .always_on = _always_on,                        \
148                         .boot_on = _boot_on,                            \
149                         .apply_uV = _apply_uV,                          \
150                 },                                                      \
151                 .num_consumer_supplies =                                \
152                         ARRAY_SIZE(max77663_##_id##_supply),            \
153                 .consumer_supplies = max77663_##_id##_supply,           \
154         };                                                              \
155 static struct max77663_regulator_platform_data max77663_regulator_pdata_##_id =\
156 {                                                                       \
157                 .reg_init_data = &max77663_regulator_idata_##_id,       \
158                 .init_apply = _init_apply,                              \
159                 .init_enable = _init_enable,                            \
160                 .init_uV = _init_uV,                                    \
161                 .fps_src = _fps_src,                                    \
162                 .fps_pu_period = _fps_pu_period,                        \
163                 .fps_pd_period = _fps_pd_period,                        \
164                 .fps_cfgs = max77663_fps_cfgs,                          \
165                 .flags = _flags,                                        \
166         }
167
168 MAX77663_PDATA_INIT(sd0,  600000, 3387500, NULL, 1, 0, 0,
169                     1, 1, -1, FPS_SRC_1, -1, -1, SD_FSRADE_DISABLE);
170
171 MAX77663_PDATA_INIT(sd1,  800000, 1587500, NULL, 1, 0, 0,
172                     1, 1, -1, FPS_SRC_1, -1, -1, SD_FSRADE_DISABLE);
173
174 MAX77663_PDATA_INIT(sd2,  1800000, 1800000, NULL, 1, 0, 0,
175                     1, 1, -1, FPS_SRC_0, -1, -1, 0);
176
177 MAX77663_PDATA_INIT(sd3,  600000, 3387500, NULL, 1, 0, 0,
178                     1, 1, -1, FPS_SRC_NONE, -1, -1, 0);
179
180 MAX77663_PDATA_INIT(ldo0, 800000, 2350000, max77663_rails(sd2), 1, 0, 0,
181                     1, 1, -1, FPS_SRC_1, -1, -1, 0);
182
183 MAX77663_PDATA_INIT(ldo1, 800000, 2350000, max77663_rails(sd2), 0, 0, 0,
184                     0, 0, -1, FPS_SRC_NONE, -1, -1, 0);
185
186 MAX77663_PDATA_INIT(ldo2, 2850000, 2850000, NULL, 1, 0, 0,
187                     1, 1, -1, FPS_SRC_1, -1, -1, 0);
188
189 MAX77663_PDATA_INIT(ldo3, 800000, 3950000, max77663_rails(sd2), 1, 0, 0,
190                     1, 1, -1, FPS_SRC_NONE, -1, -1, 0);
191
192 MAX77663_PDATA_INIT(ldo4, 800000, 1587500, NULL, 0, 0, 0,
193                     1, 1, 1000000, FPS_SRC_NONE, -1, -1, LDO4_EN_TRACKING);
194
195 MAX77663_PDATA_INIT(ldo5, 800000, 2800000, max77663_rails(sd2), 0, 0, 0,
196                     1, 1, -1, FPS_SRC_NONE, -1, -1, 0);
197
198 MAX77663_PDATA_INIT(ldo6, 800000, 3950000, NULL, 0, 0, 0,
199                     0, 0, -1, FPS_SRC_NONE, -1, -1, 0);
200
201 MAX77663_PDATA_INIT(ldo7, 800000, 3950000, NULL, 0, 0, 0,
202                     0, 0, -1, FPS_SRC_NONE, -1, -1, 0);
203
204 MAX77663_PDATA_INIT(ldo8, 800000, 3950000, NULL, 0, 0, 0,
205                     1, 1, -1, FPS_SRC_1, -1, -1, 0);
206
207 #define MAX77663_REG(_id, _data)                                        \
208         {                                                               \
209                 .name = "max77663-regulator",                           \
210                 .id = MAX77663_REGULATOR_ID_##_id,                      \
211                 .platform_data = &max77663_regulator_pdata_##_data,     \
212                 .pdata_size = sizeof(max77663_regulator_pdata_##_data), \
213         }
214
215 static struct mfd_cell max77663_subdevs[] = {
216         MAX77663_REG(SD0, sd0),
217         MAX77663_REG(SD1, sd1),
218         MAX77663_REG(SD2, sd2),
219         MAX77663_REG(SD3, sd3),
220         MAX77663_REG(LDO0, ldo0),
221         MAX77663_REG(LDO1, ldo1),
222         MAX77663_REG(LDO2, ldo2),
223         MAX77663_REG(LDO3, ldo3),
224         MAX77663_REG(LDO4, ldo4),
225         MAX77663_REG(LDO5, ldo5),
226         MAX77663_REG(LDO6, ldo6),
227         MAX77663_REG(LDO7, ldo7),
228         MAX77663_REG(LDO8, ldo8),
229 };
230
231 static struct max77663_gpio_config max77663_gpio_cfgs[] = {
232         {
233                 .gpio = MAX77663_GPIO0,
234                 .dir = GPIO_DIR_OUT,
235                 .dout = GPIO_DOUT_LOW,
236                 .out_drv = GPIO_OUT_DRV_PUSH_PULL,
237                 .alternate = GPIO_ALT_DISABLE,
238         },
239         {
240                 .gpio = MAX77663_GPIO1,
241                 .dir = GPIO_DIR_IN,
242                 .dout = GPIO_DOUT_HIGH,
243                 .out_drv = GPIO_OUT_DRV_OPEN_DRAIN,
244                 .pull_up = GPIO_PU_ENABLE,
245                 .alternate = GPIO_ALT_DISABLE,
246         },
247         {
248                 .gpio = MAX77663_GPIO2,
249                 .dir = GPIO_DIR_OUT,
250                 .dout = GPIO_DOUT_HIGH,
251                 .out_drv = GPIO_OUT_DRV_OPEN_DRAIN,
252                 .pull_up = GPIO_PU_ENABLE,
253                 .alternate = GPIO_ALT_DISABLE,
254         },
255         {
256                 .gpio = MAX77663_GPIO3,
257                 .dir = GPIO_DIR_OUT,
258                 .dout = GPIO_DOUT_HIGH,
259                 .out_drv = GPIO_OUT_DRV_OPEN_DRAIN,
260                 .pull_up = GPIO_PU_ENABLE,
261                 .alternate = GPIO_ALT_DISABLE,
262         },
263         {
264                 .gpio = MAX77663_GPIO4,
265                 .dir = GPIO_DIR_OUT,
266                 .dout = GPIO_DOUT_HIGH,
267                 .out_drv = GPIO_OUT_DRV_PUSH_PULL,
268                 .alternate = GPIO_ALT_ENABLE,
269         },
270         {
271                 .gpio = MAX77663_GPIO5,
272                 .dir = GPIO_DIR_OUT,
273                 .dout = GPIO_DOUT_LOW,
274                 .out_drv = GPIO_OUT_DRV_PUSH_PULL,
275                 .alternate = GPIO_ALT_DISABLE,
276         },
277         {
278                 .gpio = MAX77663_GPIO6,
279                 .dir = GPIO_DIR_OUT,
280                 .dout = GPIO_DOUT_LOW,
281                 .out_drv = GPIO_OUT_DRV_OPEN_DRAIN,
282                 .alternate = GPIO_ALT_DISABLE,
283         },
284         {
285                 .gpio = MAX77663_GPIO7,
286                 .dir = GPIO_DIR_OUT,
287                 .dout = GPIO_DOUT_LOW,
288                 .out_drv = GPIO_OUT_DRV_OPEN_DRAIN,
289                 .alternate = GPIO_ALT_DISABLE,
290         },
291 };
292
293 static struct max77663_platform_data max7763_pdata = {
294         .irq_base       = MAX77663_IRQ_BASE,
295         .gpio_base      = MAX77663_GPIO_BASE,
296
297         .num_gpio_cfgs  = ARRAY_SIZE(max77663_gpio_cfgs),
298         .gpio_cfgs      = max77663_gpio_cfgs,
299
300
301         .num_subdevs    = ARRAY_SIZE(max77663_subdevs),
302         .sub_devices    = max77663_subdevs,
303
304         .rtc_i2c_addr   = 0x68,
305
306         .use_power_off  = false,
307 };
308
309
310 /* EN_AVDD_USB_HDMI From PMU GP1 */
311 static struct regulator_consumer_supply fixed_reg_en_avdd_hdmi_usb_supply[] = {
312         REGULATOR_SUPPLY("avdd_hdmi", NULL),
313         REGULATOR_SUPPLY("avdd_usb", NULL),
314         REGULATOR_SUPPLY("hvdd_usb3", NULL),
315 };
316
317 /* EN_3V3 From PMU GP2 */
318 static struct regulator_consumer_supply fixed_reg_en_3v3_sys_supply[] = {
319         REGULATOR_SUPPLY("vdd_3v3_sys", NULL),
320 };
321
322 /* EN_5V0 From PMU GP3 */
323 static struct regulator_consumer_supply fixed_reg_en_5v0_supply[] = {
324         REGULATOR_SUPPLY("vdd_5v0_sys", NULL),
325         REGULATOR_SUPPLY("vdd_hdmi_con", NULL),
326         REGULATOR_SUPPLY("vdd_spk", NULL),
327 };
328
329 /* EN_CAM_1v8 From PMU GP5 */
330 static struct regulator_consumer_supply fixed_reg_en_1v8_cam_supply[] = {
331         REGULATOR_SUPPLY("dvdd_cam", NULL),
332 };
333
334 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
335 /* EN_3V3_FUSE From TEGRA GPIO PX4 */
336 static struct regulator_consumer_supply fixed_reg_en_3v3_fuse_supply[] = {
337         REGULATOR_SUPPLY("vpp_fuse", NULL),
338 };
339
340 /* EN_USB1_VBUS From TEGRA GPIO PN4 */
341 static struct regulator_consumer_supply fixed_reg_en_usb1_vbus_supply[] = {
342         REGULATOR_SUPPLY("vdd_vbus_micro_usb", NULL),
343 };
344
345 /* EN_USB3_VBUS From TEGRA GPIO PM5 */
346 static struct regulator_consumer_supply fixed_reg_en_usb3_vbus_supply[] = {
347         REGULATOR_SUPPLY("usb3_vbus_con", NULL),
348 };
349 #endif
350
351 static struct regulator_consumer_supply fixed_reg_en_vddio_hv_supply[] = {
352         REGULATOR_SUPPLY("vddio_hv", NULL),
353 };
354
355 /* Macro for defining fixed regulator sub device data */
356 #define FIXED_SUPPLY(_name) "fixed_reg_"#_name
357 #define FIXED_REG(_id, _var, _name, _in_supply, _always_on, _boot_on,   \
358         _gpio_nr, _active_high, _boot_state, _millivolts)       \
359         static struct regulator_init_data ri_data_##_var =              \
360         {                                                               \
361                 .supply_regulator = _in_supply,                         \
362                 .num_consumer_supplies =                                \
363                         ARRAY_SIZE(fixed_reg_##_name##_supply),         \
364                 .consumer_supplies = fixed_reg_##_name##_supply,        \
365                 .constraints = {                                        \
366                         .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
367                                         REGULATOR_MODE_STANDBY),        \
368                         .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
369                                         REGULATOR_CHANGE_STATUS |       \
370                                         REGULATOR_CHANGE_VOLTAGE),      \
371                         .always_on = _always_on,                        \
372                         .boot_on = _boot_on,                            \
373                 },                                                      \
374         };                                                              \
375         static struct fixed_voltage_config fixed_reg_##_var##_pdata =   \
376         {                                                               \
377                 .supply_name = FIXED_SUPPLY(_name),                     \
378                 .microvolts = _millivolts * 1000,                       \
379                 .gpio = _gpio_nr,                                       \
380                 .enable_high = _active_high,                            \
381                 .enabled_at_boot = _boot_state,                         \
382                 .init_data = &ri_data_##_var,                           \
383         };                                                              \
384         static struct platform_device fixed_reg_##_var##_dev = {        \
385                 .name = "reg-fixed-voltage",                            \
386                 .id = _id,                                              \
387                 .dev = {                                                \
388                         .platform_data = &fixed_reg_##_var##_pdata,     \
389                 },                                                      \
390         }
391
392 FIXED_REG(1,    en_3v3_sys,     en_3v3_sys,
393         NULL,   1,      0,
394         MAX77663_GPIO_BASE + MAX77663_GPIO2,    true,   1,      3300);
395 FIXED_REG(2,    en_avdd_hdmi_usb,       en_avdd_hdmi_usb,
396         FIXED_SUPPLY(en_3v3_sys),       0,      0,
397         MAX77663_GPIO_BASE + MAX77663_GPIO1,    true,   1,      3300);
398 FIXED_REG(3,    en_1v8_cam,     en_1v8_cam,
399         max77663_rails(sd2),    0,      0,
400         MAX77663_GPIO_BASE + MAX77663_GPIO5,    true,   0,      1800);
401 FIXED_REG(4,    en_5v0, en_5v0,
402         NULL,   0,      0,
403         MAX77663_GPIO_BASE + MAX77663_GPIO3,    true,   0,      5000);
404 FIXED_REG(5,    en_vddio_hv,    en_vddio_hv,
405         FIXED_SUPPLY(en_3v3_sys),       0,      0,
406         -1,     true,   0,      3300);
407 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
408 FIXED_REG(6,    en_3v3_fuse,    en_3v3_fuse,
409         max77663_rails(sd2),    0,      0,
410         TEGRA_GPIO_PX4, true,   0,      3300);
411 FIXED_REG(7,    en_usb1_vbus,   en_usb1_vbus,
412         FIXED_SUPPLY(en_5v0),   0,      0,
413         TEGRA_GPIO_PN4, true,   0,      5000);
414 FIXED_REG(8,    en_usb3_vbus,   en_usb3_vbus,
415         FIXED_SUPPLY(en_5v0),   0,      0,
416         TEGRA_GPIO_PM5, true,   0,      5000);
417 #endif
418
419 /*
420  * Creating the fixed regulator device tables
421  */
422
423 #define ADD_FIXED_REG(_name)    (&fixed_reg_##_name##_dev)
424
425 #define E1612_COMMON_FIXED_REG                  \
426         ADD_FIXED_REG(en_3v3_sys),              \
427         ADD_FIXED_REG(en_avdd_hdmi_usb),        \
428         ADD_FIXED_REG(en_1v8_cam),              \
429         ADD_FIXED_REG(en_5v0),                  \
430         ADD_FIXED_REG(en_vddio_hv),             \
431
432 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
433
434 #define E1612_T114_FIXED_REG                    \
435         ADD_FIXED_REG(en_3v3_fuse),             \
436         ADD_FIXED_REG(en_usb1_vbus),            \
437         ADD_FIXED_REG(en_usb3_vbus),            \
438
439 #endif
440
441 /* Gpio switch regulator platform data for Dalmore E1612 */
442 static struct platform_device *fixed_reg_devs_a00[] = {
443 #ifdef CONFIG_ARCH_TEGRA_11x_SOC
444         E1612_T114_FIXED_REG,
445 #endif
446         E1612_COMMON_FIXED_REG
447
448 };
449
450 static struct i2c_board_info __initdata max77663_regulators[] = {
451         {
452                 /* The I2C address was determined by OTP factory setting */
453                 I2C_BOARD_INFO("max77663", 0x3c),
454                 .irq            = INT_EXTERNAL_PMU,
455                 .platform_data  = &max7763_pdata,
456         },
457 };
458
459 /* TPS51632 DC-DC converter */
460 static struct regulator_consumer_supply tps51632_dcdc_supply[] = {
461         REGULATOR_SUPPLY("vdd_cpu", NULL),
462 };
463
464 static struct regulator_init_data tps51632_init_data = {
465         .constraints = {                                                \
466                 .min_uV = 500000,                                       \
467                         .max_uV = 1520000,                              \
468                         .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
469                                         REGULATOR_MODE_STANDBY),        \
470                         .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
471                                         REGULATOR_CHANGE_STATUS |       \
472                                         REGULATOR_CHANGE_VOLTAGE),      \
473                         .always_on = 1,                                 \
474                         .boot_on =  1,                                  \
475                         .apply_uV = 0,                                  \
476         },                                                              \
477         .num_consumer_supplies = ARRAY_SIZE(tps51632_dcdc_supply),      \
478                 .consumer_supplies = tps51632_dcdc_supply,              \
479 };
480
481 static struct tps51632_regulator_platform_data tps51632_pdata = {
482         .reg_init_data = &tps51632_init_data,           \
483         .enable_pwm = false,                            \
484         .max_voltage_uV = 1520000,                      \
485         .base_voltage_uV = 500000,                      \
486         .slew_rate_uv_per_us = 6000,                    \
487 };
488
489 static struct i2c_board_info __initdata tps51632_boardinfo[] = {
490         {
491                 I2C_BOARD_INFO("tps51632", 0x43),
492                 .platform_data  = &tps51632_pdata,
493         },
494 };
495
496 static int ac_online(void)
497 {
498         return 1;
499 }
500
501 static struct resource dalmore_pda_resources[] = {
502         [0] = {
503                 .name   = "ac",
504         },
505 };
506
507 static struct pda_power_pdata dalmore_pda_data = {
508         .is_ac_online   = ac_online,
509 };
510
511 static struct platform_device dalmore_pda_power_device = {
512         .name           = "pda-power",
513         .id             = -1,
514         .resource       = dalmore_pda_resources,
515         .num_resources  = ARRAY_SIZE(dalmore_pda_resources),
516         .dev    = {
517                 .platform_data  = &dalmore_pda_data,
518         },
519 };
520
521 static struct tegra_suspend_platform_data dalmore_suspend_data = {
522         .cpu_timer      = 2000,
523         .cpu_off_timer  = 0,
524         .suspend_mode   = TEGRA_SUSPEND_NONE,
525         .core_timer     = 0x7e7e,
526         .core_off_timer = 0,
527         .corereq_high   = false,
528         .sysclkreq_high = true,
529 };
530
531 static int __init dalmore_max77663_regulator_init(void)
532 {
533         void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
534         u32 pmc_ctrl;
535
536         /* configure the power management controller to trigger PMU
537          * interrupts when low */
538         pmc_ctrl = readl(pmc + PMC_CTRL);
539         writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
540
541         i2c_register_board_info(4, max77663_regulators,
542                                 ARRAY_SIZE(max77663_regulators));
543
544         return 0;
545 }
546
547 static int __init dalmore_fixed_regulator_init(void)
548 {
549         int i;
550         struct board_info board_info;
551         struct platform_device **fixed_reg_devs;
552         int nfixreg_devs;
553
554         tegra_get_board_info(&board_info);
555         fixed_reg_devs = fixed_reg_devs_a00;
556         nfixreg_devs = ARRAY_SIZE(fixed_reg_devs_a00);
557
558         if (!machine_is_dalmore())
559                 return 0;
560
561         for (i = 0; i < nfixreg_devs; ++i) {
562                 int gpio_nr;
563                 struct fixed_voltage_config *fixed_reg_pdata =
564                         fixed_reg_devs[i]->dev.platform_data;
565                 gpio_nr = fixed_reg_pdata->gpio;
566
567         }
568
569         return platform_add_devices(fixed_reg_devs, nfixreg_devs);
570 }
571 subsys_initcall_sync(dalmore_fixed_regulator_init);
572
573
574 int __init dalmore_regulator_init(void)
575 {
576         dalmore_max77663_regulator_init();
577         i2c_register_board_info(4, tps51632_boardinfo, 1);
578         platform_device_register(&dalmore_pda_power_device);
579         return 0;
580 }
581
582 int __init dalmore_suspend_init(void)
583 {
584         tegra_init_suspend(&dalmore_suspend_data);
585         return 0;
586 }
587