]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Triton BCI driver board/device setup for OMAP3430
authorMadhusudhan Chikkature <madhu.cr@ti.com>
Tue, 22 Jul 2008 11:55:33 +0000 (17:25 +0530)
committerTony Lindgren <tony@atomide.com>
Tue, 5 Aug 2008 13:32:56 +0000 (16:32 +0300)
Device setup/board level initialization for the Triton battery charger
interface driver for the OMAP3430 SDP.

Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/bci.c [new file with mode: 0644]
arch/arm/mach-omap2/board-3430sdp.c
include/asm-arm/arch-omap/bci.h [new file with mode: 0644]
include/asm-arm/arch-omap/board-3430sdp.h

index 3d1b05a870c5a3f4178c4327d2037ccdf27e39b7..10dc68f30688d2e7212c087841818c223466b236 100644 (file)
@@ -54,7 +54,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP)               += board-3430sdp.o \
                                           hsmmc.o \
                                           usb-musb.o \
                                           usb-ehci.o \
-                                          board-3430sdp-flash.o
+                                          board-3430sdp-flash.o \
+                                          bci.o
 obj-$(CONFIG_MACH_OMAP3EVM)            += board-omap3evm.o \
                                           hsmmc.o \
                                           usb-musb.o usb-ehci.o \
diff --git a/arch/arm/mach-omap2/bci.c b/arch/arm/mach-omap2/bci.c
new file mode 100644 (file)
index 0000000..2bd71d5
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * linux/arch/arm/mach-omap2/bci.c
+ *
+ * TWL4030 BCI platform device setup/initialization
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/arch/bci.h>
+
+#if defined(CONFIG_TWL4030_BCI_BATTERY) || \
+       defined(CONFIG_TWL4030_BCI_BATTERY_MODULE)
+/*
+ * Thermistor Calibration for Current Source and MADC
+ * Tolerance (for THS05-3H103F)
+ */
+static int sdp3430_batt_table[] = {
+/* 0 C*/
+30800, 29500, 28300, 27100,
+26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
+17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
+11600, 11200, 10800, 10400, 10000, 9630,   9280,   8950,   8620,   8310,
+8020,   7730,   7460,   7200,   6950,   6710,   6470,   6250,   6040,   5830,
+5640,   5450,   5260,   5090,   4920,   4760,   4600,   4450,   4310,   4170,
+4040,   3910,   3790,   3670,   3550
+};
+
+static struct twl4030_bci_platform_data sdp3430_bci_data = {
+      .battery_tmp_tbl = sdp3430_batt_table,
+      .tblsize = ARRAY_SIZE(sdp3430_batt_table),
+};
+
+static struct platform_device twl4030_bci_battery_device = {
+       .name           = "twl4030-bci-battery",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &sdp3430_bci_data,
+       },
+       .num_resources  = 0,
+};
+
+void __init twl4030_bci_battery_init(void)
+{
+       (void) platform_device_register(&twl4030_bci_battery_device);
+}
+#else
+void __init twl4030_bci_battery_init(void)
+{
+}
+#endif
index 9c57075b936f864a67ffa7f94972f4823f0e4897..ee4ec18f375b1e2273e3e8cc3219052fa368a0dc 100644 (file)
@@ -365,6 +365,7 @@ static void __init omap_3430sdp_init(void)
                                ARRAY_SIZE(sdp3430_spi_board_info));
        ads7846_dev_init();
        sdp3430_flash_init();
+       twl4030_bci_battery_init();
        omap_serial_init();
        usb_musb_init();
        usb_ehci_init();
diff --git a/include/asm-arm/arch-omap/bci.h b/include/asm-arm/arch-omap/bci.h
new file mode 100644 (file)
index 0000000..51eb8a5
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ *  linux/include/asm-arm/arch-omap/bci.h
+ *
+ *  Copyright (C) 2008 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef ASMARM_ARCH_BCI_H
+#define ASMARM_ARCH_BCI_H
+struct twl4030_bci_platform_data {
+       int *battery_tmp_tbl;
+       unsigned int tblsize;
+};
+#endif
+
index d583008ad53b14d02a3c7e1ffa9b1802ad7f2194..60d915b3725293f82c9ca0f09edef4a90035a4bb 100644 (file)
@@ -31,6 +31,7 @@
 
 extern void sdp3430_usb_init(void);
 extern void sdp3430_flash_init(void);
+extern void twl4030_bci_battery_init(void);
 
 #define DEBUG_BASE                     0x08000000  /* debug board */