From patchwork Wed Apr 27 13:14:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1192 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:50:03 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs108481qai; Wed, 27 Apr 2011 06:14:33 -0700 (PDT) Received: by 10.14.50.3 with SMTP id y3mr919225eeb.225.1303910072343; Wed, 27 Apr 2011 06:14:32 -0700 (PDT) Received: from eu1sys200aog110.obsmtp.com (eu1sys200aog110.obsmtp.com [207.126.144.129]) by mx.google.com with SMTP id u13si2700482eeh.30.2011.04.27.06.14.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Apr 2011 06:14:32 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.129 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.129; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.129 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-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob110.postini.com ([207.126.147.11]) with SMTP ID DSNKTbgWr/Nl+tfACBFcZ05fly20tivNRXIn@postini.com; Wed, 27 Apr 2011 13:14:32 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B001D104; Wed, 27 Apr 2011 13:14:15 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 322732BFC; Wed, 27 Apr 2011 13:14:15 +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 relay1.stm.gmessaging.net (Postfix) with ESMTPS id DE31324C300; Wed, 27 Apr 2011 15:14:07 +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.2.254.0; Wed, 27 Apr 2011 15:14:14 +0200 From: Linus Walleij To: Grant Likely , , Cc: Lee Jones , Linus Walleij Subject: [PATCH 07/10] gpio: move the Nomadik GPIO driver to drivers/gpio Date: Wed, 27 Apr 2011 15:14:12 +0200 Message-ID: <1303910052-3505-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Linus Walleij This takes the Nomadik GPIO driver out of the plat-nomadik directory and pushes it down into drivers/gpio where it belongs. Signed-off-by: Linus Walleij --- arch/arm/mach-nomadik/Kconfig | 2 +- arch/arm/mach-nomadik/board-nhk8815.c | 1 + arch/arm/mach-nomadik/cpu-8815.c | 1 + arch/arm/mach-nomadik/i2c-8815nhk.c | 2 +- arch/arm/mach-nomadik/include/mach/gpio.h | 8 +++++++- arch/arm/mach-ux500/Kconfig | 2 +- arch/arm/mach-ux500/board-mop500-pins.c | 2 +- arch/arm/mach-ux500/board-mop500-sdi.c | 1 + arch/arm/mach-ux500/board-u5500-sdi.c | 2 +- arch/arm/mach-ux500/cpu-db5500.c | 3 +-- arch/arm/mach-ux500/cpu-db8500.c | 2 +- arch/arm/mach-ux500/devices-common.c | 3 +-- arch/arm/mach-ux500/include/mach/gpio.h | 8 +++++++- arch/arm/plat-nomadik/Kconfig | 5 ----- arch/arm/plat-nomadik/Makefile | 1 - drivers/gpio/Kconfig | 8 ++++++++ drivers/gpio/Makefile | 1 + .../gpio.c => drivers/gpio/nomadik-gpio.c | 1 + .../plat/gpio.h => include/linux/gpio/nomadik.h | 18 +++--------------- 19 files changed, 38 insertions(+), 33 deletions(-) rename arch/arm/plat-nomadik/gpio.c => drivers/gpio/nomadik-gpio.c (99%) rename arch/arm/plat-nomadik/include/plat/gpio.h => include/linux/gpio/nomadik.h (82%) diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 71f3ea6..acecb73 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig @@ -6,7 +6,7 @@ config MACH_NOMADIK_8815NHK bool "ST 8815 Nomadik Hardware Kit (evaluation board)" select NOMADIK_8815 select HAS_MTU - select NOMADIK_GPIO + select GPIO_NOMADIK endmenu diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c index 1399303..de7a1c1 100644 --- a/arch/arm/mach-nomadik/board-nhk8815.c +++ b/arch/arm/mach-nomadik/board-nhk8815.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/mach-nomadik/cpu-8815.c b/arch/arm/mach-nomadik/cpu-8815.c index ac58e3b..671bdee 100644 --- a/arch/arm/mach-nomadik/cpu-8815.c +++ b/arch/arm/mach-nomadik/cpu-8815.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/mach-nomadik/i2c-8815nhk.c b/arch/arm/mach-nomadik/i2c-8815nhk.c index abfe25a..a6c7dc4 100644 --- a/arch/arm/mach-nomadik/i2c-8815nhk.c +++ b/arch/arm/mach-nomadik/i2c-8815nhk.c @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include /* diff --git a/arch/arm/mach-nomadik/include/mach/gpio.h b/arch/arm/mach-nomadik/include/mach/gpio.h index 7a81a04..2bbfa36 100644 --- a/arch/arm/mach-nomadik/include/mach/gpio.h +++ b/arch/arm/mach-nomadik/include/mach/gpio.h @@ -1,6 +1,12 @@ #ifndef __ASM_ARCH_GPIO_H #define __ASM_ARCH_GPIO_H -#include +#include + +/* Invoke gpiolibs gpio_chip abstraction */ +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep +#define gpio_to_irq __gpio_to_irq #endif /* __ASM_ARCH_GPIO_H */ diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 5862601..df83a37 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -5,7 +5,7 @@ config UX500_SOC_COMMON default y select ARM_GIC select HAS_MTU - select NOMADIK_GPIO + select GPIO_NOMADIK select ARM_ERRATA_753970 menu "Ux500 SoC" diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c index fd4cf1c..9af4a4f 100644 --- a/arch/arm/mach-ux500/board-mop500-pins.c +++ b/arch/arm/mach-ux500/board-mop500-pins.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index bf0b024..5c008f6 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c @@ -7,6 +7,7 @@ #include #include +#include #include #include #include diff --git a/arch/arm/mach-ux500/board-u5500-sdi.c b/arch/arm/mach-ux500/board-u5500-sdi.c index 739fb4c..16e87eb 100644 --- a/arch/arm/mach-ux500/board-u5500-sdi.c +++ b/arch/arm/mach-ux500/board-u5500-sdi.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index c9dc2ef..b227ce8 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c @@ -9,12 +9,11 @@ #include #include #include +#include #include #include -#include - #include #include #include diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index 516126c..f87f37c 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index 13a4ce0..7418552 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c @@ -12,8 +12,7 @@ #include #include #include - -#include +#include #include diff --git a/arch/arm/mach-ux500/include/mach/gpio.h b/arch/arm/mach-ux500/include/mach/gpio.h index 3c4cd31..cde655c 100644 --- a/arch/arm/mach-ux500/include/mach/gpio.h +++ b/arch/arm/mach-ux500/include/mach/gpio.h @@ -7,6 +7,12 @@ */ #define ARCH_NR_GPIOS 350 -#include +#include + +/* Invoke gpiolibs gpio_chip abstraction */ +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep +#define gpio_to_irq __gpio_to_irq #endif /* __ASM_ARCH_GPIO_H */ diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index 187f4e8..d5c7986 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig @@ -20,9 +20,4 @@ config HAS_MTU to multiple interrupt generating programmable 32-bit free running decrementing counters. -config NOMADIK_GPIO - bool - help - Support for the Nomadik GPIO controller. - endif diff --git a/arch/arm/plat-nomadik/Makefile b/arch/arm/plat-nomadik/Makefile index c335473..37c7cdd 100644 --- a/arch/arm/plat-nomadik/Makefile +++ b/arch/arm/plat-nomadik/Makefile @@ -3,4 +3,3 @@ # Licensed under GPLv2 obj-$(CONFIG_HAS_MTU) += timer.o -obj-$(CONFIG_NOMADIK_GPIO) += gpio.o diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index cc89dfa..c23401f 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -128,6 +128,14 @@ config GPIO_U300 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 ports of 8 GPIO pins each. +config GPIO_NOMADIK + bool "ST-Ericsson Nomadik GPIO" + depends on GPIOLIB && (ARCH_U8500 || ARCH_NOMADIK) + help + Say yes here to support GPIO interface for ST-Ericsson Nomadik. + This is found in the Nomadik NHK8815, DB8500, DB5500 SoCs + for example. + config GPIO_VX855 tristate "VIA VX855/VX875 GPIO" depends on GPIOLIB && MFD_SUPPORT && PCI diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile index 26032b1..e4851c5 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_GPIO_WM8350) += wm8350-gpiolib.o obj-$(CONFIG_GPIO_WM8994) += wm8994-gpio.o obj-$(CONFIG_GPIO_SCH) += sch_gpio.o obj-$(CONFIG_GPIO_U300) += u300-gpio.o +obj-$(CONFIG_GPIO_NOMADIK) += nomadik-gpio.o obj-$(CONFIG_GPIO_RDC321X) += rdc321x-gpio.o obj-$(CONFIG_GPIO_JANZ_TTL) += janz-ttl.o obj-$(CONFIG_GPIO_SX150X) += sx150x.o diff --git a/arch/arm/plat-nomadik/gpio.c b/drivers/gpio/nomadik-gpio.c similarity index 99% rename from arch/arm/plat-nomadik/gpio.c rename to drivers/gpio/nomadik-gpio.c index b81f0d5..dd2d728 100644 --- a/arch/arm/plat-nomadik/gpio.c +++ b/drivers/gpio/nomadik-gpio.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/plat-nomadik/include/plat/gpio.h b/include/linux/gpio/nomadik.h similarity index 82% rename from arch/arm/plat-nomadik/include/plat/gpio.h rename to include/linux/gpio/nomadik.h index dfdd4e7..539dda8 100644 --- a/arch/arm/plat-nomadik/include/plat/gpio.h +++ b/include/linux/gpio/nomadik.h @@ -9,20 +9,8 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#ifndef __ASM_PLAT_GPIO_H -#define __ASM_PLAT_GPIO_H - -#include - -/* - * These currently cause a function call to happen, they may be optimized - * if needed by adding cpu-specific defines to identify blocks - * (see mach-pxa/include/mach/gpio.h as an example using GPLR etc) - */ -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value -#define gpio_cansleep __gpio_cansleep -#define gpio_to_irq __gpio_to_irq +#ifndef __GPIO_NOMADIK_H +#define __GPIO_NOMADIK_H /* * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving @@ -95,4 +83,4 @@ struct nmk_gpio_platform_data { void (*set_ioforce)(bool enable); }; -#endif /* __ASM_PLAT_GPIO_H */ +#endif