[PATCH 2/3] watchdog: add designware driver

Sascha Hauer s.hauer at pengutronix.de
Sun Sep 25 23:01:44 PDT 2016


On Thu, Sep 22, 2016 at 02:33:47PM +0200, Steffen Trumtrar wrote:
> Port the linux v4.8-rc1 Synopsys DesignWare watchdog driver to barebox.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
> ---
>  drivers/watchdog/Kconfig  |   6 ++
>  drivers/watchdog/Makefile |   1 +
>  drivers/watchdog/dw_wdt.c | 194 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 201 insertions(+)
>  create mode 100644 drivers/watchdog/dw_wdt.c
> 
> +	struct dw_wdt *dw_wdt = to_dw_wdt(wdd);
> +
> +	writel(WDOG_CONTROL_REG_WDT_EN_MASK,
> +	       dw_wdt->regs + WDOG_CONTROL_REG_OFFSET);
> +
> +	return 0;
> +}
> +
> +static int dw_wdt_stop(struct watchdog *wdd)
> +{
> +	struct dw_wdt *dw_wdt = to_dw_wdt(wdd);
> +
> +	if (IS_ERR(dw_wdt->rst)) {
> +		pr_warn("No reset line. Will not stop.\n");

dev_warn

> +		return PTR_ERR(dw_wdt->rst);
> +	}
> +
> +	reset_control_assert(dw_wdt->rst);
> +	reset_control_deassert(dw_wdt->rst);
> +
> +	return 0;
> +}

...

> +
> +	ret = restart_handler_register(&dw_wdt->restart);
> +	if (ret)
> +		pr_warn("cannot register restart handler\n");

ditto

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list