power: charge_animation: skip charge if charger offline
Change-Id: I66bd36fc4d3cd4a2f79cd5eb425f857fc8a577cb Signed-off-by: shengfei Xu <xsf@rock-chips.com>
This commit is contained in:
parent
dc8812a0ee
commit
616056c90c
|
|
@ -269,6 +269,11 @@ static int charge_animation_show(struct udevice *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Not charger online, exit */
|
||||
charging = fuel_gauge_get_chrg_online(fg);
|
||||
if (charging <= 0)
|
||||
return 0;
|
||||
|
||||
/* Enter android charge, set property for kernel */
|
||||
if (pdata->android_charge) {
|
||||
env_update("bootargs", "androidboot.mode=charger");
|
||||
|
|
@ -279,11 +284,6 @@ static int charge_animation_show(struct udevice *dev)
|
|||
if (!pdata->uboot_charge)
|
||||
return 0;
|
||||
|
||||
/* Not charger online, exit */
|
||||
charging = fuel_gauge_get_chrg_online(fg);
|
||||
if (charging <= 0)
|
||||
return 0;
|
||||
|
||||
voltage = fuel_gauge_get_voltage(fg);
|
||||
if (voltage < 0) {
|
||||
printf("get voltage failed: %d\n", voltage);
|
||||
|
|
|
|||
Loading…
Reference in New Issue