diff options
author | Aseda Aboagye <aaboagye@google.com> | 2020-08-05 10:02:16 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-08 00:51:42 +0000 |
commit | 8a1da8267ac0e58b00ef05e835aa82a92d243f65 (patch) | |
tree | a091f42537843c266302a2f0fd8d5e5af4ec875b /driver/charger | |
parent | 454b5f685849003b3dea31d36f9e821e6c54ce26 (diff) | |
download | chrome-ec-8a1da8267ac0e58b00ef05e835aa82a92d243f65.tar.gz |
sm5803: Pet watchdog during charger_dump
There are a lot of registers to print, so make sure that we pet the
watchdog periodically.
BUG=None
BRANCH=None
TEST=Build and flash waddledee, verify that Pre-WDT warnings are no
longer seen when issuing the `charger_dump` command.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I07bc9f492fc6d4f2bab0876d983c077350b91cab
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2339844
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/charger')
-rw-r--r-- | driver/charger/sm5803.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/driver/charger/sm5803.c b/driver/charger/sm5803.c index 5a6597a9ba..4c18218710 100644 --- a/driver/charger/sm5803.c +++ b/driver/charger/sm5803.c @@ -17,6 +17,7 @@ #include "usb_charge.h" #include "usb_pd.h" #include "util.h" +#include "watchdog.h" #ifndef CONFIG_CHARGER_NARROW_VDC #error "SM5803 is a NVDC charger, please enable CONFIG_CHARGER_NARROW_VDC." @@ -863,8 +864,10 @@ static int command_sm5803_dump(int argc, char **argv) for (reg = 0x01; reg <= 0xED; reg++) { if (!meas_read8(chgnum, reg, ®val)) ccprintf("[0x%02X] = 0x%02x\n", reg, regval); - if (reg & 0xf) + if (reg & 0xf) { cflush(); /* Flush periodically */ + watchdog_reload(); + } } /* Dump Charger regs from 0x1C to 0x7F */ @@ -872,8 +875,10 @@ static int command_sm5803_dump(int argc, char **argv) for (reg = 0x1C; reg <= 0x7F; reg++) { if (!chg_read8(chgnum, reg, ®val)) ccprintf("[0x%02X] = 0x%02x\n", reg, regval); - if (reg & 0xf) + if (reg & 0xf) { cflush(); /* Flush periodically */ + watchdog_reload(); + } } return EC_SUCCESS; |