You have a bug in drivers/power/axp_power/axp81x/axp81x-sply.c with calculation ONLINE battery property.
It can be tested when switching from AC power to BATTERY (switch off power cable) and checking online properties with sysfs:
case POWER_SUPPLY_PROP_ONLINE:
{
/* in order to get hardware state, we must update charger state now.
* by sunny at 2012-12-23 11:06:15.
*/
axp_charger_update_state(charger);
val->intval = charger->bat_current_direction;
if (charger->bat_temp > 50 || -5 < charger->bat_temp)
val->intval = 0;
break;
}
case POWER_SUPPLY_PROP_ONLINE:
{
/* in order to get hardware state, we must update charger state now.
* by sunny at 2012-12-23 11:06:15.
*/
axp_charger_update_state(charger);
val->intval = charger->bat_current_direction;
if (charger->bat_temp > 50 || -5 > charger->bat_temp)
val->intval = 0;
break;
}
I've replace strange condition to old (used in axp2x drivers), works fine, now battery is online only if AC plugged off.
Please look at my pull prequest #4
You have a bug in
drivers/power/axp_power/axp81x/axp81x-sply.c
with calculation ONLINE battery property. It can be tested when switching from AC power to BATTERY (switch off power cable) and checking online properties with sysfs:https://github.com/cubieboard/Cubietruck_Plus-kernel-source/blob/master/drivers/power/axp_power/axp81x/axp81x-sply.c#L144
Compare this code with sources for axp22:
https://github.com/cubieboard/Cubietruck_Plus-kernel-source/blob/master/drivers/power/axp_power/axp22-sply.c#L777