power: rk818-battery: dump hotdie status

Change-Id: I9de0410b2e3e436801ee27ae59c984df58cc4bc8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen
2017-08-14 15:46:39 +08:00
committed by Huang, Tao
parent a85656d090
commit 2ea6f7bb7a
2 changed files with 9 additions and 5 deletions

View File

@@ -1917,7 +1917,7 @@ static void rk818_bat_debug_info(struct rk818_battery *di)
"Dsoc=%d, Rsoc=%d, Vavg=%d, Iavg=%d, Cap=%d, Fcc=%d, d=%d\n"
"K=%d, Mode=%s, Oldcap=%d, Is=%d, Ip=%d, Vs=%d\n"
"fb_temp=%d, bat_temp=%d, sample_res=%d, USB=%d, DC=%d\n"
"off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, fb=%d\n"
"off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, fb=%d, hot=%d\n"
"adp:finish=%lu, boot_min=%lu, sleep_min=%lu, adc=%d, Vsys=%d\n"
"bat:%s, meet: soc=%d, calc: dsoc=%d, rsoc=%d, Vocv=%d\n"
"pwr: dsoc=%d, rsoc=%d, vol=%d, halt: st=%d, cnt=%d, reboot=%d\n"
@@ -1934,7 +1934,8 @@ static void rk818_bat_debug_info(struct rk818_battery *di)
di->pdata->sample_res, di->usb_in, di->ac_in,
rk818_bat_get_ioffset(di),
rk818_bat_get_coffset(di), di->poffset, di->bat_res,
di->age_adjust_cap, di->fb_blank, base2min(di->finish_base),
di->age_adjust_cap, di->fb_blank, !!(thermal & HOTDIE_STS),
base2min(di->finish_base),
base2min(di->boot_base), di->sleep_sum_sec / 60,
di->adc_allow_update,
di->voltage_avg + di->current_avg * DEF_PWRPATH_RES / 1000,
@@ -2467,7 +2468,7 @@ static int rk818_bat_sleep_dischrg(struct rk818_battery *di)
static void rk818_bat_power_supply_changed(struct rk818_battery *di)
{
u8 status;
u8 status, thermal;
static int old_soc = -1;
if (di->dsoc > 100)
@@ -2478,15 +2479,17 @@ static void rk818_bat_power_supply_changed(struct rk818_battery *di)
if (di->dsoc == old_soc)
return;
thermal = rk818_bat_read(di, RK818_THERMAL_REG);
status = rk818_bat_read(di, RK818_SUP_STS_REG);
status = (status & CHRG_STATUS_MSK) >> 4;
old_soc = di->dsoc;
di->last_dsoc = di->dsoc;
power_supply_changed(di->bat);
BAT_INFO("changed: dsoc=%d, rsoc=%d, v=%d, ov=%d c=%d, "
"cap=%d, f=%d, st=%s\n",
"cap=%d, f=%d, st=%s, hotdie=%d\n",
di->dsoc, di->rsoc, di->voltage_avg, di->voltage_ocv,
di->current_avg, di->remain_cap, di->fcc, bat_status[status]);
di->current_avg, di->remain_cap, di->fcc, bat_status[status],
!!(thermal & HOTDIE_STS));
BAT_INFO("dl=%d, rl=%d, v=%d, halt=%d, halt_n=%d, max=%d, "
"init=%d, sw=%d, calib=%d, below0=%d, force=%d\n",

View File

@@ -82,6 +82,7 @@
/* RK818_THERMAL_REG */
#define FB_TEMP_MSK 0x0c
#define HOTDIE_STS BIT(1)
/* RK818_INT_STS_MSK_REG1 */
#define VB_LOW_INT_EN BIT(1)