]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/bci.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / bci.c
1 /*
2  * linux/arch/arm/mach-omap2/bci.c
3  *
4  * TWL4030 BCI platform device setup/initialization
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 as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  */
11
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <mach/bci.h>
17
18 #if defined(CONFIG_TWL4030_BCI_BATTERY) || \
19         defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
20 /*
21  * Thermistor Calibration for Current Source and MADC
22  * Tolerance (for THS05-3H103F)
23  */
24 static int sdp3430_batt_table[] = {
25 /* 0 C*/
26 30800, 29500, 28300, 27100,
27 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
28 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
29 11600, 11200, 10800, 10400, 10000, 9630,   9280,   8950,   8620,   8310,
30 8020,   7730,   7460,   7200,   6950,   6710,   6470,   6250,   6040,   5830,
31 5640,   5450,   5260,   5090,   4920,   4760,   4600,   4450,   4310,   4170,
32 4040,   3910,   3790,   3670,   3550
33 };
34
35 static struct twl4030_bci_platform_data sdp3430_bci_data = {
36       .battery_tmp_tbl = sdp3430_batt_table,
37       .tblsize = ARRAY_SIZE(sdp3430_batt_table),
38 };
39
40 static struct platform_device twl4030_bci_battery_device = {
41         .name           = "twl4030-bci-battery",
42         .id             = -1,
43         .dev            = {
44                 .platform_data  = &sdp3430_bci_data,
45         },
46         .num_resources  = 0,
47 };
48
49 void __init twl4030_bci_battery_init(void)
50 {
51         (void) platform_device_register(&twl4030_bci_battery_device);
52 }
53 #else
54 void __init twl4030_bci_battery_init(void)
55 {
56 }
57 #endif