From patchwork Thu Sep 6 19:42:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1417521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 6632FDFFCF for ; Thu, 6 Sep 2012 19:46:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T9hzH-0001bI-7v; Thu, 06 Sep 2012 19:43:39 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T9hyh-0001Vs-Cm for linux-arm-kernel@lists.infradead.org; Thu, 06 Sep 2012 19:43:05 +0000 Received: by mail-ob0-f177.google.com with SMTP id ta17so3313757obb.36 for ; Thu, 06 Sep 2012 12:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=4nTQlLZDRP4fp3GQuc9bLhV4frdKL/LoM2qRk0nDhvw=; b=JXpTWjpHuRN3OESBVgvWcm5C+8csV0g4qyX9rDXj1CjkVjtjhBydIZP0Dj1OlAwF/5 4QsE8T2awK5q8u/WO5FHH6+zVVWE4VQJ8YzwNO1Sgiw+fX80JC/GU21M5K5Mv0NxzVXu fzg7O5bwIGXmOW6d02/23ao4pDZEi7lKJ2FvVMxyLL8kGv3Lkmi5TLLkMFZkrNoysdCt J7Lr+PFbprwGsrxBS1x++lp1NMcfZJa2lSKj1mQyVT3m5pZTjkdFSyGR040krlBPq27M mez/Fp0CKJnyF4zQaQCUUMdaM0+xoX7bWYZJknjzqZEN6jlCNhIxDUK+5cbS0F7/00FG zWJg== Received: by 10.182.48.8 with SMTP id h8mr3522174obn.75.1346960583192; Thu, 06 Sep 2012 12:43:03 -0700 (PDT) Received: from rob-laptop.calxeda.com ([173.226.190.126]) by mx.google.com with ESMTPS id th3sm2754774obb.6.2012.09.06.12.43.01 (version=SSLv3 cipher=OTHER); Thu, 06 Sep 2012 12:43:02 -0700 (PDT) From: Rob Herring To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/6] ARM: shmobile: move custom gpio functions to sh-gpio.h Date: Thu, 6 Sep 2012 14:42:41 -0500 Message-Id: <1346960563-18689-5-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346960563-18689-1-git-send-email-robherring2@gmail.com> References: <1346960563-18689-1-git-send-email-robherring2@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Russell King , Arnd Bergmann , Linus Walleij , Magnus Damm , Rob Herring , Paul Mundt , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Herring Move custom shmobile gpio code to a sh-gpio.h to remove the dependency on mach/gpio.h. shmobile always uses gpiolib, so we can remove __GPIOLIB_COMPLEX define from mach/gpio.h. Signed-off-by: Rob Herring Cc: Paul Mundt Cc: Magnus Damm --- arch/arm/mach-shmobile/board-ap4evb.c | 2 + arch/arm/mach-shmobile/board-armadillo800eva.c | 2 + arch/arm/mach-shmobile/board-g4evm.c | 2 + arch/arm/mach-shmobile/board-mackerel.c | 2 + arch/arm/mach-shmobile/include/mach/gpio.h | 63 +----------------------- arch/arm/mach-shmobile/pfc-r8a7740.c | 2 +- arch/arm/mach-shmobile/pfc-r8a7779.c | 2 +- arch/arm/mach-shmobile/pfc-sh7367.c | 2 +- arch/arm/mach-shmobile/pfc-sh7372.c | 2 +- arch/arm/mach-shmobile/pfc-sh7377.c | 2 +- arch/arm/mach-shmobile/pfc-sh73a0.c | 2 +- arch/arm/mach-shmobile/sh-gpio.h | 48 ++++++++++++++++++ drivers/sh/pfc/gpio.c | 1 + 13 files changed, 64 insertions(+), 68 deletions(-) create mode 100644 arch/arm/mach-shmobile/sh-gpio.h diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index f172ca8..c7f164e 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c @@ -66,6 +66,8 @@ #include #include +#include "sh-gpio.h" + /* * Address Interface BusWidth note * ------------------------------------------------------------------ diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index cf10f92..15ffb4c 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c @@ -54,6 +54,8 @@ #include #include +#include "sh-gpio.h" + /* * CON1 Camera Module * CON2 Extension Bus diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c index fa5dfc5..eeee12e 100644 --- a/arch/arm/mach-shmobile/board-g4evm.c +++ b/arch/arm/mach-shmobile/board-g4evm.c @@ -42,6 +42,8 @@ #include #include +#include "sh-gpio.h" + /* * SDHI * diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 7ea2b31..7654404 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c @@ -64,6 +64,8 @@ #include #include +#include "sh-gpio.h" + /* * Address Interface BusWidth note * ------------------------------------------------------------------ diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h index 844507d..40a8c17 100644 --- a/arch/arm/mach-shmobile/include/mach/gpio.h +++ b/arch/arm/mach-shmobile/include/mach/gpio.h @@ -1,62 +1 @@ -/* - * Generic GPIO API and pinmux table support - * - * Copyright (c) 2008 Magnus Damm - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ -#ifndef __ASM_ARCH_GPIO_H -#define __ASM_ARCH_GPIO_H - -#include -#include -#include -#include - -#ifdef CONFIG_GPIOLIB - -static inline int irq_to_gpio(unsigned int irq) -{ - return -ENOSYS; -} - -#else - -#define __ARM_GPIOLIB_COMPLEX - -#endif /* CONFIG_GPIOLIB */ - -/* - * FIXME !! - * - * current gpio frame work doesn't have - * the method to control only pull up/down/free. - * this function should be replaced by correct gpio function - */ -static inline void __init gpio_direction_none(u32 addr) -{ - __raw_writeb(0x00, addr); -} - -static inline void __init gpio_request_pullup(u32 addr) -{ - u8 data = __raw_readb(addr); - - data &= 0x0F; - data |= 0xC0; - __raw_writeb(data, addr); -} - -static inline void __init gpio_request_pulldown(u32 addr) -{ - u8 data = __raw_readb(addr); - - data &= 0x0F; - data |= 0xA0; - - __raw_writeb(data, addr); -} - -#endif /* __ASM_ARCH_GPIO_H */ +/* empty */ diff --git a/arch/arm/mach-shmobile/pfc-r8a7740.c b/arch/arm/mach-shmobile/pfc-r8a7740.c index ce9e7fa..134d1b9 100644 --- a/arch/arm/mach-shmobile/pfc-r8a7740.c +++ b/arch/arm/mach-shmobile/pfc-r8a7740.c @@ -20,7 +20,7 @@ */ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-shmobile/pfc-r8a7779.c b/arch/arm/mach-shmobile/pfc-r8a7779.c index d14c9b0..cbc26ba 100644 --- a/arch/arm/mach-shmobile/pfc-r8a7779.c +++ b/arch/arm/mach-shmobile/pfc-r8a7779.c @@ -19,7 +19,7 @@ */ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c index e6e5246..c0c137f 100644 --- a/arch/arm/mach-shmobile/pfc-sh7367.c +++ b/arch/arm/mach-shmobile/pfc-sh7367.c @@ -18,7 +18,7 @@ */ #include #include -#include +#include #include #define CPU_ALL_PORT(fn, pfx, sfx) \ diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c index 336093f9..7a1525f 100644 --- a/arch/arm/mach-shmobile/pfc-sh7372.c +++ b/arch/arm/mach-shmobile/pfc-sh7372.c @@ -22,7 +22,7 @@ */ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c index 2f10511..f3117f6 100644 --- a/arch/arm/mach-shmobile/pfc-sh7377.c +++ b/arch/arm/mach-shmobile/pfc-sh7377.c @@ -19,7 +19,7 @@ */ #include #include -#include +#include #include #define CPU_ALL_PORT(fn, pfx, sfx) \ diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c index 4a547b8..b442f9d 100644 --- a/arch/arm/mach-shmobile/pfc-sh73a0.c +++ b/arch/arm/mach-shmobile/pfc-sh73a0.c @@ -20,7 +20,7 @@ */ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-shmobile/sh-gpio.h b/arch/arm/mach-shmobile/sh-gpio.h new file mode 100644 index 0000000..7ba1877 --- /dev/null +++ b/arch/arm/mach-shmobile/sh-gpio.h @@ -0,0 +1,48 @@ +/* + * Generic GPIO API and pinmux table support + * + * Copyright (c) 2008 Magnus Damm + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ +#ifndef __ASM_ARCH_GPIO_H +#define __ASM_ARCH_GPIO_H + +#include +#include +#include + +/* + * FIXME !! + * + * current gpio frame work doesn't have + * the method to control only pull up/down/free. + * this function should be replaced by correct gpio function + */ +static inline void __init gpio_direction_none(u32 addr) +{ + __raw_writeb(0x00, addr); +} + +static inline void __init gpio_request_pullup(u32 addr) +{ + u8 data = __raw_readb(addr); + + data &= 0x0F; + data |= 0xC0; + __raw_writeb(data, addr); +} + +static inline void __init gpio_request_pulldown(u32 addr) +{ + u8 data = __raw_readb(addr); + + data &= 0x0F; + data |= 0xA0; + + __raw_writeb(data, addr); +} + +#endif /* __ASM_ARCH_GPIO_H */ diff --git a/drivers/sh/pfc/gpio.c b/drivers/sh/pfc/gpio.c index 62bca98..038fa07 100644 --- a/drivers/sh/pfc/gpio.c +++ b/drivers/sh/pfc/gpio.c @@ -17,6 +17,7 @@ #include #include #include +#include struct sh_pfc_chip { struct sh_pfc *pfc;