power: charge animation: add debug message
Change-Id: Ib96ab67e9e2657385f19c9e2ab2ed518da0ad2f8 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
eeb3338caa
commit
cf49f6adf1
|
|
@ -331,7 +331,7 @@ static int charge_animation_show(struct udevice *dev)
|
||||||
|
|
||||||
/* If there is preboot command, exit */
|
/* If there is preboot command, exit */
|
||||||
if (preboot) {
|
if (preboot) {
|
||||||
debug("preboot: %s\n", preboot);
|
debug("exit charge, due to preboot: %s\n", preboot);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -347,8 +347,10 @@ static int charge_animation_show(struct udevice *dev)
|
||||||
|
|
||||||
/* Not charger online, exit */
|
/* Not charger online, exit */
|
||||||
charging = fuel_gauge_get_chrg_online(fg);
|
charging = fuel_gauge_get_chrg_online(fg);
|
||||||
if (charging <= 0)
|
if (charging <= 0) {
|
||||||
|
debug("exit charge, due to charger offline\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Enter android charge, set property for kernel */
|
/* Enter android charge, set property for kernel */
|
||||||
if (pdata->android_charge) {
|
if (pdata->android_charge) {
|
||||||
|
|
@ -357,8 +359,10 @@ static int charge_animation_show(struct udevice *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not enable U-Boot charge, exit */
|
/* Not enable U-Boot charge, exit */
|
||||||
if (!pdata->uboot_charge)
|
if (!pdata->uboot_charge) {
|
||||||
|
debug("exit charge, due to not enable uboot charge\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
voltage = fuel_gauge_get_voltage(fg);
|
voltage = fuel_gauge_get_voltage(fg);
|
||||||
if (voltage < 0) {
|
if (voltage < 0) {
|
||||||
|
|
@ -616,7 +620,10 @@ static int charge_animation_probe(struct udevice *dev)
|
||||||
/* Get PMIC: used for power off system */
|
/* Get PMIC: used for power off system */
|
||||||
ret = uclass_get_device(UCLASS_PMIC, 0, &pmic);
|
ret = uclass_get_device(UCLASS_PMIC, 0, &pmic);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("Get UCLASS PMIC failed: %d\n", ret);
|
if (ret == -ENODEV)
|
||||||
|
printf("Can't find PMIC\n");
|
||||||
|
else
|
||||||
|
printf("Get UCLASS PMIC failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
priv->pmic = pmic;
|
priv->pmic = pmic;
|
||||||
|
|
@ -624,7 +631,10 @@ static int charge_animation_probe(struct udevice *dev)
|
||||||
/* Get fuel gauge: used for charging */
|
/* Get fuel gauge: used for charging */
|
||||||
ret = uclass_get_device(UCLASS_FG, 0, &fg);
|
ret = uclass_get_device(UCLASS_FG, 0, &fg);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printf("Get UCLASS FG failed: %d\n", ret);
|
if (ret == -ENODEV)
|
||||||
|
printf("Can't find FG\n");
|
||||||
|
else
|
||||||
|
printf("Get UCLASS FG failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
priv->fg = fg;
|
priv->fg = fg;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue