From patchwork Tue Jul 16 06:51:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2827912 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26E4C9F7D6 for ; Tue, 16 Jul 2013 06:52:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 352D7201C0 for ; Tue, 16 Jul 2013 06:52:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0A2A1201B7 for ; Tue, 16 Jul 2013 06:52: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 1Uyz7H-0005nZ-LT; Tue, 16 Jul 2013 06:52:07 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uyz7F-0002HV-HZ; Tue, 16 Jul 2013 06:52:05 +0000 Received: from mail-db8lp0185.outbound.messaging.microsoft.com ([213.199.154.185] helo=db8outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uyz7B-0002Gy-JR for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 06:52:03 +0000 Received: from mail178-db8-R.bigfish.com (10.174.8.248) by DB8EHSOBE042.bigfish.com (10.174.4.105) with Microsoft SMTP Server id 14.1.225.22; Tue, 16 Jul 2013 06:51:39 +0000 Received: from mail178-db8 (localhost [127.0.0.1]) by mail178-db8-R.bigfish.com (Postfix) with ESMTP id 58A4F3401AE; Tue, 16 Jul 2013 06:51:39 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: -2 X-BigFish: VS-2(zz98dI1432Izz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz8275bh8275dhz2dh87h2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1151h1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail178-db8 (localhost.localdomain [127.0.0.1]) by mail178-db8 (MessageSwitch) id 1373957497890842_27623; Tue, 16 Jul 2013 06:51:37 +0000 (UTC) Received: from DB8EHSMHS018.bigfish.com (unknown [10.174.8.252]) by mail178-db8.bigfish.com (Postfix) with ESMTP id C8B9A5C0046; Tue, 16 Jul 2013 06:51:37 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS018.bigfish.com (10.174.4.28) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 16 Jul 2013 06:51:37 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.136.1; Tue, 16 Jul 2013 06:53:51 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.189]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r6G6pReu026501; Mon, 15 Jul 2013 23:51:27 -0700 Date: Tue, 16 Jul 2013 14:51:33 +0800 From: Shawn Guo To: Philipp Zabel Subject: Re: [PATCH v8] reset: Add driver for gpio-controlled reset pins Message-ID: <20130716065130.GB30067@S2101-09.ap.freescale.net> References: <1369904940-716-1-git-send-email-p.zabel@pengutronix.de> <20130716015038.GD28375@S2101-09.ap.freescale.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130716015038.GD28375@S2101-09.ap.freescale.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: sigmatel.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130716_025202_039350_9183724D X-CRM114-Status: GOOD ( 22.52 ) X-Spam-Score: -1.9 (-) Cc: Marek Vasut , Fabio Estevam , Mike Turquette , Len Brown , Sascha Hauer , "Rafael J. Wysocki" , Pavel Machek , devicetree-discuss@lists.ozlabs.org, 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, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 Tue, Jul 16, 2013 at 09:50:42AM +0800, Shawn Guo wrote: > Hi Philipp, > > On Thu, May 30, 2013 at 11:09:00AM +0200, Philipp Zabel wrote: > > This driver implements a reset controller device that toggle a gpio > > connected to a reset pin of a peripheral IC. The delay between assertion > > and de-assertion of the reset signal can be configured via device tree. > > > > Signed-off-by: Philipp Zabel > > Reviewed-by: Stephen Warren > > I see this patch is very useful, as GPIOs are widely used to reset > components/devices on board. But I do not find the patch in v3.11-rc1. > What's your plan about it? > > Also, I'm wondering if we should register the driver a little bit > early. Please see the following patch. If it makes sense to you, > I can send the patch to you, or you can just quash it into yours. And here is another change request. Shawn ----8<--------------- From 822a0c4fb7c99b371844ba7e957affcaa8cb1cfe Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sun, 14 Jul 2013 20:28:05 +0800 Subject: [PATCH] ENGR00269945: reset: handle cansleep case in gpio-reset Some gpio reset may be backed by a gpio that can sleep, e.g. pca953x gpio output. For such gpio, gpio_set_value_cansleep() should be called. Otherwise, the WARN_ON(chip->can_sleep) in gpiod_set_value() will be hit. Add a gpio_cansleep() check to handle cansleep gpio. Signed-off-by: Shawn Guo --- drivers/reset/gpio-reset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/reset/gpio-reset.c b/drivers/reset/gpio-reset.c index 5d2515a..4f372f9 100644 --- a/drivers/reset/gpio-reset.c +++ b/drivers/reset/gpio-reset.c @@ -32,7 +32,10 @@ static void gpio_reset_set(struct reset_controller_dev *rcdev, int asserted) if (drvdata->active_low) value = !value; - gpio_set_value(drvdata->gpio, value); + if (gpio_cansleep(drvdata->gpio)) + gpio_set_value_cansleep(drvdata->gpio, value); + else + gpio_set_value(drvdata->gpio, value); } static int gpio_reset(struct reset_controller_dev *rcdev, unsigned long id)