Changeset 25433


Ignore:
Timestamp:
2011-02-09T21:09:49+01:00 (5 years ago)
Author:
mb
Message:

n810bm: Set minimum voltage threshold to 3200

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/omap24xx/patches-2.6.37/900-n810-battery-management.patch

    r25429 r25433  
    4242=================================================================== 
    4343--- /dev/null   1970-01-01 00:00:00.000000000 +0000 
    44 +++ linux-2.6.37/drivers/cbus/n810bm_main.c     2011-02-09 13:47:23.831144291 +0100 
    45 @@ -0,0 +1,1169 @@ 
     44+++ linux-2.6.37/drivers/cbus/n810bm_main.c     2011-02-09 19:05:18.435536304 +0100 
     45@@ -0,0 +1,1168 @@ 
    4646+/* 
    4747+ *   Nokia n810 battery management 
     
    8787+ 
    8888+#define N810BM_CHECK_INTERVAL          (HZ * 2) 
    89 +#define N810BM_MIN_VOLTAGE_THRES       3300 /* Absolute minimum voltage threshold */ 
     89+#define N810BM_MIN_VOLTAGE_THRES       3200 /* Absolute minimum voltage threshold */ 
    9090+ 
    9191+ 
     
    613613+       u16 status; 
    614614+       bool battery_was_present, charger_was_present; 
    615 +       bool force_charge = 0; 
    616615+       int mv; 
    617616+ 
     
    647646+       } 
    648647+ 
    649 +       if (bm->battery_present && !lipocharge_is_charging(&bm->charger)) { 
     648+       if ((bm->battery_present && !bm->charger_present) || 
     649+           !n810bm_known_battery_present(bm)){ 
    650650+               /* We're draining the battery */ 
    651651+               mv = n810bm_measure_batt_voltage(bm); 
    652 +               if (mv < 0) 
    653 +                       n810bm_emergency(bm, "check timer: Failed to measure"); 
    654 +               if (!bm->charger_present) { 
    655 +                       if (mv < N810BM_MIN_VOLTAGE_THRES) { 
    656 +                               n810bm_emergency(bm, "check timer: " 
    657 +                                       "Minimum voltage threshold reached"); 
    658 +                       } 
    659 +                       force_charge = 1; 
     652+               if (mv < 0) { 
     653+                       n810bm_emergency(bm, 
     654+                               "check: Failed to measure voltage"); 
     655+               } 
     656+               if (mv < N810BM_MIN_VOLTAGE_THRES) { 
     657+                       n810bm_emergency(bm, 
     658+                               "check: Minimum voltage threshold reached"); 
    660659+               } 
    661660+       } 
     
    663662+       if (bm->charger_present && n810bm_known_battery_present(bm)) { 
    664663+               /* Known battery and charger are connected */ 
    665 +               if (bm->charger_enabled || force_charge) { 
     664+               if (bm->charger_enabled) { 
    666665+                       /* Charger is enabled */ 
    667666+                       if (!lipocharge_is_charging(&bm->charger)) { 
Note: See TracChangeset for help on using the changeset viewer.