[U-Boot] [RFC PATCH] pcf2127: add watchdog support

Tom Rini trini at konsulko.com
Mon Dec 26 14:53:46 CET 2016


On Thu, Dec 15, 2016 at 07:38:03AM +0100, Sean Nyekjaer wrote:
> Signed-off-by: Sean Nyekjaer <sean.nyekjaer at prevas.dk>
> ---
> - I have just noticed that the RTC driver for this device have been merged,
>   should the watchdog part be included in the rtc driver or standalone?
> - The hw_watchdog_reset is called far too often the device here is on i2c,
>   with what i have done the reset is written every 1s
> - What should be the default delay? I have chosen 20?
> 
>  drivers/watchdog/Kconfig       | 11 +++++++
>  drivers/watchdog/Makefile      |  1 +
>  drivers/watchdog/pcf2127_wdt.c | 69 ++++++++++++++++++++++++++++++++++++++++++
>  include/pcf2127_wdt.h          |  3 ++
>  4 files changed, 84 insertions(+)
>  create mode 100644 drivers/watchdog/pcf2127_wdt.c
>  create mode 100644 include/pcf2127_wdt.h
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index e69de29bb2..957f2f3a87 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -0,0 +1,11 @@
> +#
> +# Watchdog drivers configuration
> +#
> +
> +menu "Watchdog"
> +
> +config PCF2127_WATCHDOG
> +	depends on DM_I2C
> +	bool "Enable pcf2127 i2c watchdog"
> +
> +endmenu
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index a007ae8234..3c573de016 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -15,3 +15,4 @@ obj-$(CONFIG_XILINX_TB_WATCHDOG) += xilinx_tb_wdt.o
>  obj-$(CONFIG_BFIN_WATCHDOG)  += bfin_wdt.o
>  obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
>  obj-$(CONFIG_DESIGNWARE_WATCHDOG) += designware_wdt.o
> +obj-$(CONFIG_PCF2127_WATCHDOG) += pcf2127_wdt.o
> diff --git a/drivers/watchdog/pcf2127_wdt.c b/drivers/watchdog/pcf2127_wdt.c
> new file mode 100644
> index 0000000000..f9276e3ea5
> --- /dev/null
> +++ b/drivers/watchdog/pcf2127_wdt.c
> @@ -0,0 +1,69 @@
> +#include <common.h>

Please see all of the other c files in the code for the kind of license
header you need to add here (and in the .h file).

> +void hw_watchdog_reset(void)
> +{
> +	if(wdt_active == true) {

It should be 'if (wdt_active == true)', please run checkpatch.pl and fix
whatever it points out.

Finally, please also enable this driver on sandbox so that it's built
somewhere, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161226/f16caa44/attachment.sig>


More information about the U-Boot mailing list