From patchwork Wed Aug 10 12:16:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 3350 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6BBCC241D9 for ; Wed, 10 Aug 2011 12:17:24 +0000 (UTC) Received: from mail-qy0-f173.google.com (mail-qy0-f173.google.com [209.85.216.173]) by fiordland.canonical.com (Postfix) with ESMTP id 25A74A182F7 for ; Wed, 10 Aug 2011 12:17:24 +0000 (UTC) Received: by qyk31 with SMTP id 31so3214065qyk.11 for ; Wed, 10 Aug 2011 05:17:23 -0700 (PDT) Received: by 10.229.183.84 with SMTP id cf20mr6217756qcb.121.1312978643509; Wed, 10 Aug 2011 05:17:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.190.71 with SMTP id dh7cs78424qcb; Wed, 10 Aug 2011 05:17:23 -0700 (PDT) Received: from mr.google.com ([10.213.22.205]) by 10.213.22.205 with SMTP id o13mr3333921ebb.71.1312978643069 (num_hops = 1); Wed, 10 Aug 2011 05:17:23 -0700 (PDT) Received: by 10.213.22.205 with SMTP id o13mr2418003ebb.71.1312978642487; Wed, 10 Aug 2011 05:17:22 -0700 (PDT) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com [207.126.144.141]) by mx.google.com with SMTP id d45si601111eeb.157.2011.08.10.05.17.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 05:17:22 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKTkJ2yfZ0d9CuWqT3rTeq2wPlINAhXj0y@postini.com; Wed, 10 Aug 2011 12:17:22 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 5E1FC50; Wed, 10 Aug 2011 12:17:00 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 5AA2D71; Wed, 10 Aug 2011 12:17:00 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id E4ABDA807B; Wed, 10 Aug 2011 14:16:54 +0200 (CEST) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 10 Aug 2011 14:16:59 +0200 From: Linus Walleij To: Grant Likely , , Cc: Lee Jones , Linus Walleij , zeal , Daniel Silverstone , Ben Dooks Subject: [PATCH 05/19] mach-ks8695: break out GPIO driver specifics Date: Wed, 10 Aug 2011 14:16:57 +0200 Message-ID: <1312978617-18235-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Linus Walleij The file is included from upper directories and deal with generic GPIO and gpiolib stuff. Break out the platform and driver specific defines and functions into its own header file. Cc: zeal Cc: Daniel Silverstone Cc: Ben Dooks Signed-off-by: Linus Walleij --- arch/arm/mach-ks8695/board-acs5k.c | 1 + arch/arm/mach-ks8695/board-dsm320.c | 1 + arch/arm/mach-ks8695/board-micrel.c | 1 + arch/arm/mach-ks8695/include/mach/gpio-ks8695.h | 39 +++++++++++++++++++++++ arch/arm/mach-ks8695/include/mach/gpio.h | 27 ---------------- drivers/gpio/gpio-ks8695.c | 1 + 6 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 arch/arm/mach-ks8695/include/mach/gpio-ks8695.h diff --git a/arch/arm/mach-ks8695/board-acs5k.c b/arch/arm/mach-ks8695/board-acs5k.c index dee45cb..3d7d114 100644 --- a/arch/arm/mach-ks8695/board-acs5k.c +++ b/arch/arm/mach-ks8695/board-acs5k.c @@ -34,6 +34,7 @@ #include #include +#include #include "generic.h" diff --git a/arch/arm/mach-ks8695/board-dsm320.c b/arch/arm/mach-ks8695/board-dsm320.c index e3ccf1a..c3c867a 100644 --- a/arch/arm/mach-ks8695/board-dsm320.c +++ b/arch/arm/mach-ks8695/board-dsm320.c @@ -29,6 +29,7 @@ #include #include +#include #include "generic.h" diff --git a/arch/arm/mach-ks8695/board-micrel.c b/arch/arm/mach-ks8695/board-micrel.c index e887778..9b9c47c 100644 --- a/arch/arm/mach-ks8695/board-micrel.c +++ b/arch/arm/mach-ks8695/board-micrel.c @@ -18,6 +18,7 @@ #include #include +#include #include #include "generic.h" diff --git a/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h b/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h new file mode 100644 index 0000000..6eb034d --- /dev/null +++ b/arch/arm/mach-ks8695/include/mach/gpio-ks8695.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2006 Andrew Victor + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __MACH_KS8659_GPIO_H +#define __MACH_KS8659_GPIO_H + +#include + +#define KS8695_GPIO_0 0 +#define KS8695_GPIO_1 1 +#define KS8695_GPIO_2 2 +#define KS8695_GPIO_3 3 +#define KS8695_GPIO_4 4 +#define KS8695_GPIO_5 5 +#define KS8695_GPIO_6 6 +#define KS8695_GPIO_7 7 +#define KS8695_GPIO_8 8 +#define KS8695_GPIO_9 9 +#define KS8695_GPIO_10 10 +#define KS8695_GPIO_11 11 +#define KS8695_GPIO_12 12 +#define KS8695_GPIO_13 13 +#define KS8695_GPIO_14 14 +#define KS8695_GPIO_15 15 + +/* + * Configure GPIO pin as external interrupt source. + */ +extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); + +/* Register the GPIOs */ +extern void ks8695_register_gpios(void); + +#endif /* __MACH_KS8659_GPIO_H */ diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 994267b..f5fda36 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -11,36 +11,9 @@ #ifndef __ASM_ARCH_GPIO_H_ #define __ASM_ARCH_GPIO_H_ -#include - -#define KS8695_GPIO_0 0 -#define KS8695_GPIO_1 1 -#define KS8695_GPIO_2 2 -#define KS8695_GPIO_3 3 -#define KS8695_GPIO_4 4 -#define KS8695_GPIO_5 5 -#define KS8695_GPIO_6 6 -#define KS8695_GPIO_7 7 -#define KS8695_GPIO_8 8 -#define KS8695_GPIO_9 9 -#define KS8695_GPIO_10 10 -#define KS8695_GPIO_11 11 -#define KS8695_GPIO_12 12 -#define KS8695_GPIO_13 13 -#define KS8695_GPIO_14 14 -#define KS8695_GPIO_15 15 - -/* - * Configure GPIO pin as external interrupt source. - */ -extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); - /* * Map IRQ number to GPIO line. */ extern int irq_to_gpio(unsigned int irq); -/* Register the GPIOs */ -extern void ks8695_register_gpios(void); - #endif diff --git a/drivers/gpio/gpio-ks8695.c b/drivers/gpio/gpio-ks8695.c index b3fdfe1..a3ac66e 100644 --- a/drivers/gpio/gpio-ks8695.c +++ b/drivers/gpio/gpio-ks8695.c @@ -31,6 +31,7 @@ #include #include +#include /* * Configure a GPIO line for either GPIO function, or its internal