[PATCH] [ARM]: Move asm/arch/gpio.h to mach/ directory

Jonas Bonn jonas.bonn at gmail.com
Sat Oct 11 21:47:43 CEST 2008


This file was moved in the big file move, but some OpenMoko specific
changes did not make it.  This patch peels out the relevant bits and
adds them to the gpio.h file in the upstream location.

The only OpenMoko specific change is the definition of gpio_to_irq and
irq_to_gpio.  These functions should really be defined in gpio_chip and
asm-generic/gpio.h; this is coming soon, but until then we'll just use
the Moko definitions that we've been using up until now.

This is not strictly correct for the GTA02 case, but it works given
the configuration that's currently in use.  This can be fixed (and
should become evident) when the configuration options are cleaned up.

Signed-off-by: Jonas Bonn <jonas.bonn at gmail.com>
---
 arch/arm/mach-s3c2410/include/mach/gpio.h |    7 ++++
 arch/arm/plat-s3c24xx/neo1973_pm_gsm.c    |    2 +-
 drivers/gpio/gpiolib.c                    |    2 +-
 drivers/input/keyboard/gpio_keys.c        |    2 +-
 drivers/input/keyboard/neo1973kbd.c       |    2 +-
 include/asm-arm/arch-s3c2410/gpio.h       |   46 -----------------------------
 6 files changed, 11 insertions(+), 50 deletions(-)
 delete mode 100644 include/asm-arm/arch-s3c2410/gpio.h

diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index 3b52b86..7232f8c 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -15,4 +15,11 @@
 #define gpio_set_value	__gpio_set_value
 #define gpio_cansleep	__gpio_cansleep
 
+/* These two defines should be removed as soon as the
+ * generic irq handling makes it upstream */
+#include <mach/hardware.h>
+#define gpio_to_irq(gpio)               s3c2410_gpio_getirq(gpio)
+#define irq_to_gpio(irq)                s3c2410_gpio_irq2pin(irq)
+/* -- cut to here when generic irq makes it */
+
 #include <asm-generic/gpio.h>
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
index b720db4..ad0d9c8 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
@@ -19,7 +19,7 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 
-#include <asm/arch/gpio.h>
+#include <mach/gpio.h>
 #include <asm/mach-types.h>
 #include <mach/gta01.h>
 #include <asm/plat-s3c24xx/neo1973.h>
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d1b8f79..08b5d05 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -6,7 +6,7 @@
 #include <linux/err.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
-#include <asm/arch/gpio.h>
+#include <mach/gpio.h>
 
 /* Optional implementation infrastructure for GPIO interfaces.
  *
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 3f9dbf3..e69e092 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -23,7 +23,7 @@
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 
-#include <asm/arch/gpio.h>
+#include <mach/gpio.h>
 
 struct gpio_button_data {
 	struct gpio_keys_button *button;
diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c
index 4d8654c..2262a30 100644
--- a/drivers/input/keyboard/neo1973kbd.c
+++ b/drivers/input/keyboard/neo1973kbd.c
@@ -23,7 +23,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
-#include <asm/arch/gpio.h>
+#include <mach/gpio.h>
 #include <asm/mach-types.h>
 
 struct neo1973kbd {
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h
deleted file mode 100644
index 15da41c..0000000
--- a/include/asm-arm/arch-s3c2410/gpio.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* linux/include/asm-arm/arch-s3c2410/gpio.h
- *
- * Copyright (c) 2008 Simtec Electronics
- *	http://armlinux.simtec.co.uk/
- *	Ben Dooks <ben at simtec.co.uk>
- *
- * S3C2410 - GPIO lib support
- *
- * 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.
-*/
-
-#if 0
-#define gpio_get_value	__gpio_get_value
-#define gpio_set_value	__gpio_set_value
-#endif
-#define gpio_cansleep	__gpio_cansleep
-
-#ifndef __ASM_ARCH_S3C2410_GPIO_H
-#define __ASM_ARCH_S3C2410_GPIO_H
-
-#include <asm/irq.h>
-#include <mach/hardware.h>
-#include <mach/regs-gpio.h>
-
-int gpio_request(unsigned gpio, const char *label);
-void gpio_free(unsigned gpio);
-int gpio_direction_input(unsigned gpio);
-int gpio_direction_output(unsigned gpio, int value);
-
-#define gpio_get_value(gpio)		s3c2410_gpio_getpin(gpio)
-#define gpio_set_value(gpio,value)	s3c2410_gpio_setpin(gpio, value)
-
-#include <asm-generic/gpio.h>			/* cansleep wrappers */
-
-#ifdef CONFIG_CPU_S3C2400
-#define gpio_to_irq(gpio)		s3c2400_gpio_getirq(gpio)
-#else
-#define gpio_to_irq(gpio)		s3c2410_gpio_getirq(gpio)
-#define irq_to_gpio(irq)		s3c2410_gpio_irq2pin(irq)
-#endif
-
-#include <asm-generic/gpio.h>
-#endif
-
-- 
1.5.6.3




More information about the openmoko-kernel mailing list