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)
committerNick Xie <nick@khadas.com>
Mon, 5 Aug 2019 05:59:24 +0000 (13:59 +0800)
commit872a4090370d196d4a06f8debebeacd282095f32
tree51eea36136045f187d26d23fc7f1b065991d0b9c
parent3c14d4947bfd2e7cc26b5cd84cc33eb1c27621cb
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