From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FC5EC433DB for ; Thu, 21 Jan 2021 14:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 086DD239A4 for ; Thu, 21 Jan 2021 14:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729026AbhAUODF convert rfc822-to-8bit (ORCPT ); Thu, 21 Jan 2021 09:03:05 -0500 Received: from unicorn.mansr.com ([81.2.72.234]:60318 "EHLO unicorn.mansr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730315AbhAUOCH (ORCPT ); Thu, 21 Jan 2021 09:02:07 -0500 Received: from raven.mansr.com (raven.mansr.com [IPv6:2001:8b0:ca0d:8d8e::3]) by unicorn.mansr.com (Postfix) with ESMTPS id ADCB715364; Thu, 21 Jan 2021 14:01:00 +0000 (GMT) Received: by raven.mansr.com (Postfix, from userid 51770) id AADC221A3D9; Thu, 21 Jan 2021 14:01:00 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, Guenter Roeck , Wim Van Sebroeck , Arnd Bergmann , Marc Gonzalez Subject: Re: [PATCH 4/5] watchdog: remove tango driver References: <20210120162745.61268-1-arnd@kernel.org> <20210120162745.61268-5-arnd@kernel.org> Date: Thu, 21 Jan 2021 14:01:00 +0000 In-Reply-To: <20210120162745.61268-5-arnd@kernel.org> (Arnd Bergmann's message of "Wed, 20 Jan 2021 17:27:44 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Arnd Bergmann writes: > From: Arnd Bergmann > > The tango platform is getting removed, so the driver is no > longer needed. > > Cc: Marc Gonzalez > Cc: Mans Rullgard > Signed-off-by: Arnd Bergmann > --- > drivers/watchdog/Kconfig | 11 -- > drivers/watchdog/Makefile | 1 - > drivers/watchdog/tangox_wdt.c | 209 ---------------------------------- > 3 files changed, 221 deletions(-) > delete mode 100644 drivers/watchdog/tangox_wdt.c The DT binding can go as well. Otherwise: Acked-by: Mans Rullgard > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index c36f8233f60b..10efbb351f14 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG > This driver can also be built as a module. If so the module > will be called menz069_wdt. > > -config TANGOX_WATCHDOG > - tristate "Sigma Designs SMP86xx/SMP87xx watchdog" > - select WATCHDOG_CORE > - depends on ARCH_TANGO || COMPILE_TEST > - depends on HAS_IOMEM > - help > - Support for the watchdog in Sigma Designs SMP86xx (tango3) > - and SMP87xx (tango4) family chips. > - > - This driver can be built as a module. The module name is tangox_wdt. > - > config WDAT_WDT > tristate "ACPI Watchdog Action Table (WDAT)" > depends on ACPI > diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile > index 7a95b280cd9f..1ff40d6a027f 100644 > --- a/drivers/watchdog/Makefile > +++ b/drivers/watchdog/Makefile > @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o > obj-$(CONFIG_DA9062_WATCHDOG) += da9062_wdt.o > obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o > obj-$(CONFIG_GPIO_WATCHDOG) += gpio_wdt.o > -obj-$(CONFIG_TANGOX_WATCHDOG) += tangox_wdt.o > obj-$(CONFIG_WDAT_WDT) += wdat_wdt.o > obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o > obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o > diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c > deleted file mode 100644 > index 1afb0e9d808c..000000000000 > --- a/drivers/watchdog/tangox_wdt.c > +++ /dev/null > @@ -1,209 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0+ > -/* > - * Copyright (C) 2015 Mans Rullgard > - * SMP86xx/SMP87xx Watchdog driver > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define DEFAULT_TIMEOUT 30 > - > -static bool nowayout = WATCHDOG_NOWAYOUT; > -module_param(nowayout, bool, 0); > -MODULE_PARM_DESC(nowayout, > - "Watchdog cannot be stopped once started (default=" > - __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); > - > -static unsigned int timeout; > -module_param(timeout, int, 0); > -MODULE_PARM_DESC(timeout, "Watchdog timeout"); > - > -/* > - * Counter counts down from programmed value. Reset asserts when > - * the counter reaches 1. > - */ > -#define WD_COUNTER 0 > - > -#define WD_CONFIG 4 > -#define WD_CONFIG_XTAL_IN BIT(0) > -#define WD_CONFIG_DISABLE BIT(31) > - > -struct tangox_wdt_device { > - struct watchdog_device wdt; > - void __iomem *base; > - unsigned long clk_rate; > - struct clk *clk; > -}; > - > -static int tangox_wdt_set_timeout(struct watchdog_device *wdt, > - unsigned int new_timeout) > -{ > - wdt->timeout = new_timeout; > - > - return 0; > -} > - > -static int tangox_wdt_start(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt); > - u32 ticks; > - > - ticks = 1 + wdt->timeout * dev->clk_rate; > - writel(ticks, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static int tangox_wdt_stop(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt); > - > - writel(0, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt); > - u32 count; > - > - count = readl(dev->base + WD_COUNTER); > - > - if (!count) > - return 0; > - > - return (count - 1) / dev->clk_rate; > -} > - > -static const struct watchdog_info tangox_wdt_info = { > - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, > - .identity = "tangox watchdog", > -}; > - > -static int tangox_wdt_restart(struct watchdog_device *wdt, > - unsigned long action, void *data) > -{ > - struct tangox_wdt_device *dev = watchdog_get_drvdata(wdt); > - > - writel(1, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static const struct watchdog_ops tangox_wdt_ops = { > - .start = tangox_wdt_start, > - .stop = tangox_wdt_stop, > - .set_timeout = tangox_wdt_set_timeout, > - .get_timeleft = tangox_wdt_get_timeleft, > - .restart = tangox_wdt_restart, > -}; > - > -static void tangox_clk_disable_unprepare(void *data) > -{ > - clk_disable_unprepare(data); > -} > - > -static int tangox_wdt_probe(struct platform_device *pdev) > -{ > - struct tangox_wdt_device *dev; > - u32 config; > - int err; > - > - dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); > - if (!dev) > - return -ENOMEM; > - > - dev->base = devm_platform_ioremap_resource(pdev, 0); > - if (IS_ERR(dev->base)) > - return PTR_ERR(dev->base); > - > - dev->clk = devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(dev->clk)) > - return PTR_ERR(dev->clk); > - > - err = clk_prepare_enable(dev->clk); > - if (err) > - return err; > - err = devm_add_action_or_reset(&pdev->dev, > - tangox_clk_disable_unprepare, dev->clk); > - if (err) > - return err; > - > - dev->clk_rate = clk_get_rate(dev->clk); > - if (!dev->clk_rate) > - return -EINVAL; > - > - dev->wdt.parent = &pdev->dev; > - dev->wdt.info = &tangox_wdt_info; > - dev->wdt.ops = &tangox_wdt_ops; > - dev->wdt.timeout = DEFAULT_TIMEOUT; > - dev->wdt.min_timeout = 1; > - dev->wdt.max_hw_heartbeat_ms = (U32_MAX - 1) / dev->clk_rate; > - > - watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev); > - watchdog_set_nowayout(&dev->wdt, nowayout); > - watchdog_set_drvdata(&dev->wdt, dev); > - > - /* > - * Deactivate counter if disable bit is set to avoid > - * accidental reset. > - */ > - config = readl(dev->base + WD_CONFIG); > - if (config & WD_CONFIG_DISABLE) > - writel(0, dev->base + WD_COUNTER); > - > - writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG); > - > - /* > - * Mark as active and restart with configured timeout if > - * already running. > - */ > - if (readl(dev->base + WD_COUNTER)) { > - set_bit(WDOG_HW_RUNNING, &dev->wdt.status); > - tangox_wdt_start(&dev->wdt); > - } > - > - watchdog_set_restart_priority(&dev->wdt, 128); > - > - watchdog_stop_on_unregister(&dev->wdt); > - err = devm_watchdog_register_device(&pdev->dev, &dev->wdt); > - if (err) > - return err; > - > - platform_set_drvdata(pdev, dev); > - > - dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n"); > - > - return 0; > -} > - > -static const struct of_device_id tangox_wdt_dt_ids[] = { > - { .compatible = "sigma,smp8642-wdt" }, > - { .compatible = "sigma,smp8759-wdt" }, > - { } > -}; > -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids); > - > -static struct platform_driver tangox_wdt_driver = { > - .probe = tangox_wdt_probe, > - .driver = { > - .name = "tangox-wdt", > - .of_match_table = tangox_wdt_dt_ids, > - }, > -}; > - > -module_platform_driver(tangox_wdt_driver); > - > -MODULE_AUTHOR("Mans Rullgard "); > -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver"); > -MODULE_LICENSE("GPL"); > -- > > 2.29.2 > -- Måns Rullgård From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4AA2C433E0 for ; Thu, 21 Jan 2021 14:02:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 444A2239A4 for ; Thu, 21 Jan 2021 14:02:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 444A2239A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mansr.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ux8hKPyBXJVnHQIsmdU8al5NBcGD17Un5prGb68M8hw=; b=vgaDOjgQzDFgDAPPOXRZGFPqA OENcGmh/rKV9jbkzMMS7+8pXOkMkd5f1hkMZi6iSJdtEnQmSIAPffieSBRzTuVs8h6GAzdTnVnraq SIQ6YOIhvpxRKPvorRpg+eyca4wAdsYv2e1HzalL0tMkPMr0p4983GUU2KWLiRjBzZ0+Cr9LU/iRo Qcd70cBzLK7ZwIqwszityYKumfUcZYSpSlnl1R6swA9aDJYDWuFecGVW7ba4UZbVsms0AJOMNvnTc Yrv6N+Ma+g3Ba8pq8uj37GBEQctZMgqPDW5MYpkBNQ8rxERMRe5pcKRU/jiHLvts55Z889WsQPVys 7KknLi8Kw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2aWH-0003Oo-9r; Thu, 21 Jan 2021 14:01:05 +0000 Received: from unicorn.mansr.com ([2001:8b0:ca0d:8d8e::2]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2aWD-0003Mr-Ue for linux-arm-kernel@lists.infradead.org; Thu, 21 Jan 2021 14:01:03 +0000 Received: from raven.mansr.com (raven.mansr.com [IPv6:2001:8b0:ca0d:8d8e::3]) by unicorn.mansr.com (Postfix) with ESMTPS id ADCB715364; Thu, 21 Jan 2021 14:01:00 +0000 (GMT) Received: by raven.mansr.com (Postfix, from userid 51770) id AADC221A3D9; Thu, 21 Jan 2021 14:01:00 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Arnd Bergmann Subject: Re: [PATCH 4/5] watchdog: remove tango driver References: <20210120162745.61268-1-arnd@kernel.org> <20210120162745.61268-5-arnd@kernel.org> Date: Thu, 21 Jan 2021 14:01:00 +0000 In-Reply-To: <20210120162745.61268-5-arnd@kernel.org> (Arnd Bergmann's message of "Wed, 20 Jan 2021 17:27:44 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210121_090102_138636_82C31321 X-CRM114-Status: GOOD ( 26.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, Arnd Bergmann , Marc Gonzalez , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Wim Van Sebroeck , Guenter Roeck Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Arnd Bergmann writes: > From: Arnd Bergmann > > The tango platform is getting removed, so the driver is no > longer needed. > > Cc: Marc Gonzalez > Cc: Mans Rullgard > Signed-off-by: Arnd Bergmann > --- > drivers/watchdog/Kconfig | 11 -- > drivers/watchdog/Makefile | 1 - > drivers/watchdog/tangox_wdt.c | 209 ---------------------------------- > 3 files changed, 221 deletions(-) > delete mode 100644 drivers/watchdog/tangox_wdt.c The DT binding can go as well. Otherwise: Acked-by: Mans Rullgard > diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig > index c36f8233f60b..10efbb351f14 100644 > --- a/drivers/watchdog/Kconfig > +++ b/drivers/watchdog/Kconfig > @@ -254,17 +254,6 @@ config MENZ069_WATCHDOG > This driver can also be built as a module. If so the module > will be called menz069_wdt. > > -config TANGOX_WATCHDOG > - tristate "Sigma Designs SMP86xx/SMP87xx watchdog" > - select WATCHDOG_CORE > - depends on ARCH_TANGO || COMPILE_TEST > - depends on HAS_IOMEM > - help > - Support for the watchdog in Sigma Designs SMP86xx (tango3) > - and SMP87xx (tango4) family chips. > - > - This driver can be built as a module. The module name is tangox_wdt. > - > config WDAT_WDT > tristate "ACPI Watchdog Action Table (WDAT)" > depends on ACPI > diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile > index 7a95b280cd9f..1ff40d6a027f 100644 > --- a/drivers/watchdog/Makefile > +++ b/drivers/watchdog/Makefile > @@ -210,7 +210,6 @@ obj-$(CONFIG_DA9055_WATCHDOG) +=3D da9055_wdt.o > obj-$(CONFIG_DA9062_WATCHDOG) +=3D da9062_wdt.o > obj-$(CONFIG_DA9063_WATCHDOG) +=3D da9063_wdt.o > obj-$(CONFIG_GPIO_WATCHDOG) +=3D gpio_wdt.o > -obj-$(CONFIG_TANGOX_WATCHDOG) +=3D tangox_wdt.o > obj-$(CONFIG_WDAT_WDT) +=3D wdat_wdt.o > obj-$(CONFIG_WM831X_WATCHDOG) +=3D wm831x_wdt.o > obj-$(CONFIG_WM8350_WATCHDOG) +=3D wm8350_wdt.o > diff --git a/drivers/watchdog/tangox_wdt.c b/drivers/watchdog/tangox_wdt.c > deleted file mode 100644 > index 1afb0e9d808c..000000000000 > --- a/drivers/watchdog/tangox_wdt.c > +++ /dev/null > @@ -1,209 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0+ > -/* > - * Copyright (C) 2015 Mans Rullgard > - * SMP86xx/SMP87xx Watchdog driver > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -#define DEFAULT_TIMEOUT 30 > - > -static bool nowayout =3D WATCHDOG_NOWAYOUT; > -module_param(nowayout, bool, 0); > -MODULE_PARM_DESC(nowayout, > - "Watchdog cannot be stopped once started (default=3D" > - __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); > - > -static unsigned int timeout; > -module_param(timeout, int, 0); > -MODULE_PARM_DESC(timeout, "Watchdog timeout"); > - > -/* > - * Counter counts down from programmed value. Reset asserts when > - * the counter reaches 1. > - */ > -#define WD_COUNTER 0 > - > -#define WD_CONFIG 4 > -#define WD_CONFIG_XTAL_IN BIT(0) > -#define WD_CONFIG_DISABLE BIT(31) > - > -struct tangox_wdt_device { > - struct watchdog_device wdt; > - void __iomem *base; > - unsigned long clk_rate; > - struct clk *clk; > -}; > - > -static int tangox_wdt_set_timeout(struct watchdog_device *wdt, > - unsigned int new_timeout) > -{ > - wdt->timeout =3D new_timeout; > - > - return 0; > -} > - > -static int tangox_wdt_start(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev =3D watchdog_get_drvdata(wdt); > - u32 ticks; > - > - ticks =3D 1 + wdt->timeout * dev->clk_rate; > - writel(ticks, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static int tangox_wdt_stop(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev =3D watchdog_get_drvdata(wdt); > - > - writel(0, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static unsigned int tangox_wdt_get_timeleft(struct watchdog_device *wdt) > -{ > - struct tangox_wdt_device *dev =3D watchdog_get_drvdata(wdt); > - u32 count; > - > - count =3D readl(dev->base + WD_COUNTER); > - > - if (!count) > - return 0; > - > - return (count - 1) / dev->clk_rate; > -} > - > -static const struct watchdog_info tangox_wdt_info =3D { > - .options =3D WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, > - .identity =3D "tangox watchdog", > -}; > - > -static int tangox_wdt_restart(struct watchdog_device *wdt, > - unsigned long action, void *data) > -{ > - struct tangox_wdt_device *dev =3D watchdog_get_drvdata(wdt); > - > - writel(1, dev->base + WD_COUNTER); > - > - return 0; > -} > - > -static const struct watchdog_ops tangox_wdt_ops =3D { > - .start =3D tangox_wdt_start, > - .stop =3D tangox_wdt_stop, > - .set_timeout =3D tangox_wdt_set_timeout, > - .get_timeleft =3D tangox_wdt_get_timeleft, > - .restart =3D tangox_wdt_restart, > -}; > - > -static void tangox_clk_disable_unprepare(void *data) > -{ > - clk_disable_unprepare(data); > -} > - > -static int tangox_wdt_probe(struct platform_device *pdev) > -{ > - struct tangox_wdt_device *dev; > - u32 config; > - int err; > - > - dev =3D devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); > - if (!dev) > - return -ENOMEM; > - > - dev->base =3D devm_platform_ioremap_resource(pdev, 0); > - if (IS_ERR(dev->base)) > - return PTR_ERR(dev->base); > - > - dev->clk =3D devm_clk_get(&pdev->dev, NULL); > - if (IS_ERR(dev->clk)) > - return PTR_ERR(dev->clk); > - > - err =3D clk_prepare_enable(dev->clk); > - if (err) > - return err; > - err =3D devm_add_action_or_reset(&pdev->dev, > - tangox_clk_disable_unprepare, dev->clk); > - if (err) > - return err; > - > - dev->clk_rate =3D clk_get_rate(dev->clk); > - if (!dev->clk_rate) > - return -EINVAL; > - > - dev->wdt.parent =3D &pdev->dev; > - dev->wdt.info =3D &tangox_wdt_info; > - dev->wdt.ops =3D &tangox_wdt_ops; > - dev->wdt.timeout =3D DEFAULT_TIMEOUT; > - dev->wdt.min_timeout =3D 1; > - dev->wdt.max_hw_heartbeat_ms =3D (U32_MAX - 1) / dev->clk_rate; > - > - watchdog_init_timeout(&dev->wdt, timeout, &pdev->dev); > - watchdog_set_nowayout(&dev->wdt, nowayout); > - watchdog_set_drvdata(&dev->wdt, dev); > - > - /* > - * Deactivate counter if disable bit is set to avoid > - * accidental reset. > - */ > - config =3D readl(dev->base + WD_CONFIG); > - if (config & WD_CONFIG_DISABLE) > - writel(0, dev->base + WD_COUNTER); > - > - writel(WD_CONFIG_XTAL_IN, dev->base + WD_CONFIG); > - > - /* > - * Mark as active and restart with configured timeout if > - * already running. > - */ > - if (readl(dev->base + WD_COUNTER)) { > - set_bit(WDOG_HW_RUNNING, &dev->wdt.status); > - tangox_wdt_start(&dev->wdt); > - } > - > - watchdog_set_restart_priority(&dev->wdt, 128); > - > - watchdog_stop_on_unregister(&dev->wdt); > - err =3D devm_watchdog_register_device(&pdev->dev, &dev->wdt); > - if (err) > - return err; > - > - platform_set_drvdata(pdev, dev); > - > - dev_info(&pdev->dev, "SMP86xx/SMP87xx watchdog registered\n"); > - > - return 0; > -} > - > -static const struct of_device_id tangox_wdt_dt_ids[] =3D { > - { .compatible =3D "sigma,smp8642-wdt" }, > - { .compatible =3D "sigma,smp8759-wdt" }, > - { } > -}; > -MODULE_DEVICE_TABLE(of, tangox_wdt_dt_ids); > - > -static struct platform_driver tangox_wdt_driver =3D { > - .probe =3D tangox_wdt_probe, > - .driver =3D { > - .name =3D "tangox-wdt", > - .of_match_table =3D tangox_wdt_dt_ids, > - }, > -}; > - > -module_platform_driver(tangox_wdt_driver); > - > -MODULE_AUTHOR("Mans Rullgard "); > -MODULE_DESCRIPTION("SMP86xx/SMP87xx Watchdog driver"); > -MODULE_LICENSE("GPL"); > -- = > > 2.29.2 > -- = M=E5ns Rullg=E5rd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel