From patchwork Mon Feb 17 21:08:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Cooper X-Patchwork-Id: 3664941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 44A39BF13A for ; Mon, 17 Feb 2014 21:09:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F1E7201C7 for ; Mon, 17 Feb 2014 21:09:13 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 726D420176 for ; Mon, 17 Feb 2014 21:09:11 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFVQv-0007ta-CC; Mon, 17 Feb 2014 21:08:57 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFVQp-0004XN-IA; Mon, 17 Feb 2014 21:08:51 +0000 Received: from mho-03-ewr.mailhop.org ([204.13.248.66] helo=mho-01-ewr.mailhop.org) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFVQm-0004WA-By for linux-arm-kernel@lists.infradead.org; Mon, 17 Feb 2014 21:08:49 +0000 Received: from pool-108-39-110-144.nrflva.fios.verizon.net ([108.39.110.144] helo=titan) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WFVQQ-0003RH-0b; Mon, 17 Feb 2014 21:08:26 +0000 Received: from titan.lakedaemon.net (localhost [127.0.0.1]) by titan (Postfix) with ESMTP id 36EEA52AADA; Mon, 17 Feb 2014 16:08:22 -0500 (EST) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 108.39.110.144 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+gi1TofetY101NUSK9PRP1QcwFhjBuro8= X-DKIM: OpenDKIM Filter v2.0.1 titan 36EEA52AADA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lakedaemon.net; s=mail; t=1392671302; bh=NTw6bVvmrzPfAhvZVP62TwysVklU/OTd34n364q2/W0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=DhQex1reK2KAhiiGzVOkOZ3cWAoxKa3+EHP4YRj/vGxrG3AaPNNUq+I01UsAfIPj1 kYqlRNmmeKZFza7hkR6c5aMvfGoczMzS2HodbFaullPRMG7jqz/R8pz2ORGAJ6TeuI E10PsdFX3z9U4FQs+Q5dXBdD88bpD/h9vcU/MV9sATTped0Muz4LkkvifEarp7X0eA yTxSbdgZLr+XixXtCI3oBJJJZRYYk4Qyah5kX/tjBgpCmJKoA30xLYsdqpeskBim+B 6FLZijgpGYDFQwVMC0dOZ8urppWT1K7OpvdrYOt4OjSr1r1e5XiDwGDldXIhQimxqO 49YnpmoK5zAzQ== Date: Mon, 17 Feb 2014 16:08:22 -0500 From: Jason Cooper To: Ezequiel Garcia Subject: Re: [PATCH v7 11/18] watchdog: orion: Add per-compatible watchdog start implementation Message-ID: <20140217210822.GC7862@titan.lakedaemon.net> References: <1392073237-2554-1-git-send-email-ezequiel.garcia@free-electrons.com> <1392073237-2554-12-git-send-email-ezequiel.garcia@free-electrons.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1392073237-2554-12-git-send-email-ezequiel.garcia@free-electrons.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140217_160848_479172_26088F88 X-CRM114-Status: GOOD ( 16.66 ) X-Spam-Score: -2.0 (--) Cc: Lior Amsalem , Thomas Petazzoni , linux-watchdog@vger.kernel.org, Tawfik Bayouk , Jason Gunthorpe , Wim Van Sebroeck , Guenter Roeck , Gregory Clement , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Feb 10, 2014 at 08:00:30PM -0300, Ezequiel Garcia wrote: > To handle differences between SoCs this commit adds per-compatible > string start() function for the watchdog kick-off. This is preparation > work and makes no functionality changes to the current driver. > > Reviewed-by: Guenter Roeck > Tested-by: Sebastian Hesselbarth > Tested-by: Willy Tarreau > Signed-off-by: Ezequiel Garcia > --- > drivers/watchdog/orion_wdt.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c > index b48fd08..3925297 100644 > --- a/drivers/watchdog/orion_wdt.c > +++ b/drivers/watchdog/orion_wdt.c > @@ -50,6 +50,7 @@ struct orion_watchdog_data { > int rstout_enable_bit; > int (*clock_init)(struct platform_device *, > struct orion_watchdog *); this... > + int (*start)(struct watchdog_device *); > }; > > struct orion_watchdog { ... > @@ -193,6 +202,7 @@ static const struct orion_watchdog_data orion_data = { > .wdt_enable_bit = BIT(4), > .wdt_counter_offset = 0x24, > .clock_init = orion_wdt_clock_init, and this... > + .start = orion_start, > }; cause a failure to apply the patch. I hand-jammed it (attached), please let me know what is going on here (missed dep?) thx, Jason. -----------8<----------------- commit 14181fe244605b53829ec87f9f6af85d5ec2f8ce Author: Ezequiel Garcia Date: Mon Feb 10 20:00:30 2014 -0300 watchdog: orion: Add per-compatible watchdog start implementation To handle differences between SoCs this commit adds per-compatible string start() function for the watchdog kick-off. This is preparation work and makes no functionality changes to the current driver. Reviewed-by: Guenter Roeck Tested-by: Sebastian Hesselbarth Tested-by: Willy Tarreau Signed-off-by: Ezequiel Garcia Acked-by: Wim Van Sebroeck Signed-off-by: Jason Cooper diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index b220e34285d1..573859cff72f 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -46,6 +46,7 @@ struct orion_watchdog_data { int wdt_counter_offset; int wdt_enable_bit; int rstout_enable_bit; + int (*start)(struct watchdog_device *); }; struct orion_watchdog { @@ -66,7 +67,7 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev) return 0; } -static int orion_wdt_start(struct watchdog_device *wdt_dev) +static int orion_start(struct watchdog_device *wdt_dev) { struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); @@ -85,6 +86,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev) return 0; } +static int orion_wdt_start(struct watchdog_device *wdt_dev) +{ + struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); + + /* There are some per-SoC quirks to handle */ + return dev->data->start(wdt_dev); +} + static int orion_wdt_stop(struct watchdog_device *wdt_dev) { struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); @@ -172,6 +181,7 @@ static const struct orion_watchdog_data orion_data = { .rstout_enable_bit = BIT(1), .wdt_enable_bit = BIT(4), .wdt_counter_offset = 0x24, + .start = orion_start, }; static const struct of_device_id orion_wdt_of_match_table[] = {