power: bms: split battery data for different battery
Use different files for different battery profiles. This makes updating
the profiles easy as more data is collected.
Change-Id: Iafa369f4629f4e797ea55f6f81df08c54b57ad1d
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 7bc2fdd..e93993c 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -257,7 +257,7 @@
obj-$(CONFIG_MACH_MSM8930_CDP) += board-8930-all.o board-8930-regulator.o
obj-$(CONFIG_MACH_MSM8930_MTP) += board-8930-all.o board-8930-regulator.o
obj-$(CONFIG_MACH_MSM8930_FLUID) += board-8930-all.o board-8930-regulator.o
-obj-$(CONFIG_ARCH_MSM8960) += bms-batterydata.o
+obj-$(CONFIG_PM8921_BMS) += bms-batterydata.o bms-batterydata-desay.o
obj-$(CONFIG_MACH_APQ8064_SIM) += board-8064-all.o board-8064-regulator.o
obj-$(CONFIG_MACH_APQ8064_RUMI3) += board-8064-all.o board-8064-regulator.o
obj-$(CONFIG_ARCH_MSM9615) += board-9615.o devices-9615.o board-9615-regulator.o board-9615-gpiomux.o board-9615-storage.o
diff --git a/arch/arm/mach-msm/bms-batterydata-desay.c b/arch/arm/mach-msm/bms-batterydata-desay.c
new file mode 100644
index 0000000..5488a2f
--- /dev/null
+++ b/arch/arm/mach-msm/bms-batterydata-desay.c
@@ -0,0 +1,84 @@
+/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <linux/mfd/pm8xxx/pm8921-bms.h>
+
+static struct single_row_lut desay_5200_fcc_temp = {
+ .x = {-20, 0, 25, 40},
+ .y = {5690, 5722, 5722, 5727},
+ .cols = 4
+};
+
+static struct single_row_lut desay_5200_fcc_sf = {
+ .x = {0},
+ .y = {100},
+ .cols = 1
+};
+
+static struct pc_temp_ocv_lut desay_5200_pc_temp_ocv = {
+ .rows = 29,
+ .cols = 4,
+ .temp = {-20, 0, 25, 40},
+ .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55,
+ 50, 45, 40, 35, 30, 25, 20, 15, 10, 9, 8,
+ 7, 6, 5, 4, 3, 2, 1, 0
+ },
+ .ocv = {
+ {4185, 4184, 4181, 4178},
+ {4103, 4117, 4120, 4119},
+ {4044, 4067, 4074, 4073},
+ {3987, 4019, 4031, 4030},
+ {3941, 3974, 3992, 3992},
+ {3902, 3936, 3958, 3957},
+ {3866, 3901, 3926, 3926},
+ {3835, 3870, 3891, 3896},
+ {3811, 3842, 3855, 3858},
+ {3792, 3818, 3827, 3827},
+ {3776, 3795, 3806, 3806},
+ {3762, 3778, 3789, 3790},
+ {3748, 3765, 3777, 3777},
+ {3735, 3752, 3767, 3765},
+ {3720, 3739, 3756, 3754},
+ {3704, 3726, 3743, 3736},
+ {3685, 3712, 3723, 3716},
+ {3664, 3697, 3695, 3689},
+ {3623, 3672, 3669, 3664},
+ {3611, 3666, 3666, 3661},
+ {3597, 3659, 3662, 3658},
+ {3579, 3648, 3657, 3653},
+ {3559, 3630, 3644, 3639},
+ {3532, 3600, 3612, 3606},
+ {3497, 3558, 3565, 3559},
+ {3450, 3500, 3504, 3498},
+ {3380, 3417, 3421, 3416},
+ {3265, 3287, 3296, 3293},
+ {3000, 3000, 3000, 3000}
+ },
+};
+
+static struct pc_sf_lut desay_5200_pc_sf = {
+ .rows = 1,
+ .cols = 1,
+ .cycles = {0},
+ .percent = {100},
+ .sf = {
+ {100}
+ },
+};
+
+struct pm8921_bms_battery_data desay_5200_data = {
+ .fcc = 5200,
+ .fcc_temp_lut = &desay_5200_fcc_temp,
+ .fcc_sf_lut = &desay_5200_fcc_sf,
+ .pc_temp_ocv_lut = &desay_5200_pc_temp_ocv,
+ .pc_sf_lut = &desay_5200_pc_sf,
+};
diff --git a/arch/arm/mach-msm/bms-batterydata.c b/arch/arm/mach-msm/bms-batterydata.c
index ea2a9f6..e71e350 100644
--- a/arch/arm/mach-msm/bms-batterydata.c
+++ b/arch/arm/mach-msm/bms-batterydata.c
@@ -91,74 +91,3 @@
.pc_temp_ocv_lut = &palladium_1500_pc_temp_ocv,
.pc_sf_lut = &palladium_1500_pc_sf,
};
-
-static struct single_row_lut desay_5200_fcc_temp = {
- .x = {-20, 0, 25, 40},
- .y = {5690, 5722, 5722, 5727},
- .cols = 4
-};
-
-static struct single_row_lut desay_5200_fcc_sf = {
- .x = {0},
- .y = {100},
- .cols = 1
-};
-
-static struct pc_temp_ocv_lut desay_5200_pc_temp_ocv = {
- .rows = 29,
- .cols = 4,
- .temp = {-20, 0, 25, 40},
- .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55,
- 50, 45, 40, 35, 30, 25, 20, 15, 10, 9, 8,
- 7, 6, 5, 4, 3, 2, 1, 0
- },
- .ocv = {
- {4185, 4184, 4181, 4178},
- {4103, 4117, 4120, 4119},
- {4044, 4067, 4074, 4073},
- {3987, 4019, 4031, 4030},
- {3941, 3974, 3992, 3992},
- {3902, 3936, 3958, 3957},
- {3866, 3901, 3926, 3926},
- {3835, 3870, 3891, 3896},
- {3811, 3842, 3855, 3858},
- {3792, 3818, 3827, 3827},
- {3776, 3795, 3806, 3806},
- {3762, 3778, 3789, 3790},
- {3748, 3765, 3777, 3777},
- {3735, 3752, 3767, 3765},
- {3720, 3739, 3756, 3754},
- {3704, 3726, 3743, 3736},
- {3685, 3712, 3723, 3716},
- {3664, 3697, 3695, 3689},
- {3623, 3672, 3669, 3664},
- {3611, 3666, 3666, 3661},
- {3597, 3659, 3662, 3658},
- {3579, 3648, 3657, 3653},
- {3559, 3630, 3644, 3639},
- {3532, 3600, 3612, 3606},
- {3497, 3558, 3565, 3559},
- {3450, 3500, 3504, 3498},
- {3380, 3417, 3421, 3416},
- {3265, 3287, 3296, 3293},
- {3000, 3000, 3000, 3000}
- },
-};
-
-static struct pc_sf_lut desay_5200_pc_sf = {
- .rows = 1,
- .cols = 1,
- .cycles = {0},
- .percent = {100},
- .sf = {
- {100}
- },
-};
-
-struct pm8921_bms_battery_data desay_5200_data = {
- .fcc = 5200,
- .fcc_temp_lut = &desay_5200_fcc_temp,
- .fcc_sf_lut = &desay_5200_fcc_sf,
- .pc_temp_ocv_lut = &desay_5200_pc_temp_ocv,
- .pc_sf_lut = &desay_5200_pc_sf,
-};