From patchwork Tue Sep 24 12:03:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2933431 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 59646BFF05 for ; Tue, 24 Sep 2013 12:09:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24B3120494 for ; Tue, 24 Sep 2013 12:09: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 A28322044C for ; Tue, 24 Sep 2013 12:09: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 1VORQo-000530-9j; Tue, 24 Sep 2013 12:09:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VORQl-0005Aj-Sv; Tue, 24 Sep 2013 12:09:27 +0000 Received: from mail-ee0-f41.google.com ([74.125.83.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VORQj-00059e-8w for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2013 12:09:25 +0000 Received: by mail-ee0-f41.google.com with SMTP id d17so2445088eek.28 for ; Tue, 24 Sep 2013 05:09:01 -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=0BsUehEKN8G7QHvCkaj2ATSyvRMaXNK6mRPexRCOalU=; b=PRYDw8RXiqCCwS9CiBbDOFvU5TfxhYP2nkdSRGYheuvHCi+ky4B++3AL9pZCrDtpDv UnKRcncHXQ3aRt4cOPYARg06U9sE+9rp6XvpCEgKGvMbK+HKZ5a6Kdxh7Nra8rSsRHeX AlUXwVl+U/UxU+QORoPSGnYJedteWyrTh13KsY4g6lhBXIVEy5h7H8lM8lwRcE3lsOa+ A4l7Fpa5HRxu+mPAx+1C6GB0q2UMgwU/wirlso2N4z3MJD7Gxc0atnU6rFuUidBMzyQS dLblnE60TH/O5TQ0ioAhL23mJ8oNjQTARUr+HBtc102V/pYIHpvwHQBhE33rk82J+ZOy AOiA== X-Gm-Message-State: ALoCoQkZHewK5pjDpD17ucs5upn4uqHOz928HR6eI1qazRJ0j413s+BMyPGyPFUz9GdMIHGP45kD X-Received: by 10.14.198.197 with SMTP id v45mr4568129een.52.1380024229260; Tue, 24 Sep 2013 05:03:49 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id a43sm52566002eep.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 24 Sep 2013 05:03:48 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Russell King Subject: [PATCH] ARM: sa1100: remove complex GPIO interface Date: Tue, 24 Sep 2013 14:03:39 +0200 Message-Id: <1380024219-21790-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-20130924_080925_425356_2D20FAE1 X-CRM114-Status: GOOD ( 19.11 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , Kristoffer Ericson , 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=-6.5 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 The SA1100 was implementing its own variants of gpio_get_value() and gpio_set_value() and only selectively falling back to gpiolib for extended (EGPIO) handling. However the driver in gpio/gpio-sa1100.c already handles the same functionality for these lines, yet remain unused. The only upside would be things like a timing-critical hotpath on bit-banged GPIO, but that kind of things does not seem to happen on these GPIOs, so it is not worth having the extra complexity. Tested with some buttons on the Compaq iPAQ H3630. Cc: Russell King Cc: Kristoffer Ericson Signed-off-by: Linus Walleij --- arch/arm/Kconfig | 1 - arch/arm/mach-sa1100/include/mach/gpio.h | 55 ------------------------------- arch/arm/mach-sa1100/include/mach/h3xxx.h | 2 ++ drivers/gpio/gpio-sa1100.c | 2 +- 4 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 arch/arm/mach-sa1100/include/mach/gpio.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3f7714d..74bf29f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -692,7 +692,6 @@ config ARCH_SA1100 select GENERIC_CLOCKEVENTS select HAVE_IDE select ISA - select NEED_MACH_GPIO_H select NEED_MACH_MEMORY_H select SPARSE_IRQ help diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h deleted file mode 100644 index 6a9eecf..0000000 --- a/arch/arm/mach-sa1100/include/mach/gpio.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * arch/arm/mach-sa1100/include/mach/gpio.h - * - * SA1100 GPIO wrappers for arch-neutral GPIO calls - * - * Written by Philipp Zabel - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef __ASM_ARCH_SA1100_GPIO_H -#define __ASM_ARCH_SA1100_GPIO_H - -#include -#include -#include -#include - -#define __ARM_GPIOLIB_COMPLEX - -static inline int gpio_get_value(unsigned gpio) -{ - if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX)) - return GPLR & GPIO_GPIO(gpio); - else - return __gpio_get_value(gpio); -} - -static inline void gpio_set_value(unsigned gpio, int value) -{ - if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX)) - if (value) - GPSR = GPIO_GPIO(gpio); - else - GPCR = GPIO_GPIO(gpio); - else - __gpio_set_value(gpio, value); -} - -#define gpio_cansleep __gpio_cansleep - -#endif diff --git a/arch/arm/mach-sa1100/include/mach/h3xxx.h b/arch/arm/mach-sa1100/include/mach/h3xxx.h index 7d9df16..c810620 100644 --- a/arch/arm/mach-sa1100/include/mach/h3xxx.h +++ b/arch/arm/mach-sa1100/include/mach/h3xxx.h @@ -13,6 +13,8 @@ #ifndef _INCLUDE_H3XXX_H_ #define _INCLUDE_H3XXX_H_ +#include "hardware.h" /* Gives GPIO_MAX */ + /* Physical memory regions corresponding to chip selects */ #define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000) #define H3600_BANK_2_PHYS SA1100_CS2_PHYS diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index 8ea3b33..5c94a53 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c @@ -10,7 +10,7 @@ #include #include #include - +#include #include #include