video: tegra: imx091: lower max VI clock to 204MHz
[linux-2.6.git] / arch / arm / mach-tegra / board-dalmore-sensors.c
1 /*
2  * arch/arm/mach-tegra/board-dalmore-sensors.c
3  *
4  * Copyright (c) 2012-2013 NVIDIA CORPORATION, All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in the
15  * documentation and/or other materials provided with the distribution.
16  *
17  * Neither the name of NVIDIA CORPORATION nor the names of its contributors
18  * may be used to endorse or promote products derived from this software
19  * without specific prior written permission.
20  *
21  * This software is licensed under the terms of the GNU General Public
22  * License version 2, as published by the Free Software Foundation, and
23  * may be copied, distributed, and modified under those terms.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28  * GNU General Public License for more details.
29  */
30
31 #include <linux/i2c.h>
32 #include <linux/delay.h>
33 #include <linux/mpu.h>
34 #include <linux/regulator/consumer.h>
35 #include <linux/gpio.h>
36 #include <linux/therm_est.h>
37 #include <linux/nct1008.h>
38 #include <mach/edp.h>
39 #include <linux/edp.h>
40 #include <mach/gpio-tegra.h>
41 #include <mach/pinmux-t11.h>
42 #include <mach/pinmux.h>
43 #include <media/imx091.h>
44 #include <media/ov9772.h>
45 #include <media/as364x.h>
46 #include <media/ad5816.h>
47 #include <generated/mach-types.h>
48 #include <linux/power/sbs-battery.h>
49
50 #include "gpio-names.h"
51 #include "board.h"
52 #include "board-common.h"
53 #include "board-dalmore.h"
54 #include "cpu-tegra.h"
55 #include "devices.h"
56 #include "tegra-board-id.h"
57 #include "dvfs.h"
58
59 static struct nvc_gpio_pdata imx091_gpio_pdata[] = {
60         {IMX091_GPIO_RESET, CAM_RSTN, true, false},
61         {IMX091_GPIO_PWDN, CAM1_POWER_DWN_GPIO, true, false},
62         {IMX091_GPIO_GP1, CAM_GPIO1, true, false}
63 };
64
65 static struct board_info board_info;
66
67 static struct throttle_table tj_throttle_table[] = {
68         {      0, 1000 },
69         {  51000, 1000 },
70         { 102000, 1000 },
71         { 204000, 1000 },
72         { 252000, 1000 },
73         { 288000, 1000 },
74         { 372000, 1000 },
75         { 468000, 1000 },
76         { 510000, 1000 },
77         { 612000, 1000 },
78         { 714000, 1050 },
79         { 816000, 1050 },
80         { 918000, 1050 },
81         {1020000, 1100 },
82         {1122000, 1100 },
83         {1224000, 1100 },
84         {1326000, 1100 },
85         {1428000, 1100 },
86         {1530000, 1100 },
87 };
88
89 static struct balanced_throttle tj_throttle = {
90         .throt_tab_size = ARRAY_SIZE(tj_throttle_table),
91         .throt_tab = tj_throttle_table,
92 };
93
94 static int __init dalmore_throttle_init(void)
95 {
96         if (machine_is_dalmore())
97                 balanced_throttle_register(&tj_throttle, "tegra-balanced");
98         return 0;
99 }
100 module_init(dalmore_throttle_init);
101
102 static struct nct1008_platform_data dalmore_nct1008_pdata = {
103         .supported_hwrev = true,
104         .ext_range = true,
105         .conv_rate = 0x08,
106         .offset = 0,
107         .shutdown_ext_limit = 85, /* C */
108         .shutdown_local_limit = 120, /* C */
109
110         .passive_delay = 2000,
111
112         .num_trips = 1,
113         .trips = {
114                 /* Thermal Throttling */
115                 [0] = {
116                         .cdev_type = "tegra-balanced",
117                         .trip_temp = 75000,
118                         .trip_type = THERMAL_TRIP_PASSIVE,
119                         .state = THERMAL_NO_LIMIT,
120                         .hysteresis = 0,
121                 },
122         },
123 };
124
125 static struct i2c_board_info dalmore_i2c4_nct1008_board_info[] = {
126         {
127                 I2C_BOARD_INFO("nct1008", 0x4C),
128                 .platform_data = &dalmore_nct1008_pdata,
129                 .irq = -1,
130         }
131 };
132
133 #define VI_PINMUX(_pingroup, _mux, _pupd, _tri, _io, _lock, _ioreset) \
134         {                                                       \
135                 .pingroup       = TEGRA_PINGROUP_##_pingroup,   \
136                 .func           = TEGRA_MUX_##_mux,             \
137                 .pupd           = TEGRA_PUPD_##_pupd,           \
138                 .tristate       = TEGRA_TRI_##_tri,             \
139                 .io             = TEGRA_PIN_##_io,              \
140                 .lock           = TEGRA_PIN_LOCK_##_lock,       \
141                 .od             = TEGRA_PIN_OD_DEFAULT,         \
142                 .ioreset        = TEGRA_PIN_IO_RESET_##_ioreset \
143 }
144
145 static int dalmore_focuser_power_on(struct ad5816_power_rail *pw)
146 {
147         int err;
148
149         if (unlikely(WARN_ON(!pw || !pw->vdd || !pw->vdd_i2c)))
150                 return -EFAULT;
151
152         err = regulator_enable(pw->vdd_i2c);
153         if (unlikely(err))
154                 goto ad5816_vdd_i2c_fail;
155
156         err = regulator_enable(pw->vdd);
157         if (unlikely(err))
158                 goto ad5816_vdd_fail;
159
160         return 0;
161
162 ad5816_vdd_fail:
163         regulator_disable(pw->vdd_i2c);
164
165 ad5816_vdd_i2c_fail:
166         pr_err("%s FAILED\n", __func__);
167
168         return -ENODEV;
169 }
170
171 static int dalmore_focuser_power_off(struct ad5816_power_rail *pw)
172 {
173         if (unlikely(WARN_ON(!pw || !pw->vdd || !pw->vdd_i2c)))
174                 return -EFAULT;
175
176         regulator_disable(pw->vdd);
177         regulator_disable(pw->vdd_i2c);
178
179         return 0;
180 }
181
182 static struct tegra_pingroup_config mclk_disable =
183         VI_PINMUX(CAM_MCLK, VI, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
184
185 static struct tegra_pingroup_config mclk_enable =
186         VI_PINMUX(CAM_MCLK, VI_ALT3, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
187
188 static struct tegra_pingroup_config pbb0_disable =
189         VI_PINMUX(GPIO_PBB0, VI, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
190
191 static struct tegra_pingroup_config pbb0_enable =
192         VI_PINMUX(GPIO_PBB0, VI_ALT3, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
193
194 /*
195  * As a workaround, dalmore_vcmvdd need to be allocated to activate the
196  * sensor devices. This is due to the focuser device(AD5816) will hook up
197  * the i2c bus if it is not powered up.
198 */
199 static struct regulator *dalmore_vcmvdd;
200
201 static int dalmore_get_vcmvdd(void)
202 {
203         if (!dalmore_vcmvdd) {
204                 dalmore_vcmvdd = regulator_get(NULL, "vdd_af_cam1");
205                 if (unlikely(WARN_ON(IS_ERR(dalmore_vcmvdd)))) {
206                         pr_err("%s: can't get regulator vcmvdd: %ld\n",
207                                 __func__, PTR_ERR(dalmore_vcmvdd));
208                         dalmore_vcmvdd = NULL;
209                         return -ENODEV;
210                 }
211         }
212         return 0;
213 }
214
215 static int dalmore_imx091_power_on(struct nvc_regulator *vreg)
216 {
217         int err;
218
219         if (unlikely(WARN_ON(!vreg)))
220                 return -EFAULT;
221
222         if (dalmore_get_vcmvdd())
223                 goto imx091_poweron_fail;
224
225         gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
226         usleep_range(10, 20);
227
228         err = regulator_enable(vreg[IMX091_VREG_AVDD].vreg);
229         if (err)
230                 goto imx091_avdd_fail;
231
232         err = regulator_enable(vreg[IMX091_VREG_IOVDD].vreg);
233         if (err)
234                 goto imx091_iovdd_fail;
235
236         usleep_range(1, 2);
237         gpio_set_value(CAM1_POWER_DWN_GPIO, 1);
238
239         err = regulator_enable(dalmore_vcmvdd);
240         if (unlikely(err))
241                 goto imx091_vcmvdd_fail;
242
243         tegra_pinmux_config_table(&mclk_enable, 1);
244         usleep_range(300, 310);
245
246         return 1;
247
248 imx091_vcmvdd_fail:
249         regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
250
251 imx091_iovdd_fail:
252         regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
253
254 imx091_avdd_fail:
255         gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
256
257 imx091_poweron_fail:
258         pr_err("%s FAILED\n", __func__);
259         return -ENODEV;
260 }
261
262 static int dalmore_imx091_power_off(struct nvc_regulator *vreg)
263 {
264         if (unlikely(WARN_ON(!vreg)))
265                 return -EFAULT;
266
267         usleep_range(1, 2);
268         tegra_pinmux_config_table(&mclk_disable, 1);
269         gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
270         usleep_range(1, 2);
271
272         regulator_disable(dalmore_vcmvdd);
273         regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
274         regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
275
276         return 1;
277 }
278
279 static struct nvc_imager_cap imx091_cap = {
280         .identifier             = "IMX091",
281         .sensor_nvc_interface   = 3,
282         .pixel_types[0]         = 0x100,
283         .orientation            = 0,
284         .direction              = 0,
285         .initial_clock_rate_khz = 6000,
286         .clock_profiles[0] = {
287                 .external_clock_khz     = 24000,
288                 .clock_multiplier       = 850000, /* value / 1,000,000 */
289         },
290         .clock_profiles[1] = {
291                 .external_clock_khz     = 0,
292                 .clock_multiplier       = 0,
293         },
294         .h_sync_edge            = 0,
295         .v_sync_edge            = 0,
296         .mclk_on_vgp0           = 0,
297         .csi_port               = 0,
298         .data_lanes             = 4,
299         .virtual_channel_id     = 0,
300         .discontinuous_clk_mode = 1,
301         .cil_threshold_settle   = 0x0,
302         .min_blank_time_width   = 16,
303         .min_blank_time_height  = 16,
304         .preferred_mode_index   = 0,
305         .focuser_guid           = NVC_FOCUS_GUID(0),
306         .torch_guid             = NVC_TORCH_GUID(0),
307         .cap_version            = NVC_IMAGER_CAPABILITIES_VERSION2,
308 };
309
310 static struct imx091_platform_data imx091_pdata = {
311         .num                    = 0,
312         .sync                   = 0,
313         .dev_name               = "camera",
314         .gpio_count             = ARRAY_SIZE(imx091_gpio_pdata),
315         .gpio                   = imx091_gpio_pdata,
316         .flash_cap              = {
317                 .sdo_trigger_enabled = 1,
318                 .adjustable_flash_timing = 1,
319         },
320         .cap                    = &imx091_cap,
321         .power_on               = dalmore_imx091_power_on,
322         .power_off              = dalmore_imx091_power_off,
323 };
324
325 struct sbs_platform_data sbs_pdata = {
326         .poll_retry_count = 100,
327         .i2c_retry_count = 2,
328 };
329
330 static int dalmore_ov9772_power_on(struct ov9772_power_rail *pw)
331 {
332         int err;
333
334         if (unlikely(!pw || !pw->avdd || !pw->dovdd))
335                 return -EFAULT;
336
337         if (dalmore_get_vcmvdd())
338                 goto ov9772_get_vcmvdd_fail;
339
340         gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
341         gpio_set_value(CAM_RSTN, 0);
342
343         err = regulator_enable(pw->avdd);
344         if (unlikely(err))
345                 goto ov9772_avdd_fail;
346
347         err = regulator_enable(pw->dovdd);
348         if (unlikely(err))
349                 goto ov9772_dovdd_fail;
350
351         gpio_set_value(CAM_RSTN, 1);
352         gpio_set_value(CAM2_POWER_DWN_GPIO, 1);
353
354         err = regulator_enable(dalmore_vcmvdd);
355         if (unlikely(err))
356                 goto ov9772_vcmvdd_fail;
357
358         tegra_pinmux_config_table(&pbb0_enable, 1);
359         usleep_range(340, 380);
360
361         /* return 1 to skip the in-driver power_on sequence */
362         return 1;
363
364 ov9772_vcmvdd_fail:
365         regulator_disable(pw->dovdd);
366
367 ov9772_dovdd_fail:
368         regulator_disable(pw->avdd);
369
370 ov9772_avdd_fail:
371         gpio_set_value(CAM_RSTN, 0);
372         gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
373
374 ov9772_get_vcmvdd_fail:
375         pr_err("%s FAILED\n", __func__);
376         return -ENODEV;
377 }
378
379 static int dalmore_ov9772_power_off(struct ov9772_power_rail *pw)
380 {
381         if (unlikely(!pw || !dalmore_vcmvdd || !pw->avdd || !pw->dovdd))
382                 return -EFAULT;
383
384         usleep_range(21, 25);
385         tegra_pinmux_config_table(&pbb0_disable, 1);
386
387         gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
388         gpio_set_value(CAM_RSTN, 0);
389
390         regulator_disable(dalmore_vcmvdd);
391         regulator_disable(pw->dovdd);
392         regulator_disable(pw->avdd);
393
394         /* return 1 to skip the in-driver power_off sequence */
395         return 1;
396 }
397
398 static struct nvc_gpio_pdata ov9772_gpio_pdata[] = {
399         { OV9772_GPIO_TYPE_SHTDN, CAM2_POWER_DWN_GPIO, true, 0, },
400         { OV9772_GPIO_TYPE_PWRDN, CAM_RSTN, true, 0, },
401 };
402
403 static struct ov9772_platform_data dalmore_ov9772_pdata = {
404         .num            = 1,
405         .dev_name       = "camera",
406         .gpio_count     = ARRAY_SIZE(ov9772_gpio_pdata),
407         .gpio           = ov9772_gpio_pdata,
408         .power_on       = dalmore_ov9772_power_on,
409         .power_off      = dalmore_ov9772_power_off,
410 };
411
412 static int dalmore_as3648_power_on(struct as364x_power_rail *pw)
413 {
414         int err = dalmore_get_vcmvdd();
415
416         if (err)
417                 return err;
418
419         return regulator_enable(dalmore_vcmvdd);
420 }
421
422 static int dalmore_as3648_power_off(struct as364x_power_rail *pw)
423 {
424         if (!dalmore_vcmvdd)
425                 return -ENODEV;
426
427         return regulator_disable(dalmore_vcmvdd);
428 }
429
430 static struct as364x_platform_data dalmore_as3648_pdata = {
431         .config         = {
432                 .max_total_current_mA = 1000,
433                 .max_peak_current_mA = 600,
434                 .vin_low_v_run_mV = 3070,
435                 .strobe_type = 1,
436                 },
437         .pinstate       = {
438                 .mask   = 1 << (CAM_FLASH_STROBE - TEGRA_GPIO_PBB0),
439                 .values = 1 << (CAM_FLASH_STROBE - TEGRA_GPIO_PBB0)
440                 },
441         .dev_name       = "torch",
442         .type           = AS3648,
443         .gpio_strobe    = CAM_FLASH_STROBE,
444         .led_mask       = 3,
445
446         .power_on_callback = dalmore_as3648_power_on,
447         .power_off_callback = dalmore_as3648_power_off,
448 };
449
450 static struct ad5816_platform_data dalmore_ad5816_pdata = {
451         .cfg = 0,
452         .num = 0,
453         .sync = 0,
454         .dev_name = "focuser",
455         .power_on = dalmore_focuser_power_on,
456         .power_off = dalmore_focuser_power_off,
457 };
458
459 static struct i2c_board_info dalmore_i2c_board_info_e1625[] = {
460         {
461                 I2C_BOARD_INFO("imx091", 0x36),
462                 .platform_data = &imx091_pdata,
463         },
464         {
465                 I2C_BOARD_INFO("ov9772", 0x10),
466                 .platform_data = &dalmore_ov9772_pdata,
467         },
468         {
469                 I2C_BOARD_INFO("as3648", 0x30),
470                 .platform_data = &dalmore_as3648_pdata,
471         },
472         {
473                 I2C_BOARD_INFO("ad5816", 0x0E),
474                 .platform_data = &dalmore_ad5816_pdata,
475         },
476 };
477
478 static int dalmore_camera_init(void)
479 {
480         tegra_pinmux_config_table(&mclk_disable, 1);
481         tegra_pinmux_config_table(&pbb0_disable, 1);
482
483         i2c_register_board_info(2, dalmore_i2c_board_info_e1625,
484                 ARRAY_SIZE(dalmore_i2c_board_info_e1625));
485         return 0;
486 }
487
488 /* MPU board file definition    */
489 static struct mpu_platform_data mpu9150_gyro_data = {
490         .int_config     = 0x10,
491         .level_shifter  = 0,
492         /* Located in board_[platformname].h */
493         .orientation    = MPU_GYRO_ORIENTATION,
494         .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS,
495         .sec_slave_id   = COMPASS_ID_AK8975,
496         .secondary_i2c_addr     = MPU_COMPASS_ADDR,
497         .secondary_read_reg     = 0x06,
498         .secondary_orientation  = MPU_COMPASS_ORIENTATION,
499         .key            = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22,
500                            0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89},
501 };
502
503 #define TEGRA_CAMERA_GPIO(_gpio, _label, _value)                \
504         {                                                       \
505                 .gpio = _gpio,                                  \
506                 .label = _label,                                \
507                 .value = _value,                                \
508         }
509
510 static struct i2c_board_info dalmore_i2c_board_info_cm3218[] = {
511         {
512                 I2C_BOARD_INFO("cm3218", 0x48),
513         },
514 };
515
516 static struct i2c_board_info __initdata inv_mpu9150_i2c2_board_info[] = {
517         {
518                 I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR),
519                 .platform_data = &mpu9150_gyro_data,
520         },
521 };
522
523 static void mpuirq_init(void)
524 {
525         int ret = 0;
526         unsigned gyro_irq_gpio = MPU_GYRO_IRQ_GPIO;
527         unsigned gyro_bus_num = MPU_GYRO_BUS_NUM;
528         char *gyro_name = MPU_GYRO_NAME;
529
530         pr_info("*** MPU START *** mpuirq_init...\n");
531
532         ret = gpio_request(gyro_irq_gpio, gyro_name);
533
534         if (ret < 0) {
535                 pr_err("%s: gpio_request failed %d\n", __func__, ret);
536                 return;
537         }
538
539         ret = gpio_direction_input(gyro_irq_gpio);
540         if (ret < 0) {
541                 pr_err("%s: gpio_direction_input failed %d\n", __func__, ret);
542                 gpio_free(gyro_irq_gpio);
543                 return;
544         }
545         pr_info("*** MPU END *** mpuirq_init...\n");
546
547         inv_mpu9150_i2c2_board_info[0].irq = gpio_to_irq(MPU_GYRO_IRQ_GPIO);
548         i2c_register_board_info(gyro_bus_num, inv_mpu9150_i2c2_board_info,
549                 ARRAY_SIZE(inv_mpu9150_i2c2_board_info));
550 }
551
552 static int dalmore_nct1008_init(void)
553 {
554         int nct1008_port;
555         int ret = 0;
556
557         if ((board_info.board_id == BOARD_E1612) ||
558             (board_info.board_id == BOARD_E1641) ||
559             (board_info.board_id == BOARD_E1613) ||
560             (board_info.board_id == BOARD_P2454))
561         {
562                 /* per email from Matt 9/10/2012 */
563                 nct1008_port = TEGRA_GPIO_PX6;
564         } else if (board_info.board_id == BOARD_E1611) {
565                 if (board_info.fab == 0x04)
566                         nct1008_port = TEGRA_GPIO_PO4;
567                 else
568                         nct1008_port = TEGRA_GPIO_PX6;
569         } else {
570                 nct1008_port = TEGRA_GPIO_PX6;
571                 pr_err("Warning: nct alert_port assumed TEGRA_GPIO_PX6"
572                         " for unknown dalmore board id E%d\n",
573                         board_info.board_id);
574         }
575
576         tegra_platform_edp_init(dalmore_nct1008_pdata.trips,
577                                 &dalmore_nct1008_pdata.num_trips);
578         tegra_add_cdev_trips(dalmore_nct1008_pdata.trips,
579                                 &dalmore_nct1008_pdata.num_trips);
580
581         dalmore_i2c4_nct1008_board_info[0].irq = gpio_to_irq(nct1008_port);
582         pr_info("%s: dalmore nct1008 irq %d",
583                         __func__, dalmore_i2c4_nct1008_board_info[0].irq);
584
585         ret = gpio_request(nct1008_port, "temp_alert");
586         if (ret < 0)
587                 return ret;
588
589         ret = gpio_direction_input(nct1008_port);
590         if (ret < 0) {
591                 pr_info("%s: calling gpio_free(nct1008_port)", __func__);
592                 gpio_free(nct1008_port);
593         }
594
595         /* dalmore has thermal sensor on GEN1-I2C i.e. instance 0 */
596         i2c_register_board_info(0, dalmore_i2c4_nct1008_board_info,
597                 ARRAY_SIZE(dalmore_i2c4_nct1008_board_info));
598
599         return ret;
600 }
601
602 static struct i2c_board_info __initdata bq20z45_pdata[] = {
603         {
604                 I2C_BOARD_INFO("sbs-battery", 0x0B),
605                 .platform_data = &sbs_pdata,
606         },
607 };
608
609 #ifdef CONFIG_TEGRA_SKIN_THROTTLE
610 static int tegra_skin_match(struct thermal_zone_device *thz, void *data)
611 {
612         return strcmp((char *)data, thz->type) == 0;
613 }
614
615 static int tegra_skin_get_temp(void *data, long *temp)
616 {
617         struct thermal_zone_device *thz;
618
619         thz = thermal_zone_device_find(data, tegra_skin_match);
620
621         if (!thz || thz->ops->get_temp(thz, temp))
622                 *temp = 25000;
623
624         return 0;
625 }
626
627 static struct therm_est_data skin_data = {
628         .cdev_type = "skin-balanced",
629         .toffset = 9793,
630         .polling_period = 1100,
631         .ndevs = 2,
632         .tc1 = 5,
633         .tc2 = 1,
634         .devs = {
635                         {
636                                 .dev_data = "nct_ext",
637                                 .get_temp = tegra_skin_get_temp,
638                                 .coeffs = {
639                                         2, 1, 1, 1,
640                                         1, 1, 1, 1,
641                                         1, 1, 1, 0,
642                                         1, 1, 0, 0,
643                                         0, 0, -1, -7
644                                 },
645                         },
646                         {
647                                 .dev_data = "nct_int",
648                                 .get_temp = tegra_skin_get_temp,
649                                 .coeffs = {
650                                         -11, -7, -5, -3,
651                                         -3, -2, -1, 0,
652                                         0, 0, 1, 1,
653                                         1, 2, 2, 3,
654                                         4, 6, 11, 18
655                                 },
656                         },
657         },
658         .trip_temp = 43000,
659         .passive_delay = 5000,
660 };
661
662 static struct balanced_throttle skin_throttle = {
663         .throt_tab_size = 19,
664         .throt_tab = {
665                 {      0, 1000 },
666                 {  51000, 1000 },
667                 { 102000, 1000 },
668                 { 204000, 1000 },
669                 { 252000, 1000 },
670                 { 288000, 1000 },
671                 { 372000, 1000 },
672                 { 468000, 1000 },
673                 { 510000, 1000 },
674                 { 612000, 1000 },
675                 { 714000, 1050 },
676                 { 816000, 1050 },
677                 { 918000, 1050 },
678                 {1020000, 1100 },
679                 {1122000, 1100 },
680                 {1224000, 1100 },
681                 {1326000, 1100 },
682                 {1428000, 1100 },
683                 {1530000, 1100 },
684         },
685 };
686
687 static int __init dalmore_skin_init(void)
688 {
689         if (machine_is_dalmore()) {
690                 balanced_throttle_register(&skin_throttle, "skin-balanced");
691                 tegra_skin_therm_est_device.dev.platform_data = &skin_data;
692                 platform_device_register(&tegra_skin_therm_est_device);
693         }
694
695         return 0;
696 }
697 late_initcall(dalmore_skin_init);
698 #endif
699
700 int __init dalmore_sensors_init(void)
701 {
702         int err;
703
704         tegra_get_board_info(&board_info);
705
706         err = dalmore_nct1008_init();
707         if (err)
708                 return err;
709
710         dalmore_camera_init();
711         mpuirq_init();
712
713         i2c_register_board_info(0, dalmore_i2c_board_info_cm3218,
714                 ARRAY_SIZE(dalmore_i2c_board_info_cm3218));
715
716         i2c_register_board_info(0, bq20z45_pdata,
717                 ARRAY_SIZE(bq20z45_pdata));
718
719         return 0;
720 }