From patchwork Sat Jun 15 09:56:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 251618 X-Patchwork-Delegate: promsoft@gmail.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 74E102C007A for ; Sat, 15 Jun 2013 19:57:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DC3F4A021; Sat, 15 Jun 2013 11:57:35 +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 RdJPKLU1dter; Sat, 15 Jun 2013 11:57:34 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C37034A019; Sat, 15 Jun 2013 11:57:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 20DB64A019 for ; Sat, 15 Jun 2013 11:57:22 +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 bhGkmR0KhgPB for ; Sat, 15 Jun 2013 11:57:14 +0200 (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 mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by theia.denx.de (Postfix) with ESMTPS id 5CF894A018 for ; Sat, 15 Jun 2013 11:57:07 +0200 (CEST) Received: by mail-pb0-f52.google.com with SMTP id xa12so1300333pbc.11 for ; Sat, 15 Jun 2013 02:57:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding:x-gm-message-state; bh=fulCrsUILv8RG73aHWOUx2GMetzIiwEn+1EzxI4JX1E=; b=AqROJgIJy7Zz0vj/2QHtg+BRtW9ABhbwpR308jz20c0SoARyOPekmXdML4I9qpk8On 9xoAb+uKpHeD9vPrB9mo0yTT/KidbOkX2AhxyKf8wxBJMOTXWW/COz19LiGP6TQ72pGN bg9cWLZyyuFHZ3cAL2VnRQAs8sVPGHZevnM/Q4/ZwCdhF6EN2hiCFY0P56A/3R3+Bn4a Vpu85uUc3r8LQggt/RAfRzsorQMX/wp+OrJKZ/fltADw+ibO/II3ueAM7u8jKlgLadfq 84PC+pn12XdbwB6JeDkPOQdPgd3rbJKvpFcYaUtgM/WuAY3FpiUngYZa03zI8cIoaxXZ 1D1Q== X-Received: by 10.66.119.196 with SMTP id kw4mr5677288pab.164.1371290224671; Sat, 15 Jun 2013 02:57:04 -0700 (PDT) Received: from [114.39.105.11] (114-39-105-11.dynamic.hinet.net. [114.39.105.11]) by mx.google.com with ESMTPSA id xu10sm6134082pab.3.2013.06.15.02.57.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Jun 2013 02:57:03 -0700 (PDT) Message-ID: <1371290219.4051.5.camel@phoenix> From: Axel Lin To: Gabriel Huau Date: Sat, 15 Jun 2013 17:56:59 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQmWDfA/s4OGsBleZY6mL850KOdhvrqFELG9s14bC08OaXqmqNV0jtOUs3qrJKCHndeD6eXm Cc: Marek Vasut , Tom Rini , u-boot@lists.denx.de Subject: [U-Boot] [PATCH] gpio: s3c2440_gpio: Fix wrong writel arguments 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Current code had writel arguments the wrong way around, fix it. Signed-off-by: Axel Lin Reviewed-by: Marek Vasut --- Hi, I don't have this hardware to test, but current code looks obviously wrong. I'd appreciate if someone can review and test this patch. Axel drivers/gpio/s3c2440_gpio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c index 43bbf11..09b04eb 100644 --- a/drivers/gpio/s3c2440_gpio.c +++ b/drivers/gpio/s3c2440_gpio.c @@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value) else l &= ~bit; - return writel(port, l); + return writel(l, port); } int gpio_get_value(unsigned gpio) @@ -85,11 +85,11 @@ int gpio_free(unsigned gpio) int gpio_direction_input(unsigned gpio) { - return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio)); + return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); } int gpio_direction_output(unsigned gpio, int value) { - writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio)); + writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); return gpio_set_value(gpio, value); }