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