From patchwork Wed Jul 6 03:41:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 103408 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id D11E71007E1 for ; Wed, 6 Jul 2011 13:45:28 +1000 (EST) Received: from slow3-v.mail.gandi.net (slow3-v.mail.gandi.net [217.70.178.89]) by ozlabs.org (Postfix) with ESMTP id 8BFEF1007D1 for ; Wed, 6 Jul 2011 13:45:20 +1000 (EST) X-WhiteListed: mail was accepted with no delay X-WhiteListed: mail was accepted with no delay Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by slow3-v.mail.gandi.net (Postfix) with ESMTP id 973A437E9B for ; Wed, 6 Jul 2011 05:42:15 +0200 (CEST) X-Originating-IP: 217.70.178.134 Received: from mfilter4-d.gandi.net (mfilter4-d.gandi.net [217.70.178.134]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id D21CFA8072; Wed, 6 Jul 2011 05:41:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter4-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter4-d.gandi.net (mfilter4-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id g+21YB6fvfvM; Wed, 6 Jul 2011 05:41:48 +0200 (CEST) X-Originating-IP: 131.252.246.213 Received: from leaf (host-246-213.pubnet.pdx.edu [131.252.246.213]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 5AAB7A8077; Wed, 6 Jul 2011 05:41:42 +0200 (CEST) Date: Tue, 5 Jul 2011 20:41:40 -0700 From: Josh Triplett To: Samuel Ortiz , Paul Mundt , Ben Dooks Subject: [PATCH] sm501: When registering the GPIO, turn on the GPIO unit's power Message-ID: <20110706034138.GA8987@leaf> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: psas-avionics@lists.psas.pdx.edu, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org When attempting to use GPIO via the sm501 unit on the TQM5200 board, GPIO operations would only function if during the same boot u-boot's "fkt led" command had initialized the sm501. Comparing the sm501's registers with and without running the "fkt led" command turned up one significant difference: u-boot had enabled the GPIO power gate. Changing the Linux sm501 driver to enable the GPIO power gate allows GPIO to work without first initializing it with u-boot. Signed-off-by: Josh Triplett --- drivers/mfd/sm501.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index df3702c..d7a0ab9 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1089,6 +1089,7 @@ static int __devinit sm501_register_gpio(struct sm501_devdata *sm) goto err_low_chip; } + sm501_unit_power(sm->dev, SM501_GATE_GPIO, 1); gpio->registered = 1; return 0; @@ -1118,6 +1119,8 @@ static void sm501_gpio_remove(struct sm501_devdata *sm) if (!sm->gpio.registered) return; + sm501_unit_power(sm->dev, SM501_GATE_GPIO, 0); + ret = gpiochip_remove(&gpio->low.gpio); if (ret) dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n");