From patchwork Tue Jul 16 01:50:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2827854 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 8BD04C0AB2 for ; Tue, 16 Jul 2013 01:51:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2930C201EB for ; Tue, 16 Jul 2013 01:51:36 +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 C5A3D201D3 for ; Tue, 16 Jul 2013 01:51:34 +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 1UyuQF-0007xV-1c; Tue, 16 Jul 2013 01:51:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UyuQC-00061I-FN; Tue, 16 Jul 2013 01:51:20 +0000 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182] helo=ch1outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UyuQ9-00060S-2l for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 01:51:17 +0000 Received: from mail222-ch1-R.bigfish.com (10.43.68.245) by CH1EHSOBE017.bigfish.com (10.43.70.67) with Microsoft SMTP Server id 14.1.225.22; Tue, 16 Jul 2013 01:50:52 +0000 Received: from mail222-ch1 (localhost [127.0.0.1]) by mail222-ch1-R.bigfish.com (Postfix) with ESMTP id F04801A014D; Tue, 16 Jul 2013 01:50:51 +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 mail222-ch1 (localhost.localdomain [127.0.0.1]) by mail222-ch1 (MessageSwitch) id 1373939449334874_3893; Tue, 16 Jul 2013 01:50:49 +0000 (UTC) Received: from CH1EHSMHS031.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.240]) by mail222-ch1.bigfish.com (Postfix) with ESMTP id 4203A40098; Tue, 16 Jul 2013 01:50:49 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS031.bigfish.com (10.43.70.31) with Microsoft SMTP Server (TLS) id 14.16.227.3; Tue, 16 Jul 2013 01:50:49 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.3.136.1; Tue, 16 Jul 2013 01:53:05 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.141]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r6G1obXn005132; Mon, 15 Jul 2013 18:50:38 -0700 Date: Tue, 16 Jul 2013 09:50:42 +0800 From: Shawn Guo To: Philipp Zabel Subject: Re: [PATCH v8] reset: Add driver for gpio-controlled reset pins Message-ID: <20130716015038.GD28375@S2101-09.ap.freescale.net> References: <1369904940-716-1-git-send-email-p.zabel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1369904940-716-1-git-send-email-p.zabel@pengutronix.de> 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-20130715_215117_179578_F7D8950A X-CRM114-Status: GOOD ( 20.51 ) X-Spam-Score: -2.6 (--) Cc: Marek Vasut , Fabio Estevam , Mike Turquette , Arnd Bergmann , Len Brown , Sascha Hauer , Stephen Warren , "Rafael J. Wysocki" , Pavel Machek , Olof Johansson , 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 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. Shawn ---8<-------- From 2f8ce9e5d6525b98f3828b707458e83fabb39d50 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sun, 14 Jul 2013 20:41:00 +0800 Subject: [PATCH] ENGR00269945: reset: register gpio-reset driver in arch_initcall It's a little bit late to register gpio-reset driver at module_init time, because gpio-reset provides reset control via gpio for other devices which are mostly probed at module_init time too. And it becomes even worse, when the gpio comes from IO expander on I2C bus, e.g. pca953x. In that case, gpio-reset needs to be ready before I2C bus driver which is generally ready at subsys_initcall time. Let's register gpio-reset driver in arch_initcall() to have it ready early enough. The defer probe mechanism is not used here, because a reset controller driver should be reasonably registered early than other devices. More importantly, defer probe doe not help in some nasty cases, e.g. the gpio-pca953x device itself needs a reset from gpio-reset driver to start working. Signed-off-by: Shawn Guo --- drivers/reset/gpio-reset.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/reset/gpio-reset.c b/drivers/reset/gpio-reset.c index 4f372f9..a7f214f 100644 --- a/drivers/reset/gpio-reset.c +++ b/drivers/reset/gpio-reset.c @@ -168,7 +168,17 @@ static struct platform_driver gpio_reset_driver = { }, }; -module_platform_driver(gpio_reset_driver); +static int __init gpio_reset_init(void) +{ + return platform_driver_register(&gpio_reset_driver); +} +arch_initcall(gpio_reset_init); + +static void __exit gpio_reset_exit(void) +{ + platform_driver_unregister(&gpio_reset_driver); +} +module_exit(gpio_reset_exit); MODULE_AUTHOR("Philipp Zabel "); MODULE_DESCRIPTION("gpio reset controller");