watchdog: imx: Support set timeout by wdt command
authorMo, Yuezhang <Yuezhang.Mo@sony.com>
Wed, 1 Jul 2020 09:15:28 +0000 (09:15 +0000)
committerStefano Babic <sbabic@denx.de>
Thu, 16 Jul 2020 09:20:21 +0000 (11:20 +0200)
commitee6866e6c773341ad4058d46ff898ad258db1292
tree0a64b5b4e3c279486ce0ecdaf2da8877670be1c7
parenteefd93e7f88ec919cc335dbf934320fec949bce6
watchdog: imx: Support set timeout by wdt command

After "4b969deac0 watchdog: imx: Add DM support", the imx watchdog
can be started by wdt command. But the imx watchdog driver only
support start with the default timeout.

This commit adds the support for setting the timeout which pass from
the wdt command into the imx watchdog. If the timeout out of the
valid range(0.5~128s), start the watchdog with a timeout within the
valid range and the timeout is the one which closest to the passed
timeout.

Signed-off-by: Yuezhang.Mo <yuezhang.mo@sony.com>
Reviewed-by: Andy.Wu <Andy.Wu@sony.com>
Reviewed-by: stefano Babic <sbabic@denx.de>
drivers/watchdog/imx_watchdog.c