The Following User Says Thank You to marmistrz For This Useful Post: | ||
|
2015-06-06
, 03:34
|
|
Posts: 694 |
Thanked: 619 times |
Joined on Nov 2011
|
#72
|
The Following User Says Thank You to Akkumaru For This Useful Post: | ||
|
2021-08-24
, 07:15
|
Posts: 61 |
Thanked: 83 times |
Joined on Feb 2010
@ Estonia
|
#73
|
--- kernel-power.bak/debian/patches/bq27x00-fix-nac.diff 2021-08-19 14:18:10.000000000 +0300 +++ kernel-power-2.6.28/debian/patches/bq27x00-fix-nac.diff 2021-08-19 16:18:07.299138619 +0300 @@ -10,7 +10,7 @@ + bool is_bq27500 = di->chip == BQ27500; + + flags = bq27x00_read(di, BQ27x00_REG_FLAGS, !is_bq27500); -+ if (flags >= 0 && !is_bq27500 && (flags & BQ27000_FLAG_CI)) ++ if (0 && flags >= 0 && !is_bq27500 && (flags & BQ27000_FLAG_CI)) + return -ENODATA; + return bq27x00_battery_read_charge(di, BQ27x00_REG_NAC); --- kernel-power.bak/debian/patches/bq27x00-upstream.diff 2021-08-19 14:18:10.000000000 +0300 +++ kernel-power-2.6.28/debian/patches/bq27x00-upstream.diff 2021-08-24 08:13:24.560397092 +0300 @@ -38,7 +38,7 @@ +#include <linux/power/bq27x00_battery.h> -#define DRIVER_VERSION "1.0.0" -+#define DRIVER_VERSION "1.2.0" ++#define DRIVER_VERSION "1.2.0x" #define BQ27x00_REG_TEMP 0x06 #define BQ27x00_REG_VOLT 0x08 @@ -362,9 +362,14 @@ + + cache.flags = bq27x00_read(di, BQ27x00_REG_FLAGS, is_bq27500); + if (cache.flags >= 0) { -+ if (!is_bq27500 && (cache.flags & BQ27000_FLAG_CI)) { ++ /* We only have to read charge design full once */ ++ if (di->charge_design_full <= 0) ++ di->charge_design_full = bq27x00_battery_read_ilmd(di); ++ cache.charge_full = bq27x00_battery_read_lmd(di); ++ ++ if (!is_bq27500 && ((cache.flags & BQ27000_FLAG_CI) || 1) && cache.charge_full==di->charge_design_full) { + dev_info(di->dev, "battery is not calibrated! ignoring capacity values\n"); -+ cache.capacity = -ENODATA; ++ cache.capacity = -ENODATA; // or BL-5J default 1320mAh ? + cache.energy = -ENODATA; + cache.time_to_empty = -ENODATA; + cache.time_to_empty_avg = -ENODATA; @@ -376,14 +381,9 @@ + cache.time_to_empty = bq27x00_battery_read_time(di, BQ27x00_REG_TTE); + cache.time_to_empty_avg = bq27x00_battery_read_time(di, BQ27x00_REG_TTECP); + cache.time_to_full = bq27x00_battery_read_time(di, BQ27x00_REG_TTF); -+ cache.charge_full = bq27x00_battery_read_lmd(di); + } + cache.temperature = bq27x00_battery_read_temperature(di); + cache.cycle_count = bq27x00_battery_read_cyct(di); -+ -+ /* We only have to read charge design full once */ -+ if (di->charge_design_full <= 0) -+ di->charge_design_full = bq27x00_battery_read_ilmd(di); }
Tags |
bme-replacement |
Thread Tools | |
|
If you want to support my work, you can donate by PayPal or Flattr
Projects no longer actively developed: here