watchdog: fix watchdog get lefttime error [1/1]
authorYingyuan Zhu <yingyuan.zhu@amlogic.com>
Wed, 10 Apr 2019 07:26:32 +0000 (15:26 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Sun, 21 Apr 2019 11:49:08 +0000 (04:49 -0700)
commit0e1d9b2b7d3c08b24ec095b624718ac9df8ef80f
treeec1cc9b2da89be53af99569d347a7a14023472ad
parent27b026d8e914394e0e96cea290ea70b00b19b367
watchdog: fix watchdog get lefttime error [1/1]

PD#SWPL-6937

Problem:
1.get lefttime error by 'cat sys/class/watchdog/watchdog0/timeleft' cmd.
2.if DTS is configured to feed watchdog by Android, the system will
restart automatically after wake up.

Solution:
1.modify the code to get time.
2.when the system wakes up, first judge whether the watchdog runs,
and then decide whether to start the watchdog.

Verify:
test pass on u200

Change-Id: If64888ffdd5651e8cfcace5ea0d0da31641bb397
Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
drivers/amlogic/watchdog/meson_wdt.c