summaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authormb <mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-02-09 20:09:49 +0000
committermb <mb@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-02-09 20:09:49 +0000
commitd1654e533991b03b13c5d12a137efe749415ed8f (patch)
tree573fb3bfd3a5e8e2f3a08874114e9c0bd9851ac0 /target/linux
parentc4ee4e8bc8060de6eb56635bf2040308bf1b4b90 (diff)
n810bm: Set minimum voltage threshold to 3200
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25433 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch27
1 files changed, 13 insertions, 14 deletions
diff --git a/target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch b/target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch
index 31eeeb857..e460d3c08 100644
--- a/target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch
+++ b/target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch
@@ -41,8 +41,8 @@ Index: linux-2.6.37/drivers/cbus/Makefile
Index: linux-2.6.37/drivers/cbus/n810bm_main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.37/drivers/cbus/n810bm_main.c 2011-02-09 13:47:23.831144291 +0100
-@@ -0,0 +1,1169 @@
++++ linux-2.6.37/drivers/cbus/n810bm_main.c 2011-02-09 19:05:18.435536304 +0100
+@@ -0,0 +1,1168 @@
+/*
+ * Nokia n810 battery management
+ *
@@ -86,7 +86,7 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+#define N810BM_PMM_BLOCK_SIZE 0x600
+
+#define N810BM_CHECK_INTERVAL (HZ * 2)
-+#define N810BM_MIN_VOLTAGE_THRES 3300 /* Absolute minimum voltage threshold */
++#define N810BM_MIN_VOLTAGE_THRES 3200 /* Absolute minimum voltage threshold */
+
+
+/* RETU_ADC_BSI
@@ -612,7 +612,6 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+ struct n810bm, periodic_check_work);
+ u16 status;
+ bool battery_was_present, charger_was_present;
-+ bool force_charge = 0;
+ int mv;
+
+ mutex_lock(&bm->mutex);
@@ -646,23 +645,23 @@ Index: linux-2.6.37/drivers/cbus/n810bm_main.c
+ bm->charger_present ? "plugged in" : "removed");
+ }
+
-+ if (bm->battery_present && !lipocharge_is_charging(&bm->charger)) {
++ if ((bm->battery_present && !bm->charger_present) ||
++ !n810bm_known_battery_present(bm)){
+ /* We're draining the battery */
+ mv = n810bm_measure_batt_voltage(bm);
-+ if (mv < 0)
-+ n810bm_emergency(bm, "check timer: Failed to measure");
-+ if (!bm->charger_present) {
-+ if (mv < N810BM_MIN_VOLTAGE_THRES) {
-+ n810bm_emergency(bm, "check timer: "
-+ "Minimum voltage threshold reached");
-+ }
-+ force_charge = 1;
++ if (mv < 0) {
++ n810bm_emergency(bm,
++ "check: Failed to measure voltage");
++ }
++ if (mv < N810BM_MIN_VOLTAGE_THRES) {
++ n810bm_emergency(bm,
++ "check: Minimum voltage threshold reached");
+ }
+ }
+
+ if (bm->charger_present && n810bm_known_battery_present(bm)) {
+ /* Known battery and charger are connected */
-+ if (bm->charger_enabled || force_charge) {
++ if (bm->charger_enabled) {
+ /* Charger is enabled */
+ if (!lipocharge_is_charging(&bm->charger)) {
+ //TODO start charging, if battery is below some threshold