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: 20553 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A1C3325E03 for ; Tue, 24 Sep 2013 12:03:51 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id f12sf4418768vbg.3 for ; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=0BsUehEKN8G7QHvCkaj2ATSyvRMaXNK6mRPexRCOalU=; b=dU0CmM2txn4AwaI1sj+MAMy5uouOiLd7vzEwpnMwo/4nVelywAEclnty21wUfwOpNW JzbkunlwvxLfPSpgRTv+qNseFGD2U9ARkqgm0KlA7opJW9tCkCBuHgvzaagyuDHJtdiM rdEmbfHQOE+Kgg0cO8ZXvUat3WqgMTnM7ua+wc0AM12o1ecoGpeA5F7kTnjbJvLX9fxi 6crNKJdrJ463OrLTlJFuRCBlS+K7eesjopX54BRsRxB3xmBuUG5xGwMMeV1QQX8xz2A2 Zd6L8OzV1Qynx0k8DHl1AKzVYygFpwUiY943AbDDSy2ydpmtlqXQHnmIE2BZVUhd9FPU 7Sng== X-Gm-Message-State: ALoCoQnzZbDcOZp9G+KnI/HWdScWbXsEACuKHk0YnFyC2eT1BzpMIWfp4L6knXpez9/NF4DLd/nC X-Received: by 10.58.97.129 with SMTP id ea1mr1622960veb.25.1380024231323; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.43 with SMTP id e11ls91485qej.54.gmail; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) X-Received: by 10.52.107.226 with SMTP id hf2mr23107815vdb.2.1380024231192; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id fb4si8346589veb.12.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Sep 2013 05:03:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id p13so3193039vbe.5 for ; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) X-Received: by 10.220.94.206 with SMTP id a14mr787867vcn.19.1380024231090; Tue, 24 Sep 2013 05:03:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp238274vcz; Tue, 24 Sep 2013 05:03:50 -0700 (PDT) X-Received: by 10.15.43.206 with SMTP id x54mr2256418eev.79.1380024229974; Tue, 24 Sep 2013 05:03:49 -0700 (PDT) Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by mx.google.com with ESMTPS id q8si26706141eem.300.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Sep 2013 05:03:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.172 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.172; Received: by mail-ea0-f172.google.com with SMTP id r16so2433822ead.3 for ; Tue, 24 Sep 2013 05:03:49 -0700 (PDT) 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 Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij , Kristoffer Ericson 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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