gpio/mxs: Move Freescale mxs gpio driver to drivers/gpio
authorGrant Likely <grant.likely@secretlab.ca>
Mon, 6 Jun 2011 15:37:58 +0000 (09:37 -0600)
committerGrant Likely <grant.likely@secretlab.ca>
Mon, 6 Jun 2011 15:37:58 +0000 (09:37 -0600)
GPIO drivers are getting moved to drivers/gpio for cleanup and
consolidation.  This patch moves the mxs driver.  Follow up patches
will clean it up and make it a fine upstanding example of a gpio
driver.

v2: Removed header file entirely and put struct definition directly
    into driver.  The struct isn't used anywhere else in the kernel.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-mxs/Makefile
arch/arm/mach-mxs/gpio.h [deleted file]
arch/arm/mach-mxs/mach-mx28evk.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-mxs.c [moved from arch/arm/mach-mxs/gpio.c with 98% similarity]

index 58e8923..6c38262 100644 (file)
@@ -1,5 +1,5 @@
 # Common support
-obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
+obj-y := clock.o devices.o icoll.o iomux.o system.o timer.o
 
 obj-$(CONFIG_MXS_OCOTP) += ocotp.o
 obj-$(CONFIG_PM) += pm.o
diff --git a/arch/arm/mach-mxs/gpio.h b/arch/arm/mach-mxs/gpio.h
deleted file mode 100644 (file)
index 005bb06..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- */
-
-#ifndef __MXS_GPIO_H__
-#define __MXS_GPIO_H__
-
-struct mxs_gpio_port {
-       void __iomem *base;
-       int id;
-       int irq;
-       int irq_high;
-       int virtual_irq_start;
-       struct gpio_chip chip;
-};
-
-int mxs_gpio_init(struct mxs_gpio_port*, int);
-
-#endif /* __MXS_GPIO_H__ */
index eacdc6b..56767a5 100644 (file)
@@ -26,7 +26,6 @@
 #include <mach/iomux-mx28.h>
 
 #include "devices-mx28.h"
-#include "gpio.h"
 
 #define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
 #define MX28EVK_FEC_PHY_POWER  MXS_GPIO_NR(2, 15)
index 4a7f631..4871174 100644 (file)
@@ -93,6 +93,10 @@ config GPIO_EXYNOS4
        help
          Say yes here to support Samsung Exynos4 series SoCs GPIO library
 
+config GPIO_MXS
+       def_bool y
+       depends on ARCH_MXS
+
 config GPIO_PLAT_SAMSUNG
        bool "Samsung SoCs GPIO library support"
        default y if SAMSUNG_GPIOLIB_4BIT
index b605f8e..f879cbe 100644 (file)
@@ -9,6 +9,7 @@ obj-$(CONFIG_GPIO_ADP5588)      += adp5588-gpio.o
 obj-$(CONFIG_GPIO_BASIC_MMIO_CORE)     += basic_mmio_gpio.o
 obj-$(CONFIG_GPIO_BASIC_MMIO)  += basic_mmio_gpio.o
 obj-$(CONFIG_GPIO_EXYNOS4)     += gpio-exynos4.o
+obj-$(CONFIG_GPIO_MXS)         += gpio-mxs.o
 obj-$(CONFIG_GPIO_PLAT_SAMSUNG)        += gpio-plat-samsung.o
 obj-$(CONFIG_GPIO_S5PC100)     += gpio-s5pc100.o
 obj-$(CONFIG_GPIO_S5PV210)     += gpio-s5pv210.o
similarity index 98%
rename from arch/arm/mach-mxs/gpio.c
rename to drivers/gpio/gpio-mxs.c
index 2c950fe..e26bf30 100644 (file)
@@ -29,8 +29,6 @@
 #include <mach/mx28.h>
 #include <asm-generic/bug.h>
 
-#include "gpio.h"
-
 static struct mxs_gpio_port *mxs_gpio_ports;
 static int gpio_table_size;
 
@@ -50,6 +48,15 @@ static int gpio_table_size;
 #define GPIO_INT_LEV_MASK      (1 << 0)
 #define GPIO_INT_POL_MASK      (1 << 1)
 
+struct mxs_gpio_port {
+       void __iomem *base;
+       int id;
+       int irq;
+       int irq_high;
+       int virtual_irq_start;
+       struct gpio_chip chip;
+};
+
 /* Note: This driver assumes 32 GPIOs are handled in one register */
 
 static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index)