From patchwork Tue Sep 10 12:31:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2866391 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 8F2409F485 for ; Tue, 10 Sep 2013 13:56:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 686C4202CF for ; Tue, 10 Sep 2013 13:56:14 +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 D7DDD202FF for ; Tue, 10 Sep 2013 13:56:08 +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 1VJNTr-0002Yc-NQ; Tue, 10 Sep 2013 12:55:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNT7-0003Ku-OR; Tue, 10 Sep 2013 12:54:57 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNS7-0003DP-Cc for linux-arm-kernel@merlin.infradead.org; Tue, 10 Sep 2013 12:53:55 +0000 Received: from mail-la0-f47.google.com ([209.85.215.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJN7L-0002Ox-RP for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2013 12:32:28 +0000 Received: by mail-la0-f47.google.com with SMTP id eo20so5982107lab.6 for ; Tue, 10 Sep 2013 05:31:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Dmh1p0bg1DwQnpBVHB+86RM1tpyqayHlAlY/6UqyzC0=; b=ez2cVSu3v2Q+fCRA5wZfDu5k0oVhUTDkNM9FpX27HdvoxetxxvvB5YE7dPpq5sJ9GE smHWZxdmm+KysNsNRE1+0kkXYxX90ymkvmvStOfYixXz5Gm33EqGoiUbl+I0WneWaoCm 9v/udFo4lx4scZJmRsviZZy0ovlzJ6HR9eYrMzXcNeSqjIAH7KwarkDVGeAEXrbNXe/I TEZ20s09Bc6dXjp3Y/UBaro6KNaTtzo4ACxq3eQEaQrrPzzAjB0A8kAzWR5mwDELqgpo rLoqAafNh3GDY5L3ANXRPRfshCD9VRZdJayw3Zc0c+VUiqqasjKtMRgFdtM2/15zMMTk mBpw== X-Gm-Message-State: ALoCoQnc2y08xbVAO4kZHmXmYLaD/zpwLEhYWiEgk9bSeIw3QjSnNRpTOjWWpOgifL6/VkCs4Dyz X-Received: by 10.112.161.105 with SMTP id xr9mr1173292lbb.40.1378816310483; Tue, 10 Sep 2013 05:31:50 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i3sm9047781laf.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:49 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa Subject: [PATCH 7/7] ARM: ixp4xx: stop broadcasting the custom GPIO API Date: Tue, 10 Sep 2013 14:31:46 +0200 Message-Id: <1378816306-8244-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130910_053228_079368_16E74BAF X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Linus Walleij , Alexandre Courbot , 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: , MIME-Version: 1.0 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.9 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 Now that these custom GPIO accessors are only used from the gpio chip in this machine, move the code out of the include file and right next to the gpiochip implementation. Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Alexandre Courbot Signed-off-by: Linus Walleij --- arch/arm/mach-ixp4xx/common.c | 38 +++++++++++++++++++++++++++ arch/arm/mach-ixp4xx/include/mach/platform.h | 39 ---------------------------- 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 8708ac8..9edaf47 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -81,6 +81,44 @@ void __init ixp4xx_map_io(void) iotable_init(ixp4xx_io_desc, ARRAY_SIZE(ixp4xx_io_desc)); } +/* + * GPIO-functions + */ +/* + * The following converted to the real HW bits the gpio_line_config + */ +/* GPIO pin types */ +#define IXP4XX_GPIO_OUT 0x1 +#define IXP4XX_GPIO_IN 0x2 + +/* GPIO signal types */ +#define IXP4XX_GPIO_LOW 0 +#define IXP4XX_GPIO_HIGH 1 + +/* GPIO Clocks */ +#define IXP4XX_GPIO_CLK_0 14 +#define IXP4XX_GPIO_CLK_1 15 + +static void gpio_line_config(u8 line, u32 direction) +{ + if (direction == IXP4XX_GPIO_IN) + *IXP4XX_GPIO_GPOER |= (1 << line); + else + *IXP4XX_GPIO_GPOER &= ~(1 << line); +} + +static void gpio_line_get(u8 line, int *value) +{ + *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; +} + +static void gpio_line_set(u8 line, int value) +{ + if (value == IXP4XX_GPIO_HIGH) + *IXP4XX_GPIO_GPOUTR |= (1 << line); + else if (value == IXP4XX_GPIO_LOW) + *IXP4XX_GPIO_GPOUTR &= ~(1 << line); +} /************************************************************************* * IXP4xx chipset IRQ handling diff --git a/arch/arm/mach-ixp4xx/include/mach/platform.h b/arch/arm/mach-ixp4xx/include/mach/platform.h index 4c4c6a6..75c4c65 100644 --- a/arch/arm/mach-ixp4xx/include/mach/platform.h +++ b/arch/arm/mach-ixp4xx/include/mach/platform.h @@ -131,44 +131,5 @@ struct pci_sys_data; extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); extern struct pci_ops ixp4xx_ops; -/* - * GPIO-functions - */ -/* - * The following converted to the real HW bits the gpio_line_config - */ -/* GPIO pin types */ -#define IXP4XX_GPIO_OUT 0x1 -#define IXP4XX_GPIO_IN 0x2 - -/* GPIO signal types */ -#define IXP4XX_GPIO_LOW 0 -#define IXP4XX_GPIO_HIGH 1 - -/* GPIO Clocks */ -#define IXP4XX_GPIO_CLK_0 14 -#define IXP4XX_GPIO_CLK_1 15 - -static inline void gpio_line_config(u8 line, u32 direction) -{ - if (direction == IXP4XX_GPIO_IN) - *IXP4XX_GPIO_GPOER |= (1 << line); - else - *IXP4XX_GPIO_GPOER &= ~(1 << line); -} - -static inline void gpio_line_get(u8 line, int *value) -{ - *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; -} - -static inline void gpio_line_set(u8 line, int value) -{ - if (value == IXP4XX_GPIO_HIGH) - *IXP4XX_GPIO_GPOUTR |= (1 << line); - else if (value == IXP4XX_GPIO_LOW) - *IXP4XX_GPIO_GPOUTR &= ~(1 << line); -} - #endif // __ASSEMBLY__