From patchwork Fri Sep 7 03:28:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 182307 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 228932C0093 for ; Fri, 7 Sep 2012 13:36:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E0C5A2827F; Fri, 7 Sep 2012 05:36:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ogjkz9eUHjZN; Fri, 7 Sep 2012 05:36:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3BA9928287; Fri, 7 Sep 2012 05:36:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2CC0628287 for ; Fri, 7 Sep 2012 05:36:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7I5-RExyd711 for ; Fri, 7 Sep 2012 05:36:35 +0200 (CEST) X-Greylist: delayed 399 seconds by postgrey-1.27 at theia; Fri, 07 Sep 2012 05:36:32 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gate.alliedtelesyn.co.nz (gate.alliedtelesyn.co.nz [202.49.72.33]) by theia.denx.de (Postfix) with SMTP id 0E5012827F for ; Fri, 7 Sep 2012 05:36:32 +0200 (CEST) Received: (qmail 26356 invoked from network); 7 Sep 2012 03:29:49 -0000 Received: from mmarshal2-dx.alliedtelesyn.co.nz (HELO mailmarshall.alliedtelesyn.co.nz) (10.32.18.41) by gate-int.alliedtelesyn.co.nz with SMTP; 7 Sep 2012 03:29:49 -0000 Received: from alliedtelesyn.co.nz (Not Verified[10.32.16.32]) by mailmarshall.alliedtelesyn.co.nz with MailMarshal (v6, 2, 0, 2977) id ; Fri, 07 Sep 2012 15:29:46 +1200 Received: from MAIL/SpoolDir by alliedtelesyn.co.nz (Mercury 1.48); 7 Sep 12 15:33:03 +1200 Received: from SpoolDir by MAIL (Mercury 1.48); 7 Sep 12 15:32:36 +1200 Received: from chrisp-dl.ws.atlnz.lc (10.33.22.46) by alliedtelesyn.co.nz (Mercury 1.48) with ESMTP; 7 Sep 12 15:32:09 +1200 Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 8FD3220578; Fri, 7 Sep 2012 15:28:54 +1200 (NZST) From: Chris Packham To: u-boot@lists.denx.de Date: Fri, 7 Sep 2012 15:28:35 +1200 Message-Id: <1346988515-16849-1-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 1.7.12.rc2.16.g034161a Cc: Peter Tyser , Andy Fleming , Chris Packham , Kumar Gala , Kyle Moffett Subject: [U-Boot] [PATCH] mpc85xx: make gpio_direction_output respect value X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Chris Packham Users of familiar with the Linux gpiolib API expect that value parameter to gpio_direction_output reflects the initial state of the output pin. gpio_direction_output was always driving the output low, now it drives it high or low according to the value provided. Signed-off-by: Chris Packham Cc: Kyle Moffett Cc: Andy Fleming Cc: Peter Tyser Cc: Kumar Gala --- arch/powerpc/include/asm/mpc85xx_gpio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/mpc85xx_gpio.h b/arch/powerpc/include/asm/mpc85xx_gpio.h index 5a608a5..2aed514 100644 --- a/arch/powerpc/include/asm/mpc85xx_gpio.h +++ b/arch/powerpc/include/asm/mpc85xx_gpio.h @@ -98,7 +98,10 @@ static inline int gpio_direction_input(unsigned gpio) static inline int gpio_direction_output(unsigned gpio, int value) { - mpc85xx_gpio_set_low(1U << gpio); + if (value) + mpc85xx_gpio_set_high(1U << gpio); + else + mpc85xx_gpio_set_low(1U << gpio); return 0; }