Skip to contentSkip to conversation

ARM: pxa: move gpio driver into drivers directory

PATCH New Haojian Zhuang 4 participants 10 messages Sep 30, 2011 – Oct 8, 2011

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: pxa: move gpio driver into drivers directory

Changelog:
v2:
1. Remove gpio.c from mach-pxa & mach-mmp that is introduced from v1.
2. Remove init function in gpio.c. Move the platfrom_device_register() into platform driver.
3. Initialize pxa_gpio_regs in gpio-pxa.c
4. Simplify code of identifing pxa gpio series or mmp gpio series.
5. Use linux/io.h instead of asm/io.h.

#1 lore raw

PATCH v2 1/5 ARM: pxa: remove redundant macro on GPIO

Both GPLRx and GPLR(x) are provided. GPLRx means register GPLR0/1/... GPLR(x) means register GPLR0/1/... and x ranges from 0 to the maximum bit number.

Remove GPLRx since it's redundant.

---
 arch/arm/mach-pxa/corgi_pm.c          |    5 ++-
 arch/arm/mach-pxa/include/mach/gpio.h |   60 ++++----------------------------
 arch/arm/mach-pxa/irq.c               |   17 +++++----
 arch/arm/mach-pxa/spitz_pm.c          |    3 +-
 4 files changed, 22 insertions(+), 63 deletions(-)
arch/arm/mach-pxa/corgi_pm.c +3 -2
index 2903477..1a7a4c0 100644
@@ -90,7 +90,7 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
 {
 	int is_resume = 0;
 
-	dev_dbg(sharpsl_pm.dev, "GPLR0 = %x,%x\n", GPLR0, PEDR);
+	dev_dbg(sharpsl_pm.dev, "GPLR0 = %x,%x\n", GPLR(0), PEDR);
 
 	if ((PEDR & GPIO_bit(CORGI_GPIO_AC_IN))) {
 		if (sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN)) {
@@ -124,7 +124,8 @@ static int corgi_should_wakeup(unsigned int resume_on_alarm)
 
 static unsigned long corgi_charger_wakeup(void)
 {
-	return ~GPLR0 & ( GPIO_bit(CORGI_GPIO_AC_IN) | GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) );
+	return ~GPLR(CORGI_GPIO_AC_IN) & ( GPIO_bit(CORGI_GPIO_AC_IN)
+		| GPIO_bit(CORGI_GPIO_KEY_INT) | GPIO_bit(CORGI_GPIO_WAKEUP) );
 }
 
 unsigned long corgipm_read_devdata(int type)
arch/arm/mach-pxa/include/mach/gpio.h +8 -52

77 lines not on this page · raw message

arch/arm/mach-pxa/irq.c +9 -8
index dafb4bf..b569e70 100644
@@ -103,21 +103,22 @@ static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type)
 	}
 
 	if (type & IRQ_TYPE_EDGE_RISING)
-		GRER0 |= GPIO_bit(gpio);
+		GRER(gpio) |= GPIO_bit(gpio);
 	else
-		GRER0 &= ~GPIO_bit(gpio);
+		GRER(gpio) &= ~GPIO_bit(gpio);
 
 	if (type & IRQ_TYPE_EDGE_FALLING)
-		GFER0 |= GPIO_bit(gpio);
+		GFER(gpio) |= GPIO_bit(gpio);
 	else
-		GFER0 &= ~GPIO_bit(gpio);
+		GFER(gpio) &= ~GPIO_bit(gpio);
 
 	return 0;
 }
 
 static void pxa_ack_low_gpio(struct irq_data *d)
 {
-	GEDR0 = (1 << (d->irq - IRQ_GPIO0));
+	int gpio = d->irq - IRQ_GPIO0;
+	GEDR(gpio) = 1 << gpio;
 }
 
 static struct irq_chip pxa_low_gpio_chip = {
@@ -163,9 +164,9 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	int irq;
 
 	/* clear edge detection on GPIO 0 and 1 */
-	GFER0 &= ~0x3;
-	GRER0 &= ~0x3;
-	GEDR0 = 0x3;
+	GFER(0) &= ~0x3;
+	GRER(0) &= ~0x3;
+	GEDR(0) = 0x3;
 
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		irq_set_chip_and_handler(irq, &pxa_low_gpio_chip,
arch/arm/mach-pxa/spitz_pm.c +2 -1
index 094279a..d5295b7 100644
@@ -169,7 +169,8 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm)
 
 static unsigned long spitz_charger_wakeup(void)
 {
-	return (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC));
+	return (~GPLR(SPITZ_GPIO_KEY_INT) & GPIO_bit(SPITZ_GPIO_KEY_INT))
+		| (GPLR(SPITZ_GPIO_SYNC) & GPIO_bit(SPITZ_GPIO_SYNC));
 }
 
 unsigned long spitzpm_read_devdata(int type)
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH v2 2/5 ARM: pxa: remove set_wake_t

In reply to Haojian Zhuang

Since set_wake_t is used for irq chip, it shouldn't be defined in gpio.h. Just remove it from gpio.h.

---
 arch/arm/mach-pxa/irq.c               |    5 +++--
 arch/arm/mach-pxa/pxa3xx.c            |    3 ++-
 arch/arm/plat-pxa/gpio.c              |    3 ++-
 arch/arm/plat-pxa/include/plat/gpio.h |    5 ++---
 4 files changed, 9 insertions(+), 7 deletions(-)
arch/arm/mach-pxa/irq.c +3 -2
index b569e70..a8e1aa1 100644
@@ -159,7 +159,8 @@ asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs)
 	} while (1);
 }
 
-static void __init pxa_init_low_gpio_irq(set_wake_t fn)
+static void __init pxa_init_low_gpio_irq(int (*fn)(struct irq_data *,
+					 unsigned int))
 {
 	int irq;
 
@@ -178,7 +179,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	pxa_low_gpio_chip.irq_set_wake = fn;
 }
 
-void __init pxa_init_irq(int irq_nr, set_wake_t fn)
+void __init pxa_init_irq(int irq_nr, int (*fn)(struct irq_data *, unsigned int))
 {
 	int irq, i, n;
 
arch/arm/mach-pxa/pxa3xx.c +2 -1
index 3ab9e84..f18a6eb 100644
@@ -365,7 +365,8 @@ static struct irq_chip pxa_ext_wakeup_chip = {
 	.irq_set_type	= pxa_set_ext_wakeup_type,
 };
 
-static void __init pxa_init_ext_wakeup_irq(set_wake_t fn)
+static void __init pxa_init_ext_wakeup_irq(int (*fn)(struct irq_data *,
+					   unsigned int))
 {
 	int irq;
 
arch/arm/plat-pxa/gpio.c +2 -1
index 5d6a86b..cd6d210 100644
@@ -264,7 +264,8 @@ static struct irq_chip pxa_muxed_gpio_chip = {
 	.irq_set_type	= pxa_gpio_irq_type,
 };
 
-void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn)
+void __init pxa_init_gpio(int mux_irq, int start, int end,
+			  int (*fn)(struct irq_data *, unsigned int))
 {
 	struct pxa_gpio_chip *c;
 	int gpio, irq;
arch/arm/plat-pxa/include/plat/gpio.h +2 -3
index 6fc41db..d31c2a5 100644
@@ -60,7 +60,6 @@ static inline void gpio_set_value(unsigned gpio, int value)
  */
 extern int pxa_last_gpio;
 
-typedef int (*set_wake_t)(struct irq_data *d, unsigned int on);
-
-extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn);
+extern void pxa_init_gpio(int mux_irq, int start, int end,
+			  int (*fn)(struct irq_data *, unsigned int));
 #endif /* __PLAT_GPIO_H */
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH v2 3/5 ARM: pxa: rename gpio_to_irq and irq_to_gpio

In reply to Haojian Zhuang

Rename gpio_to_irq() to pxa_gpio_to_irq(), and rename irq_to_gpio() to pxa_irq_to_gpio(). This rename operations is used to avoid naming confliction while gpio driver is moved into drivers/gpio/ directory.

---
 arch/arm/mach-mmp/aspenite.c            |    4 +-
 arch/arm/mach-mmp/flint.c               |    4 +-
 arch/arm/mach-mmp/include/mach/gpio.h   |    4 +-
 arch/arm/mach-mmp/tavorevb.c            |    4 +-
 arch/arm/mach-mmp/teton_bga.c           |    2 +-
 arch/arm/mach-pxa/capc7117.c            |   12 ++++----
 arch/arm/mach-pxa/cm-x270.c             |    2 +-
 arch/arm/mach-pxa/cm-x2xx-pci.c         |    4 +-
 arch/arm/mach-pxa/colibri-pxa270.c      |    6 ++--
 arch/arm/mach-pxa/colibri-pxa300.c      |    4 +-
 arch/arm/mach-pxa/colibri-pxa320.c      |    4 +-
 arch/arm/mach-pxa/corgi.c               |    2 +-
 arch/arm/mach-pxa/em-x270.c             |    6 ++--
 arch/arm/mach-pxa/hx4700.c              |   18 +++++++-------
 arch/arm/mach-pxa/icontrol.c            |    8 +++---
 arch/arm/mach-pxa/include/mach/csb726.h |    4 +-
 arch/arm/mach-pxa/include/mach/gpio.h   |    4 +-
 arch/arm/mach-pxa/littleton.c           |    2 +-
 arch/arm/mach-pxa/magician.c            |    8 +++---
 arch/arm/mach-pxa/mioa701.c             |   12 ++++----
 arch/arm/mach-pxa/mxm8x10.c             |    4 +-
 arch/arm/mach-pxa/poodle.c              |    2 +-
 arch/arm/mach-pxa/pxa25x.c              |    2 +-
 arch/arm/mach-pxa/pxa27x.c              |    2 +-
 arch/arm/mach-pxa/raumfeld.c            |   14 +++++-----
 arch/arm/mach-pxa/saar.c                |    6 ++--
 arch/arm/mach-pxa/saarb.c               |    2 +-
 arch/arm/mach-pxa/spitz.c               |    2 +-
 arch/arm/mach-pxa/stargate2.c           |    4 +-
 arch/arm/mach-pxa/tavorevb.c            |    4 +-
 arch/arm/mach-pxa/tavorevb3.c           |    2 +-
 arch/arm/mach-pxa/tosa.c                |    4 +-
 arch/arm/mach-pxa/viper.c               |   16 ++++++------
 arch/arm/mach-pxa/vpac270.c             |    4 +-
 arch/arm/mach-pxa/z2.c                  |    2 +-
 arch/arm/mach-pxa/zeus.c                |   40 +++++++++++++++++-------------
 arch/arm/mach-pxa/zylonite.c            |    4 +-
 arch/arm/plat-pxa/gpio.c                |   13 +++++----
 38 files changed, 124 insertions(+), 117 deletions(-)
arch/arm/mach-mmp/aspenite.c +2 -2
index 2b3b0c6..6b19812 100644
@@ -119,8 +119,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gpio_to_irq(27),
-		.end	= gpio_to_irq(27),
+		.start	= pxa_gpio_to_irq(27),
+		.end	= pxa_gpio_to_irq(27),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-mmp/flint.c +2 -2
index c4fd806..f466a2c 100644
@@ -87,8 +87,8 @@ static struct resource smc91x_resources[] = {
 		.flags  = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start  = gpio_to_irq(155),
-		.end    = gpio_to_irq(155),
+		.start  = pxa_gpio_to_irq(155),
+		.end    = pxa_gpio_to_irq(155),
 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-mmp/include/mach/gpio.h +2 -2
index 7bfb827..5ed6977 100644
@@ -13,8 +13,8 @@
 #define NR_BUILTIN_GPIO		IRQ_GPIO_NUM
 
 #define gpio_to_bank(gpio)	((gpio) >> 5)
-#define gpio_to_irq(gpio)	(IRQ_GPIO_START + (gpio))
-#define irq_to_gpio(irq)	((irq) - IRQ_GPIO_START)
+#define pxa_gpio_to_irq(gpio)	(IRQ_GPIO_START + (gpio))
+#define pxa_irq_to_gpio(irq)	((irq) - IRQ_GPIO_START)
 
 
 #define __gpio_is_inverted(gpio)	(0)
arch/arm/mach-mmp/tavorevb.c +2 -2
index 143e52e..c5e1529 100644
@@ -70,8 +70,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gpio_to_irq(80),
-		.end	= gpio_to_irq(80),
+		.start	= pxa_gpio_to_irq(80),
+		.end	= pxa_gpio_to_irq(80),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-mmp/teton_bga.c +1 -1
index bbe4727..79bbbc2 100644
@@ -66,7 +66,7 @@ static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
 static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
 	{
 		I2C_BOARD_INFO("ds1337", 0x68),
-		.irq = gpio_to_irq(RTC_INT_GPIO)
+		.irq = pxa_gpio_to_irq(RTC_INT_GPIO)
 	},
 };
 
arch/arm/mach-pxa/capc7117.c +6 -6
index 4efc16d..6046eac 100644
@@ -50,8 +50,8 @@ static struct resource capc7117_ide_resources[] = {
 	       .flags = IORESOURCE_MEM
 	},
 	[2] = {
-	       .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
-	       .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
+	       .start = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
+	       .end = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
 	       .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
 	}
 };
@@ -80,7 +80,7 @@ static void __init capc7117_ide_init(void)
 static struct plat_serial8250_port ti16c752_platform_data[] = {
 	[0] = {
 	       .mapbase = 0x14000000,
-	       .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)),
+	       .irq = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)),
 	       .irqflags = IRQF_TRIGGER_RISING,
 	       .flags = TI16C752_FLAGS,
 	       .iotype = UPIO_MEM,
@@ -89,7 +89,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
 	},
 	[1] = {
 	       .mapbase = 0x14000040,
-	       .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)),
+	       .irq = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)),
 	       .irqflags = IRQF_TRIGGER_RISING,
 	       .flags = TI16C752_FLAGS,
 	       .iotype = UPIO_MEM,
@@ -98,7 +98,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
 	},
 	[2] = {
 	       .mapbase = 0x14000080,
-	       .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)),
+	       .irq = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)),
 	       .irqflags = IRQF_TRIGGER_RISING,
 	       .flags = TI16C752_FLAGS,
 	       .iotype = UPIO_MEM,
@@ -107,7 +107,7 @@ static struct plat_serial8250_port ti16c752_platform_data[] = {
 	},
 	[3] = {
 	       .mapbase = 0x140000c0,
-	       .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)),
+	       .irq = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)),
 	       .irqflags = IRQF_TRIGGER_RISING,
 	       .flags = TI16C752_FLAGS,
 	       .iotype = UPIO_MEM,
arch/arm/mach-pxa/cm-x270.c +1 -1
index 13518a7..885e91a 100644
@@ -380,7 +380,7 @@ static struct spi_board_info cm_x270_spi_devices[] __initdata = {
 		.modalias		= "libertas_spi",
 		.max_speed_hz		= 13000000,
 		.bus_num		= 2,
-		.irq			= gpio_to_irq(95),
+		.irq			= pxa_gpio_to_irq(95),
 		.chip_select		= 0,
 		.controller_data	= &cm_x270_libertas_chip,
 		.platform_data		= &cm_x270_libertas_pdata,
arch/arm/mach-pxa/cm-x2xx-pci.c +2 -2
index 6bf479d..9583517 100644
@@ -43,9 +43,9 @@ void __cmx2xx_pci_init_irq(int irq_gpio)
 
 	cmx2xx_it8152_irq_gpio = irq_gpio;
 
-	irq_set_irq_type(gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING);
+	irq_set_irq_type(pxa_gpio_to_irq(irq_gpio), IRQ_TYPE_EDGE_RISING);
 
-	irq_set_chained_handler(gpio_to_irq(irq_gpio),
+	irq_set_chained_handler(pxa_gpio_to_irq(irq_gpio),
 				cmx2xx_it8152_irq_demux);
 }
 
arch/arm/mach-pxa/colibri-pxa270.c +3 -3
index 7db6646..74dbfa6 100644
@@ -217,8 +217,8 @@ static struct resource colibri_pxa270_dm9000_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	{
-		.start	= gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
-		.end	= gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+		.start	= pxa_gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
+		.end	= pxa_gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
 		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
 	},
 };
@@ -248,7 +248,7 @@ static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
 };
 
 static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
-	.irq		= gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ),
+	.irq		= pxa_gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ),
 };
 
 static struct platform_device colibri_pxa270_ucb1400_device = {
arch/arm/mach-pxa/colibri-pxa300.c +2 -2
index c825e8b..3d428eb 100644
@@ -78,8 +78,8 @@ static struct resource colibri_asix_resource[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
-		.end   = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+		.start = pxa_gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+		.end   = pxa_gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
 		.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
 	}
 };
arch/arm/mach-pxa/colibri-pxa320.c +2 -2
index 692e1ff..817c6cb 100644
@@ -115,8 +115,8 @@ static struct resource colibri_asix_resource[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
-		.end   = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+		.start = pxa_gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
+		.end   = pxa_gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
 		.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
 	}
 };
arch/arm/mach-pxa/corgi.c +1 -1
index fcc04dd..88cacd8 100644
@@ -531,7 +531,7 @@ static struct spi_board_info corgi_spi_devices[] = {
 		.chip_select	= 0,
 		.platform_data	= &corgi_ads7846_info,
 		.controller_data= &corgi_ads7846_chip,
-		.irq		= gpio_to_irq(CORGI_GPIO_TP_INT),
+		.irq		= pxa_gpio_to_irq(CORGI_GPIO_TP_INT),
 	}, {
 		.modalias	= "corgi-lcd",
 		.max_speed_hz	= 50000,
arch/arm/mach-pxa/em-x270.c +3 -3
index 94acc0b..a802c2c 100644
@@ -558,7 +558,7 @@ static int em_x270_mci_init(struct device *dev,
 		return PTR_ERR(em_x270_sdio_ldo);
 	}
 
-	err = request_irq(gpio_to_irq(mmc_cd), em_x270_detect_int,
+	err = request_irq(pxa_gpio_to_irq(mmc_cd), em_x270_detect_int,
 			      IRQF_DISABLED | IRQF_TRIGGER_RISING |
 			      IRQF_TRIGGER_FALLING,
 			      "MMC card detect", data);
@@ -588,7 +588,7 @@ static int em_x270_mci_init(struct device *dev,
 	return 0;
 
 err_gpio_wp:
-	free_irq(gpio_to_irq(mmc_cd), data);
+	free_irq(pxa_gpio_to_irq(mmc_cd), data);
 err_irq:
 	regulator_put(em_x270_sdio_ldo);
 
@@ -611,7 +611,7 @@ static void em_x270_mci_setpower(struct device *dev, unsigned int vdd)
 
 static void em_x270_mci_exit(struct device *dev, void *data)
 {
-	free_irq(gpio_to_irq(mmc_cd), data);
+	free_irq(pxa_gpio_to_irq(mmc_cd), data);
 	regulator_put(em_x270_sdio_ldo);
 
 	if (machine_is_em_x270())
arch/arm/mach-pxa/hx4700.c +9 -9
index 6f6368e..03b5ced 100644
@@ -252,8 +252,8 @@ static struct resource asic3_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
-		.end	= gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
+		.start	= pxa_gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
+		.end	= pxa_gpio_to_irq(GPIO12_HX4700_ASIC3_IRQ),
 		.flags	= IORESOURCE_IRQ,
 	},
 	/* SD part */
@@ -263,8 +263,8 @@ static struct resource asic3_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[3] = {
-		.start	= gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
-		.end	= gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
+		.start	= pxa_gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
+		.end	= pxa_gpio_to_irq(GPIO66_HX4700_ASIC3_nSDIO_IRQ),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
@@ -587,7 +587,7 @@ static struct spi_board_info tsc2046_board_info[] __initdata = {
 		.modalias        = "ads7846",
 		.bus_num         = 2,
 		.max_speed_hz    = 2600000, /* 100 kHz sample rate */
-		.irq             = gpio_to_irq(GPIO58_HX4700_TSC2046_nPENIRQ),
+		.irq             = pxa_gpio_to_irq(GPIO58_HX4700_TSC2046_nPENIRQ),
 		.platform_data   = &tsc2046_info,
 		.controller_data = &tsc2046_chip,
 	},
@@ -635,15 +635,15 @@ static struct resource power_supply_resources[] = {
 		.name  = "ac",
 		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
 		         IORESOURCE_IRQ_LOWEDGE,
-		.start = gpio_to_irq(GPIOD9_nAC_IN),
-		.end   = gpio_to_irq(GPIOD9_nAC_IN),
+		.start = pxa_gpio_to_irq(GPIOD9_nAC_IN),
+		.end   = pxa_gpio_to_irq(GPIOD9_nAC_IN),
 	},
 	[1] = {
 		.name  = "usb",
 		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
 		         IORESOURCE_IRQ_LOWEDGE,
-		.start = gpio_to_irq(GPIOD14_nUSBC_DETECT),
-		.end   = gpio_to_irq(GPIOD14_nUSBC_DETECT),
+		.start = pxa_gpio_to_irq(GPIOD14_nUSBC_DETECT),
+		.end   = pxa_gpio_to_irq(GPIOD14_nUSBC_DETECT),
 	},
 };
 
arch/arm/mach-pxa/icontrol.c +4 -4
index f78d5db..c15d095 100644
@@ -86,7 +86,7 @@ static struct spi_board_info mcp251x_board_info[] = {
 		.chip_select     = 0,
 		.platform_data   = &mcp251x_info,
 		.controller_data = &mcp251x_chip_info1,
-		.irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ1)
+		.irq             = pxa_gpio_to_irq(ICONTROL_MCP251x_nIRQ1)
 	},
 	{
 		.modalias        = "mcp2515",
@@ -95,7 +95,7 @@ static struct spi_board_info mcp251x_board_info[] = {
 		.chip_select     = 1,
 		.platform_data   = &mcp251x_info,
 		.controller_data = &mcp251x_chip_info2,
-		.irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ2)
+		.irq             = pxa_gpio_to_irq(ICONTROL_MCP251x_nIRQ2)
 	},
 	{
 		.modalias        = "mcp2515",
@@ -104,7 +104,7 @@ static struct spi_board_info mcp251x_board_info[] = {
 		.chip_select     = 0,
 		.platform_data   = &mcp251x_info,
 		.controller_data = &mcp251x_chip_info3,
-		.irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ3)
+		.irq             = pxa_gpio_to_irq(ICONTROL_MCP251x_nIRQ3)
 	},
 	{
 		.modalias        = "mcp2515",
@@ -113,7 +113,7 @@ static struct spi_board_info mcp251x_board_info[] = {
 		.chip_select     = 1,
 		.platform_data   = &mcp251x_info,
 		.controller_data = &mcp251x_chip_info4,
-		.irq             = gpio_to_irq(ICONTROL_MCP251x_nIRQ4)
+		.irq             = pxa_gpio_to_irq(ICONTROL_MCP251x_nIRQ4)
 	}
 };
 
arch/arm/mach-pxa/include/mach/csb726.h +2 -2
index 747ab1a..ba17e0f 100644
@@ -19,8 +19,8 @@
 #define CSB726_FLASH_SIZE	(64 * 1024 * 1024)
 #define CSB726_FLASH_uMON	(8 * 1024 * 1024)
 
-#define CSB726_IRQ_LAN		gpio_to_irq(CSB726_GPIO_IRQ_LAN)
-#define CSB726_IRQ_SM501	gpio_to_irq(CSB726_GPIO_IRQ_SM501)
+#define CSB726_IRQ_LAN		pxa_gpio_to_irq(CSB726_GPIO_IRQ_LAN)
+#define CSB726_IRQ_SM501	pxa_gpio_to_irq(CSB726_GPIO_IRQ_SM501)
 
 #endif
 
arch/arm/mach-pxa/include/mach/gpio.h +2 -2
index 1b77c11..45ac8e6 100644
@@ -58,9 +58,9 @@
 #define NR_BUILTIN_GPIO		PXA_GPIO_IRQ_NUM
 
 #define gpio_to_bank(gpio)	((gpio) >> 5)
-#define gpio_to_irq(gpio)	IRQ_GPIO(gpio)
+#define pxa_gpio_to_irq(gpio)	IRQ_GPIO(gpio)
 
-static inline int irq_to_gpio(unsigned int irq)
+static inline int pxa_irq_to_gpio(unsigned int irq)
 {
 	int gpio;
 
arch/arm/mach-pxa/littleton.c +1 -1
index 7b324ec..0296e1d 100644
@@ -396,7 +396,7 @@ static struct i2c_board_info littleton_i2c_info[] = {
 		.type		= "da9034",
 		.addr		= 0x34,
 		.platform_data	= &littleton_da9034_info,
-		.irq		= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO18)),
+		.irq		= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO18)),
 	},
 	[1] = {
 		.type		= "max7320",
arch/arm/mach-pxa/magician.c +4 -4
index 4b796c3..e58f9e1 100644
@@ -184,8 +184,8 @@ static struct resource egpio_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
-		.end   = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
+		.start = pxa_gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
+		.end   = pxa_gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -468,8 +468,8 @@ static struct resource pasic3_resources[] = {
 	},
 	/* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
 	[1] = {
-		.start  = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
-		.end    = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
+		.start  = pxa_gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
+		.end    = pxa_gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-pxa/mioa701.c +6 -6
index b938fc2..967ab8d 100644
@@ -314,7 +314,7 @@ static int __init gsm_init(void)
 	rc = gpio_request_array(ARRAY_AND_SIZE(gsm_gpios));
 	if (rc)
 		goto err_gpio;
-	rc = request_irq(gpio_to_irq(GPIO25_GSM_MOD_ON_STATE), gsm_on_irq,
+	rc = request_irq(pxa_gpio_to_irq(GPIO25_GSM_MOD_ON_STATE), gsm_on_irq,
 			 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 			 "GSM XS200 Power Irq", NULL);
 	if (rc)
@@ -333,7 +333,7 @@ err_gpio:
 
 static void gsm_exit(void)
 {
-	free_irq(gpio_to_irq(GPIO25_GSM_MOD_ON_STATE), NULL);
+	free_irq(pxa_gpio_to_irq(GPIO25_GSM_MOD_ON_STATE), NULL);
 	gpio_free_array(ARRAY_AND_SIZE(gsm_gpios));
 }
 
@@ -541,15 +541,15 @@ static struct pda_power_pdata power_pdata = {
 static struct resource power_resources[] = {
 	[0] = {
 		.name	= "ac",
-		.start	= gpio_to_irq(GPIO96_AC_DETECT),
-		.end	= gpio_to_irq(GPIO96_AC_DETECT),
+		.start	= pxa_gpio_to_irq(GPIO96_AC_DETECT),
+		.end	= pxa_gpio_to_irq(GPIO96_AC_DETECT),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
 		IORESOURCE_IRQ_LOWEDGE,
 	},
 	[1] = {
 		.name	= "usb",
-		.start	= gpio_to_irq(GPIO13_nUSB_DETECT),
-		.end	= gpio_to_irq(GPIO13_nUSB_DETECT),
+		.start	= pxa_gpio_to_irq(GPIO13_nUSB_DETECT),
+		.end	= pxa_gpio_to_irq(GPIO13_nUSB_DETECT),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE |
 		IORESOURCE_IRQ_LOWEDGE,
 	},
arch/arm/mach-pxa/mxm8x10.c +2 -2
index 90928d6..ef9901c 100644
@@ -417,8 +417,8 @@ static struct resource dm9k_resources[] = {
 	       .flags = IORESOURCE_MEM
 	},
 	[2] = {
-	       .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
-	       .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
+	       .start = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
+	       .end = pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
 	       .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
 	}
 };
arch/arm/mach-pxa/poodle.c +1 -1
index 79a94fe..469dcd6 100644
@@ -212,7 +212,7 @@ static struct spi_board_info poodle_spi_devices[] = {
 		.bus_num	= 1,
 		.platform_data	= &poodle_ads7846_info,
 		.controller_data= &poodle_ads7846_chip,
-		.irq		= gpio_to_irq(POODLE_GPIO_TP_INT),
+		.irq		= pxa_gpio_to_irq(POODLE_GPIO_TP_INT),
 	},
 };
 
arch/arm/mach-pxa/pxa25x.c +1 -1
index 6bb3fa5..2ae1739 100644
@@ -286,7 +286,7 @@ static inline void pxa25x_init_pm(void) {}
 
 static int pxa25x_set_wake(struct irq_data *d, unsigned int on)
 {
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	uint32_t mask = 0;
 
 	if (gpio >= 0 && gpio < 85)
arch/arm/mach-pxa/pxa27x.c +1 -1
index d2cdcd6..03d0728 100644
@@ -354,7 +354,7 @@ static inline void pxa27x_init_pm(void) {}
  */
 static int pxa27x_set_wake(struct irq_data *d, unsigned int on)
 {
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	uint32_t mask;
 
 	if (gpio >= 0 && gpio < 128)
arch/arm/mach-pxa/raumfeld.c +7 -7
index f0c05f4..ad07ea6 100644
@@ -292,8 +292,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	{
-		.start	= gpio_to_irq(GPIO_ETH_IRQ),
-		.end	= gpio_to_irq(GPIO_ETH_IRQ),
+		.start	= pxa_gpio_to_irq(GPIO_ETH_IRQ),
+		.end	= pxa_gpio_to_irq(GPIO_ETH_IRQ),
 		.flags	= IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
 	}
 };
@@ -672,7 +672,7 @@ static struct lis3lv02d_platform_data lis3_pdata = {
 	.chip_select	= 1,			\
 	.controller_data = (void *) GPIO_ACCEL_CS,	\
 	.platform_data	= &lis3_pdata,		\
-	.irq		= gpio_to_irq(GPIO_ACCEL_IRQ),	\
+	.irq		= pxa_gpio_to_irq(GPIO_ACCEL_IRQ),	\
 }
 
 #define SPI_DAC7512	\
@@ -824,10 +824,10 @@ static void __init raumfeld_power_init(void)
 	else
 		gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
 
-	power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
-	power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
+	power_supply_resources[0].start = pxa_gpio_to_irq(GPIO_CHARGE_DC_OK);
+	power_supply_resources[0].end = pxa_gpio_to_irq(GPIO_CHARGE_DC_OK);
 
-	ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
+	ret = request_irq(pxa_gpio_to_irq(GPIO_CHARGE_DONE),
 			&charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
 			"charge_done", NULL);
 
@@ -956,7 +956,7 @@ static struct eeti_ts_platform_data eeti_ts_pdata = {
 static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
 	.type	= "eeti_ts",
 	.addr	= 0x0a,
-	.irq	= gpio_to_irq(GPIO_TOUCH_IRQ),
+	.irq	= pxa_gpio_to_irq(GPIO_TOUCH_IRQ),
 	.platform_data = &eeti_ts_pdata,
 };
 
arch/arm/mach-pxa/saar.c +3 -3
index fc2c1e0..7345799e 100644
@@ -96,8 +96,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
-		.end	= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
+		.start	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
+		.end	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO97)),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
@@ -502,7 +502,7 @@ static struct i2c_board_info saar_i2c_info[] = {
 		.type		= "da9034",
 		.addr		= 0x34,
 		.platform_data	= &saar_da9034_info,
-		.irq		= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+		.irq		= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
 	},
 };
 
arch/arm/mach-pxa/saarb.c +1 -1
index 87070a8..eb9edd9 100644
@@ -90,7 +90,7 @@ static struct i2c_board_info saarb_i2c_info[] = {
 		.type		= "88PM860x",
 		.addr		= 0x34,
 		.platform_data	= &saarb_pm8607_info,
-		.irq		= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+		.irq		= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
 	},
 };
 
arch/arm/mach-pxa/spitz.c +1 -1
index 29dc9e7..d0caa9f 100644
@@ -552,7 +552,7 @@ static struct spi_board_info spitz_spi_devices[] = {
 		.chip_select		= 0,
 		.platform_data		= &spitz_ads7846_info,
 		.controller_data	= &spitz_ads7846_chip,
-		.irq			= gpio_to_irq(SPITZ_GPIO_TP_INT),
+		.irq			= pxa_gpio_to_irq(SPITZ_GPIO_TP_INT),
 	}, {
 		.modalias		= "corgi-lcd",
 		.max_speed_hz		= 50000,
arch/arm/mach-pxa/stargate2.c +2 -2
index 4c9a48b..8752dc0 100644
@@ -546,7 +546,7 @@ static struct i2c_board_info __initdata imote2_pwr_i2c_board_info[] = {
 		.type = "da9030",
 		.addr = 0x49,
 		.platform_data = &imote2_da9030_pdata,
-		.irq = gpio_to_irq(1),
+		.irq = pxa_gpio_to_irq(1),
 	},
 };
 
@@ -913,7 +913,7 @@ static struct i2c_board_info __initdata stargate2_pwr_i2c_board_info[] = {
 		.type = "da9030",
 		.addr = 0x49,
 		.platform_data = &stargate2_da9030_pdata,
-		.irq = gpio_to_irq(1),
+		.irq = pxa_gpio_to_irq(1),
 	},
 };
 
arch/arm/mach-pxa/tavorevb.c +2 -2
index ad47bb9..7b444e3 100644
@@ -85,8 +85,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
-		.end	= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
+		.start	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
+		.end	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO47)),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-pxa/tavorevb3.c +1 -1
index fd56916..817c9d1 100644
@@ -101,7 +101,7 @@ static struct i2c_board_info evb3_i2c_info[] = {
 		.type		= "88PM860x",
 		.addr		= 0x34,
 		.platform_data	= &evb3_pm8607_info,
-		.irq		= gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+		.irq		= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
 	},
 };
 
arch/arm/mach-pxa/tosa.c +2 -2
index 9f69a26..ac1e4da 100644
@@ -404,8 +404,8 @@ static struct pda_power_pdata tosa_power_data = {
 static struct resource tosa_power_resource[] = {
 	{
 		.name		= "ac",
-		.start		= gpio_to_irq(TOSA_GPIO_AC_IN),
-		.end		= gpio_to_irq(TOSA_GPIO_AC_IN),
+		.start		= pxa_gpio_to_irq(TOSA_GPIO_AC_IN),
+		.end		= pxa_gpio_to_irq(TOSA_GPIO_AC_IN),
 		.flags		= IORESOURCE_IRQ |
 				  IORESOURCE_IRQ_HIGHEDGE |
 				  IORESOURCE_IRQ_LOWEDGE,
arch/arm/mach-pxa/viper.c +8 -8
index 242ddae..6c63069 100644
@@ -315,9 +315,9 @@ static void __init viper_init_irq(void)
 		set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
 	}
 
-	irq_set_chained_handler(gpio_to_irq(VIPER_CPLD_GPIO),
+	irq_set_chained_handler(pxa_gpio_to_irq(VIPER_CPLD_GPIO),
 				viper_irq_handler);
-	irq_set_irq_type(gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH);
+	irq_set_irq_type(pxa_gpio_to_irq(VIPER_CPLD_GPIO), IRQ_TYPE_EDGE_BOTH);
 }
 
 /* Flat Panel */
@@ -422,8 +422,8 @@ static struct resource smc91x_resources[] = {
 		.flags  = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start  = gpio_to_irq(VIPER_ETH_GPIO),
-		.end    = gpio_to_irq(VIPER_ETH_GPIO),
+		.start  = pxa_gpio_to_irq(VIPER_ETH_GPIO),
+		.end    = pxa_gpio_to_irq(VIPER_ETH_GPIO),
 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	},
 	[2] = {
@@ -546,7 +546,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	/* External UARTs */
 	{
 		.mapbase	= VIPER_UARTA_PHYS,
-		.irq		= gpio_to_irq(VIPER_UARTA_GPIO),
+		.irq		= pxa_gpio_to_irq(VIPER_UARTA_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 1843200,
 		.regshift	= 1,
@@ -556,7 +556,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	},
 	{
 		.mapbase	= VIPER_UARTB_PHYS,
-		.irq		= gpio_to_irq(VIPER_UARTB_GPIO),
+		.irq		= pxa_gpio_to_irq(VIPER_UARTB_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 1843200,
 		.regshift	= 1,
@@ -596,8 +596,8 @@ static struct resource isp116x_resources[] = {
 		.flags  = IORESOURCE_MEM,
 	},
 	[2] = {
-		.start  = gpio_to_irq(VIPER_USB_GPIO),
-		.end    = gpio_to_irq(VIPER_USB_GPIO),
+		.start  = pxa_gpio_to_irq(VIPER_USB_GPIO),
+		.end    = pxa_gpio_to_irq(VIPER_USB_GPIO),
 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	},
 };
arch/arm/mach-pxa/vpac270.c +2 -2
index a7539a6..261f258 100644
@@ -610,8 +610,8 @@ static struct resource vpac270_ide_resources[] = {
 	       .flags	= IORESOURCE_DMA
 	},
 	[3] = {	/* IDE IRQ pin */
-	       .start	= gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
-	       .end	= gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
+	       .start	= pxa_gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
+	       .end	= pxa_gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
 	       .flags	= IORESOURCE_IRQ
 	}
 };
arch/arm/mach-pxa/z2.c +1 -1
index 65fed37..4b18474 100644
@@ -573,7 +573,7 @@ static struct spi_board_info spi_board_info[] __initdata = {
 	.modalias		= "libertas_spi",
 	.platform_data		= &z2_lbs_pdata,
 	.controller_data	= &z2_lbs_chip_info,
-	.irq			= gpio_to_irq(GPIO36_ZIPITZ2_WIFI_IRQ),
+	.irq			= pxa_gpio_to_irq(GPIO36_ZIPITZ2_WIFI_IRQ),
 	.max_speed_hz		= 13000000,
 	.bus_num		= 1,
 	.chip_select		= 0,
arch/arm/mach-pxa/zeus.c +23 -17
index c424e7d..dd30cd0 100644
@@ -136,12 +136,16 @@ static void __init zeus_init_irq(void)
 
 	/* Peripheral IRQs. It would be nice to move those inside driver
 	   configuration, but it is not supported@the moment. */
-	irq_set_irq_type(gpio_to_irq(ZEUS_AC97_GPIO), IRQ_TYPE_EDGE_RISING);
-	irq_set_irq_type(gpio_to_irq(ZEUS_WAKEUP_GPIO), IRQ_TYPE_EDGE_RISING);
-	irq_set_irq_type(gpio_to_irq(ZEUS_PTT_GPIO), IRQ_TYPE_EDGE_RISING);
-	irq_set_irq_type(gpio_to_irq(ZEUS_EXTGPIO_GPIO),
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_AC97_GPIO),
+			 IRQ_TYPE_EDGE_RISING);
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_WAKEUP_GPIO),
+			 IRQ_TYPE_EDGE_RISING);
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_PTT_GPIO),
+			 IRQ_TYPE_EDGE_RISING);
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_EXTGPIO_GPIO),
+			 IRQ_TYPE_EDGE_FALLING);
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_CAN_GPIO),
 			 IRQ_TYPE_EDGE_FALLING);
-	irq_set_irq_type(gpio_to_irq(ZEUS_CAN_GPIO), IRQ_TYPE_EDGE_FALLING);
 
 	/* Setup ISA IRQs */
 	for (level = 0; level < ARRAY_SIZE(zeus_isa_irqs); level++) {
@@ -151,8 +155,10 @@ static void __init zeus_init_irq(void)
 		set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
 	}
 
-	irq_set_irq_type(gpio_to_irq(ZEUS_ISA_GPIO), IRQ_TYPE_EDGE_RISING);
-	irq_set_chained_handler(gpio_to_irq(ZEUS_ISA_GPIO), zeus_irq_handler);
+	irq_set_irq_type(pxa_gpio_to_irq(ZEUS_ISA_GPIO),
+			 IRQ_TYPE_EDGE_RISING);
+	irq_set_chained_handler(pxa_gpio_to_irq(ZEUS_ISA_GPIO),
+				zeus_irq_handler);
 }
 
 
@@ -233,7 +239,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	/* FIXME: Shared IRQs on COM1-COM4 will not work properly on v1i1 hardware. */
 	{ /* COM1 */
 		.mapbase	= 0x10000000,
-		.irq		= gpio_to_irq(ZEUS_UARTA_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_UARTA_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 14745600,
 		.regshift	= 1,
@@ -242,7 +248,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	},
 	{ /* COM2 */
 		.mapbase	= 0x10800000,
-		.irq		= gpio_to_irq(ZEUS_UARTB_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_UARTB_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 14745600,
 		.regshift	= 1,
@@ -251,7 +257,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	},
 	{ /* COM3 */
 		.mapbase	= 0x11000000,
-		.irq		= gpio_to_irq(ZEUS_UARTC_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_UARTC_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 14745600,
 		.regshift	= 1,
@@ -260,7 +266,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 	},
 	{ /* COM4 */
 		.mapbase	= 0x11800000,
-		.irq		= gpio_to_irq(ZEUS_UARTD_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_UARTD_GPIO),
 		.irqflags	= IRQF_TRIGGER_RISING,
 		.uartclk	= 14745600,
 		.regshift	= 1,
@@ -321,8 +327,8 @@ static struct resource zeus_dm9k0_resource[] = {
 		.flags = IORESOURCE_MEM
 	},
 	[2] = {
-		.start = gpio_to_irq(ZEUS_ETH0_GPIO),
-		.end   = gpio_to_irq(ZEUS_ETH0_GPIO),
+		.start = pxa_gpio_to_irq(ZEUS_ETH0_GPIO),
+		.end   = pxa_gpio_to_irq(ZEUS_ETH0_GPIO),
 		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
 	},
 };
@@ -339,8 +345,8 @@ static struct resource zeus_dm9k1_resource[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	[2] = {
-		.start = gpio_to_irq(ZEUS_ETH1_GPIO),
-		.end   = gpio_to_irq(ZEUS_ETH1_GPIO),
+		.start = pxa_gpio_to_irq(ZEUS_ETH1_GPIO),
+		.end   = pxa_gpio_to_irq(ZEUS_ETH1_GPIO),
 		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
 	},
 };
@@ -423,7 +429,7 @@ static struct spi_board_info zeus_spi_board_info[] = {
 	[0] = {
 		.modalias	= "mcp2515",
 		.platform_data	= &zeus_mcp2515_pdata,
-		.irq		= gpio_to_irq(ZEUS_CAN_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_CAN_GPIO),
 		.max_speed_hz	= 1*1000*1000,
 		.bus_num	= 3,
 		.mode		= SPI_MODE_0,
@@ -753,7 +759,7 @@ static struct i2c_board_info __initdata zeus_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("pca9535",	0x20),
 		.platform_data	= &zeus_pca953x_pdata[2],
-		.irq		= gpio_to_irq(ZEUS_EXTGPIO_GPIO),
+		.irq		= pxa_gpio_to_irq(ZEUS_EXTGPIO_GPIO),
 	},
 	{ I2C_BOARD_INFO("lm75a",	0x48) },
 	{ I2C_BOARD_INFO("24c01",	0x50) },
arch/arm/mach-pxa/zylonite.c +2 -2
index 6c39c33..28343e0 100644
@@ -408,8 +408,8 @@ static void __init zylonite_init(void)
 	 * Note: We depend that the bootloader set
 	 * the correct value to MSC register for SMC91x.
 	 */
-	smc91x_resources[1].start = gpio_to_irq(gpio_eth_irq);
-	smc91x_resources[1].end   = gpio_to_irq(gpio_eth_irq);
+	smc91x_resources[1].start = pxa_gpio_to_irq(gpio_eth_irq);
+	smc91x_resources[1].end   = pxa_gpio_to_irq(gpio_eth_irq);
 	platform_device_register(&smc91x_device);
 
 	pxa_set_ac97_info(NULL);
arch/arm/plat-pxa/gpio.c +7 -6
index cd6d210..5ab42f8 100644
@@ -156,7 +156,7 @@ static inline void update_edge_detect(struct pxa_gpio_chip *c)
 static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type)
 {
 	struct pxa_gpio_chip *c;
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	unsigned long gpdr, mask = GPIO_bit(gpio);
 
 	c = gpio_to_pxachip(gpio);
@@ -218,7 +218,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
 			while (n < BITS_PER_LONG) {
 				loop = 1;
 
-				generic_handle_irq(gpio_to_irq(gpio_base + n));
+				generic_handle_irq(pxa_gpio_to_irq(gpio_base + n));
 				n = find_next_bit(&gedr, BITS_PER_LONG, n + 1);
 			}
 		}
@@ -227,7 +227,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
 
 static void pxa_ack_muxed_gpio(struct irq_data *d)
 {
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
 
 	__raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET);
@@ -235,7 +235,7 @@ static void pxa_ack_muxed_gpio(struct irq_data *d)
 
 static void pxa_mask_muxed_gpio(struct irq_data *d)
 {
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
 	uint32_t grer, gfer;
 
@@ -249,7 +249,7 @@ static void pxa_mask_muxed_gpio(struct irq_data *d)
 
 static void pxa_unmask_muxed_gpio(struct irq_data *d)
 {
-	int gpio = irq_to_gpio(d->irq);
+	int gpio = pxa_irq_to_gpio(d->irq);
 	struct pxa_gpio_chip *c = gpio_to_pxachip(gpio);
 
 	c->irq_mask |= GPIO_bit(gpio);
@@ -282,7 +282,8 @@ void __init pxa_init_gpio(int mux_irq, int start, int end,
 		__raw_writel(~0,c->regbase + GEDR_OFFSET);
 	}
 
-	for (irq  = gpio_to_irq(start); irq <= gpio_to_irq(end); irq++) {
+	for (irq  = pxa_gpio_to_irq(start); irq <= pxa_gpio_to_irq(end);
+		irq++) {
 		irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
 					 handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
Signature · 1 line
1.7.2.5
#4 lore raw

PATCH v2 4/5 ARM: pxa: use chained irq for GPIO0 and GPIO1

In reply to Haojian Zhuang

Change interrupt of GPIO0 and GPIO1 to chained interrupt. So irq chip of gpio could be removed from irq.c. So pxa_gpio_to_irq() could be simplified.

Since IRQ_GPIO() is similar to pxa_gpio_to_irq(), remove IRQ_GPIO().

---
 arch/arm/mach-mmp/include/mach/gpio.h             |    3 -
 arch/arm/mach-mmp/include/mach/irqs.h             |    3 +-
 arch/arm/mach-mmp/ttc_dkb.c                       |    2 +-
 arch/arm/mach-pxa/am200epd.c                      |    4 +-
 arch/arm/mach-pxa/am300epd.c                      |    4 +-
 arch/arm/mach-pxa/balloon3.c                      |    2 +-
 arch/arm/mach-pxa/cm-x270.c                       |    2 +-
 arch/arm/mach-pxa/cm-x2xx.c                       |    4 +-
 arch/arm/mach-pxa/cm-x300.c                       |    6 +-
 arch/arm/mach-pxa/em-x270.c                       |    6 +-
 arch/arm/mach-pxa/eseries.c                       |    4 +-
 arch/arm/mach-pxa/idp.c                           |    4 +-
 arch/arm/mach-pxa/include/mach/balloon3.h         |    6 +-
 arch/arm/mach-pxa/include/mach/corgi.h            |   24 ++++----
 arch/arm/mach-pxa/include/mach/gpio.h             |   15 -----
 arch/arm/mach-pxa/include/mach/gumstix.h          |   20 ++++----
 arch/arm/mach-pxa/include/mach/idp.h              |   14 +++---
 arch/arm/mach-pxa/include/mach/irqs.h             |    4 +-
 arch/arm/mach-pxa/include/mach/palmld.h           |    8 ++--
 arch/arm/mach-pxa/include/mach/palmt5.h           |    8 ++--
 arch/arm/mach-pxa/include/mach/palmtc.h           |    4 +-
 arch/arm/mach-pxa/include/mach/palmtx.h           |    8 ++--
 arch/arm/mach-pxa/include/mach/pcm027.h           |    8 ++--
 arch/arm/mach-pxa/include/mach/pcm990_baseboard.h |   14 +++---
 arch/arm/mach-pxa/include/mach/poodle.h           |   24 ++++----
 arch/arm/mach-pxa/include/mach/spitz.h            |   34 ++++++------
 arch/arm/mach-pxa/include/mach/tosa.h             |   46 ++++++++--------
 arch/arm/mach-pxa/include/mach/trizeps4.h         |   16 +++---
 arch/arm/mach-pxa/irq.c                           |   61 ---------------------
 arch/arm/mach-pxa/littleton.c                     |    4 +-
 arch/arm/mach-pxa/lpd270.c                        |    4 +-
 arch/arm/mach-pxa/lubbock.c                       |    4 +-
 arch/arm/mach-pxa/mainstone.c                     |    4 +-
 arch/arm/mach-pxa/poodle.c                        |    4 +-
 arch/arm/mach-pxa/sharpsl_pm.c                    |   24 ++++----
 arch/arm/mach-pxa/stargate2.c                     |   22 ++++----
 arch/arm/mach-pxa/vpac270.c                       |    6 +-
 arch/arm/mach-pxa/zylonite_pxa300.c               |    4 +-
 arch/arm/plat-pxa/gpio.c                          |   14 +++++
 39 files changed, 192 insertions(+), 256 deletions(-)
arch/arm/mach-mmp/include/mach/gpio.h +0 -3
index 5ed6977..89d499e 100644
@@ -13,9 +13,6 @@
 #define NR_BUILTIN_GPIO		IRQ_GPIO_NUM
 
 #define gpio_to_bank(gpio)	((gpio) >> 5)
-#define pxa_gpio_to_irq(gpio)	(IRQ_GPIO_START + (gpio))
-#define pxa_irq_to_gpio(irq)	((irq) - IRQ_GPIO_START)
-
 
 #define __gpio_is_inverted(gpio)	(0)
 #define __gpio_is_occupied(gpio)	(0)
arch/arm/mach-mmp/include/mach/irqs.h +2 -1
index a09d328..2971a00 100644
@@ -220,7 +220,8 @@
 
 #define IRQ_GPIO_START			128
 #define IRQ_GPIO_NUM			192
-#define IRQ_GPIO(x)			(IRQ_GPIO_START + (x))
+#define pxa_gpio_to_irq(gpio)		(IRQ_GPIO_START + (gpio))
+#define pxa_irq_to_gpio(irq)		((irq) - IRQ_GPIO_START)
 
 #define IRQ_BOARD_START			(IRQ_GPIO_START + IRQ_GPIO_NUM)
 
arch/arm/mach-mmp/ttc_dkb.c +1 -1
index 176515a..a420b07 100644
@@ -136,7 +136,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
 	{
 		.type		= "max7312",
 		.addr		= 0x23,
-		.irq		= IRQ_GPIO(80),
+		.irq		= pxa_gpio_to_irq(80),
 		.platform_data	= &max7312_data,
 	},
 };
arch/arm/mach-pxa/am200epd.c +2 -2
index 4cb069f..e69da52 100644
@@ -138,7 +138,7 @@ static void am200_cleanup(struct metronomefb_par *par)
 {
 	int i;
 
-	free_irq(IRQ_GPIO(RDY_GPIO_PIN), par);
+	free_irq(pxa_gpio_to_irq(RDY_GPIO_PIN), par);
 
 	for (i = 0; i < ARRAY_SIZE(gpios); i++)
 		gpio_free(gpios[i]);
@@ -292,7 +292,7 @@ static int am200_setup_irq(struct fb_info *info)
 {
 	int ret;
 
-	ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am200_handle_irq,
+	ret = request_irq(pxa_gpio_to_irq(RDY_GPIO_PIN), am200_handle_irq,
 				IRQF_DISABLED|IRQF_TRIGGER_FALLING,
 				"AM200", info->par);
 	if (ret)
arch/arm/mach-pxa/am300epd.c +2 -2
index fa8bad2..aba8193 100644
@@ -176,7 +176,7 @@ static void am300_cleanup(struct broadsheetfb_par *par)
 {
 	int i;
 
-	free_irq(IRQ_GPIO(RDY_GPIO_PIN), par);
+	free_irq(pxa_gpio_to_irq(RDY_GPIO_PIN), par);
 
 	for (i = 0; i < ARRAY_SIZE(gpios); i++)
 		gpio_free(gpios[i]);
@@ -240,7 +240,7 @@ static int am300_setup_irq(struct fb_info *info)
 	int ret;
 	struct broadsheetfb_par *par = info->par;
 
-	ret = request_irq(IRQ_GPIO(RDY_GPIO_PIN), am300_handle_irq,
+	ret = request_irq(pxa_gpio_to_irq(RDY_GPIO_PIN), am300_handle_irq,
 				IRQF_DISABLED|IRQF_TRIGGER_RISING,
 				"AM300", par);
 	if (ret)
arch/arm/mach-pxa/balloon3.c +1 -1
index 7765d67..f992ace 100644
@@ -179,7 +179,7 @@ static unsigned long balloon3_ac97_pin_config[] __initdata = {
 };
 
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
-	.irq		= IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ),
+	.irq		= pxa_gpio_to_irq(BALLOON3_GPIO_CODEC_IRQ),
 };
 
 
arch/arm/mach-pxa/cm-x270.c +1 -1
index 885e91a..7065df5 100644
@@ -33,7 +33,7 @@
 /* GPIO IRQ usage */
 #define GPIO83_MMC_IRQ		(83)
 
-#define CMX270_MMC_IRQ		IRQ_GPIO(GPIO83_MMC_IRQ)
+#define CMX270_MMC_IRQ		pxa_gpio_to_irq(GPIO83_MMC_IRQ)
 
 /* MMC power enable */
 #define GPIO105_MMC_POWER	(105)
arch/arm/mach-pxa/cm-x2xx.c +2 -2
index 349896c..ed2689a 100644
@@ -58,8 +58,8 @@ extern void cmx270_init(void);
 #define CMX255_GPIO_IT8152_IRQ	(0)
 #define CMX270_GPIO_IT8152_IRQ	(22)
 
-#define CMX255_ETHIRQ		IRQ_GPIO(GPIO22_ETHIRQ)
-#define CMX270_ETHIRQ		IRQ_GPIO(GPIO10_ETHIRQ)
+#define CMX255_ETHIRQ		pxa_gpio_to_irq(GPIO22_ETHIRQ)
+#define CMX270_ETHIRQ		pxa_gpio_to_irq(GPIO10_ETHIRQ)
 
 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
 static struct resource cmx255_dm9000_resource[] = {
arch/arm/mach-pxa/cm-x300.c +3 -3
index 0f00e01..934c29a 100644
@@ -64,7 +64,7 @@
 #define GPIO82_MMC_IRQ		(82)
 #define GPIO85_MMC_WP		(85)
 
-#define	CM_X300_MMC_IRQ		IRQ_GPIO(GPIO82_MMC_IRQ)
+#define	CM_X300_MMC_IRQ		pxa_gpio_to_irq(GPIO82_MMC_IRQ)
 
 #define GPIO95_RTC_CS		(95)
 #define GPIO96_RTC_WR		(96)
@@ -229,8 +229,8 @@ static struct resource dm9000_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[2] = {
-		.start	= IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)),
-		.end	= IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO99)),
+		.start	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO99)),
+		.end	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO99)),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-pxa/em-x270.c +3 -3
index a802c2c..3c08f2f 100644
@@ -70,7 +70,7 @@
 /* common  GPIOs */
 #define GPIO11_NAND_CS		(11)
 #define GPIO41_ETHIRQ		(41)
-#define EM_X270_ETHIRQ		IRQ_GPIO(GPIO41_ETHIRQ)
+#define EM_X270_ETHIRQ		pxa_gpio_to_irq(GPIO41_ETHIRQ)
 #define GPIO115_WLAN_PWEN	(115)
 #define GPIO19_WLAN_STRAP	(19)
 #define GPIO9_USB_VBUS_EN	(9)
@@ -805,7 +805,7 @@ static struct spi_board_info em_x270_spi_devices[] __initdata = {
 		.modalias		= "libertas_spi",
 		.max_speed_hz		= 13000000,
 		.bus_num		= 2,
-		.irq			= IRQ_GPIO(116),
+		.irq			= pxa_gpio_to_irq(116),
 		.chip_select		= 0,
 		.controller_data	= &em_x270_libertas_chip,
 		.platform_data		= &em_x270_libertas_pdata,
@@ -1203,7 +1203,7 @@ static struct da903x_platform_data em_x270_da9030_info = {
 
 static struct i2c_board_info em_x270_i2c_pmic_info = {
 	I2C_BOARD_INFO("da9030", 0x49),
-	.irq = IRQ_GPIO(0),
+	.irq = pxa_gpio_to_irq(0),
 	.platform_data = &em_x270_da9030_info,
 };
 
arch/arm/mach-pxa/eseries.c +2 -2
index e823c54..fc26443 100644
@@ -120,8 +120,8 @@ struct resource eseries_tmio_resources[] = {
 		.flags  = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start  = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
-		.end    = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ),
+		.start  = pxa_gpio_to_irq(GPIO_ESERIES_TMIO_IRQ),
+		.end    = pxa_gpio_to_irq(GPIO_ESERIES_TMIO_IRQ),
 		.flags  = IORESOURCE_IRQ,
 	},
 };
arch/arm/mach-pxa/idp.c +2 -2
index ddf20e5..f2e210f 100644
@@ -75,8 +75,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= IRQ_GPIO(4),
-		.end	= IRQ_GPIO(4),
+		.start	= pxa_gpio_to_irq(4),
+		.end	= pxa_gpio_to_irq(4),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
arch/arm/mach-pxa/include/mach/balloon3.h +3 -3
index 7074e76..6844342 100644
@@ -172,9 +172,9 @@ enum balloon3_features {
 /* Balloon3 Interrupts */
 #define BALLOON3_IRQ(x)		(IRQ_BOARD_START + (x))
 
-#define BALLOON3_AUX_NIRQ	IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
-#define BALLOON3_CODEC_IRQ	IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
-#define BALLOON3_S0_CD_IRQ	IRQ_GPIO(BALLOON3_GPIO_S0_CD)
+#define BALLOON3_AUX_NIRQ	pxa_gpio_to_irq(BALLOON3_GPIO_AUX_NIRQ)
+#define BALLOON3_CODEC_IRQ	pxa_gpio_to_irq(BALLOON3_GPIO_CODEC_IRQ)
+#define BALLOON3_S0_CD_IRQ	pxa_gpio_to_irq(BALLOON3_GPIO_S0_CD)
 
 #define BALLOON3_NR_IRQS	(IRQ_BOARD_START + 16)
 
arch/arm/mach-pxa/include/mach/corgi.h +12 -12
index 5dfd119..baf4aff 100644
@@ -66,18 +66,18 @@
 /*
  * Corgi Interrupts
  */
-#define CORGI_IRQ_GPIO_KEY_INT		IRQ_GPIO(0)
-#define CORGI_IRQ_GPIO_AC_IN		IRQ_GPIO(1)
-#define CORGI_IRQ_GPIO_WAKEUP		IRQ_GPIO(3)
-#define CORGI_IRQ_GPIO_AK_INT		IRQ_GPIO(4)
-#define CORGI_IRQ_GPIO_TP_INT		IRQ_GPIO(5)
-#define CORGI_IRQ_GPIO_nSD_DETECT	IRQ_GPIO(9)
-#define CORGI_IRQ_GPIO_nSD_INT		IRQ_GPIO(10)
-#define CORGI_IRQ_GPIO_MAIN_BAT_LOW	IRQ_GPIO(11)
-#define CORGI_IRQ_GPIO_CF_CD		IRQ_GPIO(14)
-#define CORGI_IRQ_GPIO_CHRG_FULL	IRQ_GPIO(16)	/* Battery fully charged */
-#define CORGI_IRQ_GPIO_CF_IRQ		IRQ_GPIO(17)
-#define CORGI_IRQ_GPIO_KEY_SENSE(a)	IRQ_GPIO(58+(a))	/* Keyboard Sense lines */
+#define CORGI_IRQ_GPIO_KEY_INT		pxa_gpio_to_irq(0)
+#define CORGI_IRQ_GPIO_AC_IN		pxa_gpio_to_irq(1)
+#define CORGI_IRQ_GPIO_WAKEUP		pxa_gpio_to_irq(3)
+#define CORGI_IRQ_GPIO_AK_INT		pxa_gpio_to_irq(4)
+#define CORGI_IRQ_GPIO_TP_INT		pxa_gpio_to_irq(5)
+#define CORGI_IRQ_GPIO_nSD_DETECT	pxa_gpio_to_irq(9)
+#define CORGI_IRQ_GPIO_nSD_INT		pxa_gpio_to_irq(10)
+#define CORGI_IRQ_GPIO_MAIN_BAT_LOW	pxa_gpio_to_irq(11)
+#define CORGI_IRQ_GPIO_CF_CD		pxa_gpio_to_irq(14)
+#define CORGI_IRQ_GPIO_CHRG_FULL	pxa_gpio_to_irq(16)	/* Battery fully charged */
+#define CORGI_IRQ_GPIO_CF_IRQ		pxa_gpio_to_irq(17)
+#define CORGI_IRQ_GPIO_KEY_SENSE(a)	pxa_gpio_to_irq(58+(a))	/* Keyboard Sense lines */
 
 
 /*
arch/arm/mach-pxa/include/mach/gpio.h +0 -15
index 45ac8e6..d58efb5 100644
@@ -58,21 +58,6 @@
 #define NR_BUILTIN_GPIO		PXA_GPIO_IRQ_NUM
 
 #define gpio_to_bank(gpio)	((gpio) >> 5)
-#define pxa_gpio_to_irq(gpio)	IRQ_GPIO(gpio)
-
-static inline int pxa_irq_to_gpio(unsigned int irq)
-{
-	int gpio;
-
-	if (irq == IRQ_GPIO0 || irq == IRQ_GPIO1)
-		return irq - IRQ_GPIO0;
-
-	gpio = irq - PXA_GPIO_IRQ_BASE;
-	if (gpio >= 2 && gpio < NR_BUILTIN_GPIO)
-		return gpio;
-
-	return -1;
-}
 
 #ifdef CONFIG_CPU_PXA26x
 /* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
arch/arm/mach-pxa/include/mach/gumstix.h +10 -10
index 9b89868..c52d751 100644
@@ -24,7 +24,7 @@ has detected a cable insertion; driven low otherwise. */
 #define GPIO_GUMSTIX_USB_GPIOx		41
 
 /* usb state change */
-#define GUMSTIX_USB_INTR_IRQ		IRQ_GPIO(GPIO_GUMSTIX_USB_GPIOn)
+#define GUMSTIX_USB_INTR_IRQ		pxa_gpio_to_irq(GPIO_GUMSTIX_USB_GPIOn)
 
 #define GPIO_GUMSTIX_USB_GPIOn_MD	(GPIO_GUMSTIX_USB_GPIOn | GPIO_IN)
 #define GPIO_GUMSTIX_USB_GPIOx_CON_MD	(GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
@@ -35,7 +35,7 @@ has detected a cable insertion; driven low otherwise. */
  */
 #define GUMSTIX_GPIO_nSD_WP		22 /* SD Write Protect */
 #define GUMSTIX_GPIO_nSD_DETECT		11 /* MMC/SD Card Detect */
-#define GUMSTIX_IRQ_GPIO_nSD_DETECT	IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
+#define GUMSTIX_IRQ_GPIO_nSD_DETECT	pxa_gpio_to_irq(GUMSTIX_GPIO_nSD_DETECT)
 
 /*
  * SMC Ethernet definitions
@@ -49,10 +49,10 @@ has detected a cable insertion; driven low otherwise. */
 
 #define GPIO_GUMSTIX_ETH0		36
 #define GPIO_GUMSTIX_ETH0_MD		(GPIO_GUMSTIX_ETH0 | GPIO_IN)
-#define GUMSTIX_ETH0_IRQ		IRQ_GPIO(GPIO_GUMSTIX_ETH0)
+#define GUMSTIX_ETH0_IRQ		pxa_gpio_to_irq(GPIO_GUMSTIX_ETH0)
 #define GPIO_GUMSTIX_ETH1		27
 #define GPIO_GUMSTIX_ETH1_MD		(GPIO_GUMSTIX_ETH1 | GPIO_IN)
-#define GUMSTIX_ETH1_IRQ		IRQ_GPIO(GPIO_GUMSTIX_ETH1)
+#define GUMSTIX_ETH1_IRQ		pxa_gpio_to_irq(GPIO_GUMSTIX_ETH1)
 
 
 /* CF reset line */
@@ -63,18 +63,18 @@ has detected a cable insertion; driven low otherwise. */
 #define GPIO4_nSTSCHG			GPIO4_nBVD1
 #define GPIO11_nCD			11
 #define GPIO26_PRDY_nBSY		26
-#define GUMSTIX_S0_nSTSCHG_IRQ		IRQ_GPIO(GPIO4_nSTSCHG)
-#define GUMSTIX_S0_nCD_IRQ		IRQ_GPIO(GPIO11_nCD)
-#define GUMSTIX_S0_PRDY_nBSY_IRQ	IRQ_GPIO(GPIO26_PRDY_nBSY)
+#define GUMSTIX_S0_nSTSCHG_IRQ		pxa_gpio_to_irq(GPIO4_nSTSCHG)
+#define GUMSTIX_S0_nCD_IRQ		pxa_gpio_to_irq(GPIO11_nCD)
+#define GUMSTIX_S0_PRDY_nBSY_IRQ	pxa_gpio_to_irq(GPIO26_PRDY_nBSY)
 
 /* CF slot 1 */
 #define GPIO18_nBVD1			18
 #define GPIO18_nSTSCHG			GPIO18_nBVD1
 #define GPIO36_nCD			36
 #define GPIO27_PRDY_nBSY		27
-#define GUMSTIX_S1_nSTSCHG_IRQ		IRQ_GPIO(GPIO18_nSTSCHG)
-#define GUMSTIX_S1_nCD_IRQ		IRQ_GPIO(GPIO36_nCD)
-#define GUMSTIX_S1_PRDY_nBSY_IRQ	IRQ_GPIO(GPIO27_PRDY_nBSY)
+#define GUMSTIX_S1_nSTSCHG_IRQ		pxa_gpio_to_irq(GPIO18_nSTSCHG)
+#define GUMSTIX_S1_nCD_IRQ		pxa_gpio_to_irq(GPIO36_nCD)
+#define GUMSTIX_S1_PRDY_nBSY_IRQ	pxa_gpio_to_irq(GPIO27_PRDY_nBSY)
 
 /* CF GPIO line modes */
 #define GPIO4_nSTSCHG_MD		(GPIO4_nSTSCHG | GPIO_IN)
arch/arm/mach-pxa/include/mach/idp.h +7 -7
index 5eff96f..ce3655c 100644
@@ -135,24 +135,24 @@
 
 /* A listing of interrupts used by external hardware devices */
 
-#define TOUCH_PANEL_IRQ			IRQ_GPIO(5)
-#define IDE_IRQ				IRQ_GPIO(21)
+#define TOUCH_PANEL_IRQ			pxa_gpio_to_irq(5)
+#define IDE_IRQ				pxa_gpio_to_irq(21)
 
 #define TOUCH_PANEL_IRQ_EDGE		IRQ_TYPE_EDGE_FALLING
 
-#define ETHERNET_IRQ			IRQ_GPIO(4)
+#define ETHERNET_IRQ			pxa_gpio_to_irq(4)
 #define ETHERNET_IRQ_EDGE		IRQ_TYPE_EDGE_RISING
 
 #define IDE_IRQ_EDGE			IRQ_TYPE_EDGE_RISING
 
-#define PCMCIA_S0_CD_VALID		IRQ_GPIO(7)
+#define PCMCIA_S0_CD_VALID		pxa_gpio_to_irq(7)
 #define PCMCIA_S0_CD_VALID_EDGE		IRQ_TYPE_EDGE_BOTH
 
-#define PCMCIA_S1_CD_VALID		IRQ_GPIO(8)
+#define PCMCIA_S1_CD_VALID		pxa_gpio_to_irq(8)
 #define PCMCIA_S1_CD_VALID_EDGE		IRQ_TYPE_EDGE_BOTH
 
-#define PCMCIA_S0_RDYINT		IRQ_GPIO(19)
-#define PCMCIA_S1_RDYINT		IRQ_GPIO(22)
+#define PCMCIA_S0_RDYINT		pxa_gpio_to_irq(19)
+#define PCMCIA_S1_RDYINT		pxa_gpio_to_irq(22)
 
 
 /*
arch/arm/mach-pxa/include/mach/irqs.h +2 -2
index 7cc5a78..9e0f1b7d 100644
@@ -90,8 +90,8 @@
 #define PXA_GPIO_IRQ_BASE	PXA_IRQ(96)
 #define PXA_GPIO_IRQ_NUM	(192)
 
-#define GPIO_2_x_TO_IRQ(x)	(PXA_GPIO_IRQ_BASE + (x))
-#define IRQ_GPIO(x)	(((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))
+#define pxa_gpio_to_irq(gpio)	(PXA_GPIO_IRQ_BASE + (gpio))
+#define pxa_irq_to_gpio(irq)	((irq) - PXA_GPIO_IRQ_BASE)
 
 /*
  * The following interrupts are for board specific purposes. Since
arch/arm/mach-pxa/include/mach/palmld.h +4 -4
index ae536e8..8ed3103 100644
@@ -68,10 +68,10 @@
 /* 20, 53 and 86 are usb related too */
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMLD_GPIO_RESET	IRQ_GPIO(GPIO_NR_PALMLD_GPIO_RESET)
-#define IRQ_GPIO_PALMLD_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMLD_SD_DETECT_N)
-#define IRQ_GPIO_PALMLD_WM9712_IRQ	IRQ_GPIO(GPIO_NR_PALMLD_WM9712_IRQ)
-#define IRQ_GPIO_PALMLD_IDE_IRQ		IRQ_GPIO(GPIO_NR_PALMLD_IDE_IRQ)
+#define IRQ_GPIO_PALMLD_GPIO_RESET	pxa_gpio_to_irq(GPIO_NR_PALMLD_GPIO_RESET)
+#define IRQ_GPIO_PALMLD_SD_DETECT_N	pxa_gpio_to_irq(GPIO_NR_PALMLD_SD_DETECT_N)
+#define IRQ_GPIO_PALMLD_WM9712_IRQ	pxa_gpio_to_irq(GPIO_NR_PALMLD_WM9712_IRQ)
+#define IRQ_GPIO_PALMLD_IDE_IRQ		pxa_gpio_to_irq(GPIO_NR_PALMLD_IDE_IRQ)
 
 
 /** HERE ARE INIT VALUES **/
arch/arm/mach-pxa/include/mach/palmt5.h +4 -4
index 6baf746..649776c 100644
@@ -48,10 +48,10 @@
 #define GPIO_NR_PALMT5_BT_RESET			83
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMT5_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMT5_SD_DETECT_N)
-#define IRQ_GPIO_PALMT5_WM9712_IRQ	IRQ_GPIO(GPIO_NR_PALMT5_WM9712_IRQ)
-#define IRQ_GPIO_PALMT5_USB_DETECT	IRQ_GPIO(GPIO_NR_PALMT5_USB_DETECT)
-#define IRQ_GPIO_PALMT5_GPIO_RESET	IRQ_GPIO(GPIO_NR_PALMT5_GPIO_RESET)
+#define IRQ_GPIO_PALMT5_SD_DETECT_N	pxa_gpio_to_irq(GPIO_NR_PALMT5_SD_DETECT_N)
+#define IRQ_GPIO_PALMT5_WM9712_IRQ	pxa_gpio_to_irq(GPIO_NR_PALMT5_WM9712_IRQ)
+#define IRQ_GPIO_PALMT5_USB_DETECT	pxa_gpio_to_irq(GPIO_NR_PALMT5_USB_DETECT)
+#define IRQ_GPIO_PALMT5_GPIO_RESET	pxa_gpio_to_irq(GPIO_NR_PALMT5_GPIO_RESET)
 
 /** HERE ARE INIT VALUES **/
 
arch/arm/mach-pxa/include/mach/palmtc.h +2 -2
index 3f9dd3f..6db872b 100644
@@ -52,8 +52,8 @@
 #define GPIO_NR_PALMTC_IR_DISABLE	45
 
 /* IRQs */
-#define IRQ_GPIO_PALMTC_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMTC_SD_DETECT_N)
-#define IRQ_GPIO_PALMTC_WLAN_READY	IRQ_GPIO(GPIO_NR_PALMTC_WLAN_READY)
+#define IRQ_GPIO_PALMTC_SD_DETECT_N	pxa_gpio_to_irq(GPIO_NR_PALMTC_SD_DETECT_N)
+#define IRQ_GPIO_PALMTC_WLAN_READY	pxa_gpio_to_irq(GPIO_NR_PALMTC_WLAN_READY)
 
 /* UCB1400 GPIOs */
 #define GPIO_NR_PALMTC_POWER_DETECT	(0x80 | 0x00)
arch/arm/mach-pxa/include/mach/palmtx.h +4 -4
index 10abc4f..e8643ec 100644
@@ -62,10 +62,10 @@
 #define GPIO_NR_PALMTX_NAND_BUFFER_DIR		79
 
 /* INTERRUPTS */
-#define IRQ_GPIO_PALMTX_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMTX_SD_DETECT_N)
-#define IRQ_GPIO_PALMTX_WM9712_IRQ	IRQ_GPIO(GPIO_NR_PALMTX_WM9712_IRQ)
-#define IRQ_GPIO_PALMTX_USB_DETECT	IRQ_GPIO(GPIO_NR_PALMTX_USB_DETECT)
-#define IRQ_GPIO_PALMTX_GPIO_RESET	IRQ_GPIO(GPIO_NR_PALMTX_GPIO_RESET)
+#define IRQ_GPIO_PALMTX_SD_DETECT_N	pxa_gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N)
+#define IRQ_GPIO_PALMTX_WM9712_IRQ	pxa_gpio_to_irq(GPIO_NR_PALMTX_WM9712_IRQ)
+#define IRQ_GPIO_PALMTX_USB_DETECT	pxa_gpio_to_irq(GPIO_NR_PALMTX_USB_DETECT)
+#define IRQ_GPIO_PALMTX_GPIO_RESET	pxa_gpio_to_irq(GPIO_NR_PALMTX_GPIO_RESET)
 
 /** HERE ARE INIT VALUES **/
 
arch/arm/mach-pxa/include/mach/pcm027.h +4 -4
index 4bac588..b9d8903 100644
@@ -34,7 +34,7 @@
 
 /* I2C RTC */
 #define PCM027_RTC_IRQ_GPIO	0
-#define PCM027_RTC_IRQ		IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
+#define PCM027_RTC_IRQ		pxa_gpio_to_irq(PCM027_RTC_IRQ_GPIO)
 #define PCM027_RTC_IRQ_EDGE	IRQ_TYPE_EDGE_FALLING
 #define ADR_PCM027_RTC		0x51	/* I2C address */
 
@@ -43,21 +43,21 @@
 
 /* Ethernet chip (SMSC91C111) */
 #define PCM027_ETH_IRQ_GPIO	52
-#define PCM027_ETH_IRQ		IRQ_GPIO(PCM027_ETH_IRQ_GPIO)
+#define PCM027_ETH_IRQ		pxa_gpio_to_irq(PCM027_ETH_IRQ_GPIO)
 #define PCM027_ETH_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 #define PCM027_ETH_PHYS		PXA_CS5_PHYS
 #define PCM027_ETH_SIZE		(1*1024*1024)
 
 /* CAN controller SJA1000 (unsupported yet) */
 #define PCM027_CAN_IRQ_GPIO	114
-#define PCM027_CAN_IRQ		IRQ_GPIO(PCM027_CAN_IRQ_GPIO)
+#define PCM027_CAN_IRQ		pxa_gpio_to_irq(PCM027_CAN_IRQ_GPIO)
 #define PCM027_CAN_IRQ_EDGE	IRQ_TYPE_EDGE_FALLING
 #define PCM027_CAN_PHYS		0x22000000
 #define PCM027_CAN_SIZE		0x100
 
 /* SPI GPIO expander (unsupported yet) */
 #define PCM027_EGPIO_IRQ_GPIO	27
-#define PCM027_EGPIO_IRQ	IRQ_GPIO(PCM027_EGPIO_IRQ_GPIO)
+#define PCM027_EGPIO_IRQ	pxa_gpio_to_irq(PCM027_EGPIO_IRQ_GPIO)
 #define PCM027_EGPIO_IRQ_EDGE	IRQ_TYPE_EDGE_FALLING
 #define PCM027_EGPIO_CS		24
 /*
arch/arm/mach-pxa/include/mach/pcm990_baseboard.h +7 -7
index 8a4383b..3b3c94e 100644
@@ -28,14 +28,14 @@
 
 /* CPLD's interrupt controller is connected to PCM-027 GPIO 9 */
 #define PCM990_CTRL_INT_IRQ_GPIO	9
-#define PCM990_CTRL_INT_IRQ		IRQ_GPIO(PCM990_CTRL_INT_IRQ_GPIO)
+#define PCM990_CTRL_INT_IRQ		pxa_gpio_to_irq(PCM990_CTRL_INT_IRQ_GPIO)
 #define PCM990_CTRL_INT_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 #define PCM990_CTRL_PHYS		PXA_CS1_PHYS	/* 16-Bit */
 #define PCM990_CTRL_BASE		0xea000000
 #define PCM990_CTRL_SIZE		(1*1024*1024)
 
 #define PCM990_CTRL_PWR_IRQ_GPIO	14
-#define PCM990_CTRL_PWR_IRQ		IRQ_GPIO(PCM990_CTRL_PWR_IRQ_GPIO)
+#define PCM990_CTRL_PWR_IRQ		pxa_gpio_to_irq(PCM990_CTRL_PWR_IRQ_GPIO)
 #define PCM990_CTRL_PWR_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 
 /* visible CPLD (U7) registers */
@@ -132,7 +132,7 @@
  * IDE
  */
 #define PCM990_IDE_IRQ_GPIO	13
-#define PCM990_IDE_IRQ		IRQ_GPIO(PCM990_IDE_IRQ_GPIO)
+#define PCM990_IDE_IRQ		pxa_gpio_to_irq(PCM990_IDE_IRQ_GPIO)
 #define PCM990_IDE_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 #define PCM990_IDE_PLD_PHYS	0x20000000	/* 16 bit wide */
 #define PCM990_IDE_PLD_BASE	0xee000000
@@ -188,11 +188,11 @@
  * Compact Flash
  */
 #define PCM990_CF_IRQ_GPIO	11
-#define PCM990_CF_IRQ		IRQ_GPIO(PCM990_CF_IRQ_GPIO)
+#define PCM990_CF_IRQ		pxa_gpio_to_irq(PCM990_CF_IRQ_GPIO)
 #define PCM990_CF_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 
 #define PCM990_CF_CD_GPIO	12
-#define PCM990_CF_CD		IRQ_GPIO(PCM990_CF_CD_GPIO)
+#define PCM990_CF_CD		pxa_gpio_to_irq(PCM990_CF_CD_GPIO)
 #define PCM990_CF_CD_EDGE	IRQ_TYPE_EDGE_RISING
 
 #define PCM990_CF_PLD_PHYS	0x30000000	/* 16 bit wide */
@@ -258,14 +258,14 @@
  * Wolfson AC97 Touch
  */
 #define PCM990_AC97_IRQ_GPIO	10
-#define PCM990_AC97_IRQ		IRQ_GPIO(PCM990_AC97_IRQ_GPIO)
+#define PCM990_AC97_IRQ		pxa_gpio_to_irq(PCM990_AC97_IRQ_GPIO)
 #define PCM990_AC97_IRQ_EDGE	IRQ_TYPE_EDGE_RISING
 
 /*
  * MMC phyCORE
  */
 #define PCM990_MMC0_IRQ_GPIO	9
-#define PCM990_MMC0_IRQ		IRQ_GPIO(PCM990_MMC0_IRQ_GPIO)
+#define PCM990_MMC0_IRQ		pxa_gpio_to_irq(PCM990_MMC0_IRQ_GPIO)
 #define PCM990_MMC0_IRQ_EDGE	IRQ_TYPE_EDGE_FALLING
 
 /*
arch/arm/mach-pxa/include/mach/poodle.h +12 -12
index 83d1cfd..58717fd 100644
@@ -47,18 +47,18 @@
 #define POODLE_GPIO_DISCHARGE_ON        (42) /* Enable battery discharge */
 
 /* PXA GPIOs */
-#define POODLE_IRQ_GPIO_ON_KEY		IRQ_GPIO(0)
-#define POODLE_IRQ_GPIO_AC_IN		IRQ_GPIO(1)
-#define POODLE_IRQ_GPIO_HP_IN		IRQ_GPIO(4)
-#define POODLE_IRQ_GPIO_CO		IRQ_GPIO(16)
-#define POODLE_IRQ_GPIO_TP_INT		IRQ_GPIO(5)
-#define POODLE_IRQ_GPIO_WAKEUP		IRQ_GPIO(11)
-#define POODLE_IRQ_GPIO_GA_INT		IRQ_GPIO(10)
-#define POODLE_IRQ_GPIO_CF_IRQ		IRQ_GPIO(17)
-#define POODLE_IRQ_GPIO_CF_CD		IRQ_GPIO(14)
-#define POODLE_IRQ_GPIO_nSD_INT		IRQ_GPIO(8)
-#define POODLE_IRQ_GPIO_nSD_DETECT	IRQ_GPIO(9)
-#define POODLE_IRQ_GPIO_MAIN_BAT_LOW	IRQ_GPIO(13)
+#define POODLE_IRQ_GPIO_ON_KEY		pxa_gpio_to_irq(0)
+#define POODLE_IRQ_GPIO_AC_IN		pxa_gpio_to_irq(1)
+#define POODLE_IRQ_GPIO_HP_IN		pxa_gpio_to_irq(4)
+#define POODLE_IRQ_GPIO_CO		pxa_gpio_to_irq(16)
+#define POODLE_IRQ_GPIO_TP_INT		pxa_gpio_to_irq(5)
+#define POODLE_IRQ_GPIO_WAKEUP		pxa_gpio_to_irq(11)
+#define POODLE_IRQ_GPIO_GA_INT		pxa_gpio_to_irq(10)
+#define POODLE_IRQ_GPIO_CF_IRQ		pxa_gpio_to_irq(17)
+#define POODLE_IRQ_GPIO_CF_CD		pxa_gpio_to_irq(14)
+#define POODLE_IRQ_GPIO_nSD_INT		pxa_gpio_to_irq(8)
+#define POODLE_IRQ_GPIO_nSD_DETECT	pxa_gpio_to_irq(9)
+#define POODLE_IRQ_GPIO_MAIN_BAT_LOW	pxa_gpio_to_irq(13)
 
 /* SCOOP GPIOs */
 #define POODLE_SCOOP_CHARGE_ON	SCOOP_GPCR_PA11
arch/arm/mach-pxa/include/mach/spitz.h +17 -17
index 685749a..9023719 100644
@@ -164,23 +164,23 @@
 
 /* Spitz IRQ Definitions */
 
-#define SPITZ_IRQ_GPIO_KEY_INT        IRQ_GPIO(SPITZ_GPIO_KEY_INT)
-#define SPITZ_IRQ_GPIO_AC_IN          IRQ_GPIO(SPITZ_GPIO_AC_IN)
-#define SPITZ_IRQ_GPIO_AK_INT         IRQ_GPIO(SPITZ_GPIO_AK_INT)
-#define SPITZ_IRQ_GPIO_HP_IN          IRQ_GPIO(SPITZ_GPIO_HP_IN)
-#define SPITZ_IRQ_GPIO_TP_INT         IRQ_GPIO(SPITZ_GPIO_TP_INT)
-#define SPITZ_IRQ_GPIO_SYNC           IRQ_GPIO(SPITZ_GPIO_SYNC)
-#define SPITZ_IRQ_GPIO_ON_KEY         IRQ_GPIO(SPITZ_GPIO_ON_KEY)
-#define SPITZ_IRQ_GPIO_SWA            IRQ_GPIO(SPITZ_GPIO_SWA)
-#define SPITZ_IRQ_GPIO_SWB            IRQ_GPIO(SPITZ_GPIO_SWB)
-#define SPITZ_IRQ_GPIO_BAT_COVER      IRQ_GPIO(SPITZ_GPIO_BAT_COVER)
-#define SPITZ_IRQ_GPIO_FATAL_BAT      IRQ_GPIO(SPITZ_GPIO_FATAL_BAT)
-#define SPITZ_IRQ_GPIO_CO             IRQ_GPIO(SPITZ_GPIO_CO)
-#define SPITZ_IRQ_GPIO_CF_IRQ         IRQ_GPIO(SPITZ_GPIO_CF_IRQ)
-#define SPITZ_IRQ_GPIO_CF_CD          IRQ_GPIO(SPITZ_GPIO_CF_CD)
-#define SPITZ_IRQ_GPIO_CF2_IRQ        IRQ_GPIO(SPITZ_GPIO_CF2_IRQ)
-#define SPITZ_IRQ_GPIO_nSD_INT        IRQ_GPIO(SPITZ_GPIO_nSD_INT)
-#define SPITZ_IRQ_GPIO_nSD_DETECT     IRQ_GPIO(SPITZ_GPIO_nSD_DETECT)
+#define SPITZ_IRQ_GPIO_KEY_INT        pxa_gpio_to_irq(SPITZ_GPIO_KEY_INT)
+#define SPITZ_IRQ_GPIO_AC_IN          pxa_gpio_to_irq(SPITZ_GPIO_AC_IN)
+#define SPITZ_IRQ_GPIO_AK_INT         pxa_gpio_to_irq(SPITZ_GPIO_AK_INT)
+#define SPITZ_IRQ_GPIO_HP_IN          pxa_gpio_to_irq(SPITZ_GPIO_HP_IN)
+#define SPITZ_IRQ_GPIO_TP_INT         pxa_gpio_to_irq(SPITZ_GPIO_TP_INT)
+#define SPITZ_IRQ_GPIO_SYNC           pxa_gpio_to_irq(SPITZ_GPIO_SYNC)
+#define SPITZ_IRQ_GPIO_ON_KEY         pxa_gpio_to_irq(SPITZ_GPIO_ON_KEY)
+#define SPITZ_IRQ_GPIO_SWA            pxa_gpio_to_irq(SPITZ_GPIO_SWA)
+#define SPITZ_IRQ_GPIO_SWB            pxa_gpio_to_irq(SPITZ_GPIO_SWB)
+#define SPITZ_IRQ_GPIO_BAT_COVER      pxa_gpio_to_irq(SPITZ_GPIO_BAT_COVER)
+#define SPITZ_IRQ_GPIO_FATAL_BAT      pxa_gpio_to_irq(SPITZ_GPIO_FATAL_BAT)
+#define SPITZ_IRQ_GPIO_CO             pxa_gpio_to_irq(SPITZ_GPIO_CO)
+#define SPITZ_IRQ_GPIO_CF_IRQ         pxa_gpio_to_irq(SPITZ_GPIO_CF_IRQ)
+#define SPITZ_IRQ_GPIO_CF_CD          pxa_gpio_to_irq(SPITZ_GPIO_CF_CD)
+#define SPITZ_IRQ_GPIO_CF2_IRQ        pxa_gpio_to_irq(SPITZ_GPIO_CF2_IRQ)
+#define SPITZ_IRQ_GPIO_nSD_INT        pxa_gpio_to_irq(SPITZ_GPIO_nSD_INT)
+#define SPITZ_IRQ_GPIO_nSD_DETECT     pxa_gpio_to_irq(SPITZ_GPIO_nSD_DETECT)
 
 /*
  * Shared data structures
arch/arm/mach-pxa/include/mach/tosa.h +24 -24

54 lines not on this page · raw message

arch/arm/mach-pxa/include/mach/trizeps4.h +8 -8
index 903e1a2..19f8559 100644
@@ -43,30 +43,30 @@
 
 /* Ethernet Controller Davicom DM9000 */
 #define GPIO_DM9000		101
-#define TRIZEPS4_ETH_IRQ	IRQ_GPIO(GPIO_DM9000)
+#define TRIZEPS4_ETH_IRQ	pxa_gpio_to_irq(GPIO_DM9000)
 
 /* UCB1400 audio / TS-controller */
 #define GPIO_UCB1400		1
-#define TRIZEPS4_UCB1400_IRQ	IRQ_GPIO(GPIO_UCB1400)
+#define TRIZEPS4_UCB1400_IRQ	pxa_gpio_to_irq(GPIO_UCB1400)
 
 /* PCMCIA socket Compact Flash */
 #define GPIO_PCD		11		/* PCMCIA Card Detect */
-#define TRIZEPS4_CD_IRQ		IRQ_GPIO(GPIO_PCD)
+#define TRIZEPS4_CD_IRQ		pxa_gpio_to_irq(GPIO_PCD)
 #define GPIO_PRDY		13		/* READY / nINT */
-#define TRIZEPS4_READY_NINT	IRQ_GPIO(GPIO_PRDY)
+#define TRIZEPS4_READY_NINT	pxa_gpio_to_irq(GPIO_PRDY)
 
 /* MMC socket */
 #define GPIO_MMC_DET		12
-#define TRIZEPS4_MMC_IRQ	IRQ_GPIO(GPIO_MMC_DET)
+#define TRIZEPS4_MMC_IRQ	pxa_gpio_to_irq(GPIO_MMC_DET)
 
 /* DOC NAND chip */
 #define GPIO_DOC_LOCK           94
 #define GPIO_DOC_IRQ            93
-#define TRIZEPS4_DOC_IRQ        IRQ_GPIO(GPIO_DOC_IRQ)
+#define TRIZEPS4_DOC_IRQ        pxa_gpio_to_irq(GPIO_DOC_IRQ)
 
 /* SPI interface */
 #define GPIO_SPI                53
-#define TRIZEPS4_SPI_IRQ        IRQ_GPIO(GPIO_SPI)
+#define TRIZEPS4_SPI_IRQ        pxa_gpio_to_irq(GPIO_SPI)
 
 /* LEDS using tx2 / rx2 */
 #define GPIO_SYS_BUSY_LED	46
@@ -74,7 +74,7 @@
 
 /* Off-module PIC on ConXS board */
 #define GPIO_PIC		0
-#define TRIZEPS4_PIC_IRQ	IRQ_GPIO(GPIO_PIC)
+#define TRIZEPS4_PIC_IRQ	pxa_gpio_to_irq(GPIO_PIC)
 
 #ifdef CONFIG_MACH_TRIZEPS_CONXS
 /* for CONXS base board define these registers */
arch/arm/mach-pxa/irq.c +0 -61

85 lines not on this page · raw message

arch/arm/mach-pxa/littleton.c +2 -2
index 0296e1d..4cf259b 100644
@@ -124,8 +124,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
-		.end	= IRQ_GPIO(mfp_to_gpio(MFP_PIN_GPIO90)),
+		.start	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO90)),
+		.end	= pxa_gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO90)),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE,
 	}
 };
arch/arm/mach-pxa/lpd270.c +2 -2
index 64540d9..b5e0968 100644
@@ -152,8 +152,8 @@ static void __init lpd270_init_irq(void)
 					 handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 	}
-	irq_set_chained_handler(IRQ_GPIO(0), lpd270_irq_handler);
-	irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+	irq_set_chained_handler(pxa_gpio_to_irq(0), lpd270_irq_handler);
+	irq_set_irq_type(pxa_gpio_to_irq(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 
arch/arm/mach-pxa/lubbock.c +2 -2
index c48ce6d..b33c633 100644
@@ -170,8 +170,8 @@ static void __init lubbock_init_irq(void)
 		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
 	}
 
-	irq_set_chained_handler(IRQ_GPIO(0), lubbock_irq_handler);
-	irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+	irq_set_chained_handler(pxa_gpio_to_irq(0), lubbock_irq_handler);
+	irq_set_irq_type(pxa_gpio_to_irq(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 #ifdef CONFIG_PM
arch/arm/mach-pxa/mainstone.c +2 -2
index 0567d39..cd3917a 100644
@@ -178,8 +178,8 @@ static void __init mainstone_init_irq(void)
 	MST_INTMSKENA = 0;
 	MST_INTSETCLR = 0;
 
-	irq_set_chained_handler(IRQ_GPIO(0), mainstone_irq_handler);
-	irq_set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_FALLING);
+	irq_set_chained_handler(pxa_gpio_to_irq(0), mainstone_irq_handler);
+	irq_set_irq_type(pxa_gpio_to_irq(0), IRQ_TYPE_EDGE_FALLING);
 }
 
 #ifdef CONFIG_PM
arch/arm/mach-pxa/poodle.c +2 -2
index 469dcd6..a577826 100644
@@ -166,8 +166,8 @@ static struct resource locomo_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start		= IRQ_GPIO(10),
-		.end		= IRQ_GPIO(10),
+		.start		= pxa_gpio_to_irq(10),
+		.end		= pxa_gpio_to_irq(10),
 		.flags		= IORESOURCE_IRQ,
 	},
 };
arch/arm/mach-pxa/sharpsl_pm.c +12 -12
index 785880f..7fa6f84 100644
@@ -907,24 +907,24 @@ static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 	gpio_direction_input(sharpsl_pm.machinfo->gpio_batlock);
 
 	/* Register interrupt handlers */
-	if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
-		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin));
+	if (request_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, "AC Input Detect", sharpsl_ac_isr)) {
+		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_acin));
 	}
 
-	if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
-		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock));
+	if (request_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Battery Cover", sharpsl_fatal_isr)) {
+		dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock));
 	}
 
 	if (sharpsl_pm.machinfo->gpio_fatal) {
-		if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
-			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal));
+		if (request_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr, IRQF_DISABLED | IRQF_TRIGGER_FALLING, "Fatal Battery", sharpsl_fatal_isr)) {
+			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal));
 		}
 	}
 
 	if (sharpsl_pm.machinfo->batfull_irq) {
 		/* Register interrupt handler. */
-		if (request_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
-			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull));
+		if (request_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr, IRQF_DISABLED | IRQF_TRIGGER_RISING, "CO", sharpsl_chrg_full_isr)) {
+			dev_err(sharpsl_pm.dev, "Could not get irq %d.\n", pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull));
 		}
 	}
 
@@ -953,14 +953,14 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
 
 	led_trigger_unregister_simple(sharpsl_charge_led_trigger);
 
-	free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
-	free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
+	free_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
+	free_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);
 
 	if (sharpsl_pm.machinfo->gpio_fatal)
-		free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
+		free_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);
 
 	if (sharpsl_pm.machinfo->batfull_irq)
-		free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
+		free_irq(pxa_gpio_to_irq(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
 
 	gpio_free(sharpsl_pm.machinfo->gpio_batlock);
 	gpio_free(sharpsl_pm.machinfo->gpio_batfull);
arch/arm/mach-pxa/stargate2.c +11 -11
index 8752dc0..6f23f7a 100644
@@ -376,7 +376,7 @@ static struct spi_board_info spi_board_info[] __initdata = {
 		.bus_num = 1,
 		.chip_select = 0,
 		.controller_data = &staccel_chip_info,
-		.irq = IRQ_GPIO(96),
+		.irq = pxa_gpio_to_irq(96),
 	}, {
 		.modalias = "cc2420",
 		.max_speed_hz = 6500000,
@@ -560,18 +560,18 @@ static struct i2c_board_info __initdata imote2_i2c_board_info[] = {
 		/* Through a nand gate - Also beware, on V2 sensor board the
 		 * pull up resistors are missing.
 		 */
-		.irq = IRQ_GPIO(99),
+		.irq = pxa_gpio_to_irq(99),
 	}, { /* ITS400 Sensor board only */
 		.type = "tsl2561",
 		.addr = 0x49,
 		/* Through a nand gate - Also beware, on V2 sensor board the
 		 * pull up resistors are missing.
 		 */
-		.irq = IRQ_GPIO(99),
+		.irq = pxa_gpio_to_irq(99),
 	}, { /* ITS400 Sensor board only */
 		.type = "tmp175",
 		.addr = 0x4A,
-		.irq = IRQ_GPIO(96),
+		.irq = pxa_gpio_to_irq(96),
 	}, { /* IMB400 Multimedia board */
 		.type = "wm8940",
 		.addr = 0x1A,
@@ -661,8 +661,8 @@ static struct resource smc91x_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start = IRQ_GPIO(40),
-		.end = IRQ_GPIO(40),
+		.start = pxa_gpio_to_irq(40),
+		.end = pxa_gpio_to_irq(40),
 		.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
@@ -707,7 +707,7 @@ static int stargate2_mci_init(struct device *dev,
 	}
 	gpio_direction_input(SG2_GPIO_nSD_DETECT);
 
-	err = request_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT),
+	err = request_irq(pxa_gpio_to_irq(SG2_GPIO_nSD_DETECT),
 			  stargate2_detect_int,
 			  IRQ_TYPE_EDGE_BOTH,
 			  "MMC card detect",
@@ -738,7 +738,7 @@ static void stargate2_mci_setpower(struct device *dev, unsigned int vdd)
 
 static void stargate2_mci_exit(struct device *dev, void *data)
 {
-	free_irq(IRQ_GPIO(SG2_GPIO_nSD_DETECT), data);
+	free_irq(pxa_gpio_to_irq(SG2_GPIO_nSD_DETECT), data);
 	gpio_free(SG2_SD_POWER_ENABLE);
 	gpio_free(SG2_GPIO_nSD_DETECT);
 }
@@ -938,18 +938,18 @@ static struct i2c_board_info __initdata stargate2_i2c_board_info[] = {
 		/* Through a nand gate - Also beware, on V2 sensor board the
 		 * pull up resistors are missing.
 		 */
-		.irq = IRQ_GPIO(99),
+		.irq = pxa_gpio_to_irq(99),
 	}, { /* ITS400 Sensor board only */
 		.type = "tsl2561",
 		.addr = 0x49,
 		/* Through a nand gate - Also beware, on V2 sensor board the
 		 * pull up resistors are missing.
 		 */
-		.irq = IRQ_GPIO(99),
+		.irq = pxa_gpio_to_irq(99),
 	}, { /* ITS400 Sensor board only */
 		.type = "tmp175",
 		.addr = 0x4A,
-		.irq = IRQ_GPIO(96),
+		.irq = pxa_gpio_to_irq(96),
 	},
 };
 
arch/arm/mach-pxa/vpac270.c +3 -3
index 261f258..f648608 100644
@@ -395,8 +395,8 @@ static struct resource vpac270_dm9000_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[2] = {
-		.start	= IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ),
-		.end	= IRQ_GPIO(GPIO114_VPAC270_ETH_IRQ),
+		.start	= pxa_gpio_to_irq(GPIO114_VPAC270_ETH_IRQ),
+		.end	= pxa_gpio_to_irq(GPIO114_VPAC270_ETH_IRQ),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	},
 };
@@ -433,7 +433,7 @@ static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
 };
 
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
-	.irq		= IRQ_GPIO(GPIO113_VPAC270_TS_IRQ),
+	.irq		= pxa_gpio_to_irq(GPIO113_VPAC270_TS_IRQ),
 };
 
 static struct platform_device vpac270_ucb1400_device = {
arch/arm/mach-pxa/zylonite_pxa300.c +2 -2
index 93c64d8..dcdf0d2 100644
@@ -231,12 +231,12 @@ static struct i2c_board_info zylonite_i2c_board_info[] = {
 		.type		= "pca9539",
 		.addr		= 0x74,
 		.platform_data	= &gpio_exp[0],
-		.irq		= IRQ_GPIO(18),
+		.irq		= pxa_gpio_to_irq(18),
 	}, {
 		.type		= "pca9539",
 		.addr		= 0x75,
 		.platform_data	= &gpio_exp[1],
-		.irq		= IRQ_GPIO(19),
+		.irq		= pxa_gpio_to_irq(19),
 	},
 };
 
arch/arm/plat-pxa/gpio.c +14 -0
index 5ab42f8..d667d8d 100644
@@ -282,6 +282,20 @@ void __init pxa_init_gpio(int mux_irq, int start, int end,
 		__raw_writel(~0,c->regbase + GEDR_OFFSET);
 	}
 
+#ifdef CONFIG_ARCH_PXA
+	irq = gpio_to_irq(0);
+	irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
+				 handle_edge_irq);
+	set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+	irq_set_chained_handler(IRQ_GPIO0, pxa_gpio_demux_handler);
+
+	irq = gpio_to_irq(1);
+	irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
+				 handle_edge_irq);
+	set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+	irq_set_chained_handler(IRQ_GPIO1, pxa_gpio_demux_handler);
+#endif
+
 	for (irq  = pxa_gpio_to_irq(start); irq <= pxa_gpio_to_irq(end);
 		irq++) {
 		irq_set_chip_and_handler(irq, &pxa_muxed_gpio_chip,
Signature · 1 line
1.7.2.5
#5 lore raw

PATCH v2 5/5 ARM: pxa: move gpio driver into drivers directory

In reply to Haojian Zhuang

Move gpio driver from plat-pxa to drivers/gpio directory. Only leave gpio number macro in mach/gpio.h.

---
 arch/arm/mach-mmp/Kconfig               |    3 +
 arch/arm/mach-mmp/aspenite.c            |    5 +-
 arch/arm/mach-mmp/avengers_lite.c       |    1 +
 arch/arm/mach-mmp/brownstone.c          |    1 +
 arch/arm/mach-mmp/flint.c               |    5 +-
 arch/arm/mach-mmp/gplugd.c              |    3 +-
 arch/arm/mach-mmp/include/mach/gpio.h   |   25 --
 arch/arm/mach-mmp/include/mach/irqs.h   |    4 +-
 arch/arm/mach-mmp/include/mach/mmp2.h   |    3 +
 arch/arm/mach-mmp/include/mach/pxa168.h |    3 +
 arch/arm/mach-mmp/include/mach/pxa910.h |    3 +
 arch/arm/mach-mmp/jasper.c              |    1 +
 arch/arm/mach-mmp/mmp2.c                |   43 ++-
 arch/arm/mach-mmp/pxa168.c              |   44 ++-
 arch/arm/mach-mmp/pxa910.c              |   44 ++-
 arch/arm/mach-mmp/tavorevb.c            |    5 +-
 arch/arm/mach-mmp/teton_bga.c           |    3 +-
 arch/arm/mach-mmp/ttc_dkb.c             |    3 +-
 arch/arm/mach-pxa/Kconfig               |    5 +
 arch/arm/mach-pxa/devices.c             |   36 ++
 arch/arm/mach-pxa/devices.h             |    1 +
 arch/arm/mach-pxa/include/mach/gpio.h   |   64 ----
 arch/arm/mach-pxa/pxa25x.c              |    4 +-
 arch/arm/mach-pxa/pxa27x.c              |    3 +-
 arch/arm/mach-pxa/pxa3xx.c              |    3 +-
 arch/arm/mach-pxa/pxa95x.c              |    3 +-
 arch/arm/plat-pxa/Makefile              |    1 -
 arch/arm/plat-pxa/gpio.c                |  352 -------------------
 arch/arm/plat-pxa/include/plat/gpio.h   |   65 ----
 drivers/gpio/Kconfig                    |    6 +
 drivers/gpio/Makefile                   |    1 +
 drivers/gpio/gpio-pxa.c                 |  558 +++++++++++++++++++++++++++++++
 include/linux/gpio-pxa.h                |   64 ++++
 33 files changed, 787 insertions(+), 578 deletions(-)
 delete mode 100644 arch/arm/plat-pxa/gpio.c
 delete mode 100644 arch/arm/plat-pxa/include/plat/gpio.h
 create mode 100644 drivers/gpio/gpio-pxa.c
 create mode 100644 include/linux/gpio-pxa.h
arch/arm/mach-mmp/Kconfig +3 -0
index 56ef5f6..47810fb 100644
@@ -89,18 +89,21 @@ endmenu
 config CPU_PXA168
 	bool
 	select CPU_MOHAWK
+	select GPIO_PXA
 	help
 	  Select code specific to PXA168
 
 config CPU_PXA910
 	bool
 	select CPU_MOHAWK
+	select GPIO_PXA
 	help
 	  Select code specific to PXA910
 
 config CPU_MMP2
 	bool
 	select CPU_PJ4
+	select GPIO_PXA
 	help
 	  Select code specific to MMP2. MMP2 is ARMv7 compatible.
 endif
arch/arm/mach-mmp/aspenite.c +3 -2
index 6b19812..aa52b3b 100644
@@ -119,8 +119,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= pxa_gpio_to_irq(27),
-		.end	= pxa_gpio_to_irq(27),
+		.start	= mmp_gpio_to_irq(27),
+		.end	= mmp_gpio_to_irq(27),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
@@ -231,6 +231,7 @@ static void __init common_init(void)
 	pxa168_add_nand(&aspenite_nand_info);
 	pxa168_add_fb(&aspenite_lcd_info);
 	pxa168_add_keypad(&aspenite_keypad_info);
+	platform_device_register(&pxa168_device_gpio);
 
 	/* off-chip devices */
 	platform_device_register(&smc91x_device);
arch/arm/mach-mmp/avengers_lite.c +1 -0
index 39f0878..c5d53e0 100644
@@ -38,6 +38,7 @@ static void __init avengers_lite_init(void)
 
 	/* on-chip devices */
 	pxa168_add_uart(2);
+	platform_device_register(&pxa168_device_gpio);
 }
 
 MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
arch/arm/mach-mmp/brownstone.c +1 -0
index c79162a..3ae42ee 100644
@@ -197,6 +197,7 @@ static void __init brownstone_init(void)
 	mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
 	mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
 	mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */
+	platform_device_register(&mmp2_device_gpio);
 
 	/* enable 5v regulator */
 	platform_device_register(&brownstone_v_5vp_device);
arch/arm/mach-mmp/flint.c +3 -2
index f466a2c..838cc31 100644
@@ -87,8 +87,8 @@ static struct resource smc91x_resources[] = {
 		.flags  = IORESOURCE_MEM,
 	},
 	[1] = {
-		.start  = pxa_gpio_to_irq(155),
-		.end    = pxa_gpio_to_irq(155),
+		.start  = mmp_gpio_to_irq(155),
+		.end    = mmp_gpio_to_irq(155),
 		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
@@ -110,6 +110,7 @@ static void __init flint_init(void)
 	/* on-chip devices */
 	mmp2_add_uart(1);
 	mmp2_add_uart(2);
+	platform_device_register(&mmp2_device_gpio);
 
 	/* off-chip devices */
 	platform_device_register(&smc91x_device);
arch/arm/mach-mmp/gplugd.c +2 -1
index 98e25d9..5315fcc 100644
@@ -9,11 +9,11 @@
  */
 
 #include <linux/init.h>
+#include <linux/gpio.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
 
-#include <mach/gpio.h>
 #include <mach/pxa168.h>
 #include <mach/mfp-pxa168.h>
 
@@ -184,6 +184,7 @@ static void __init gplugd_init(void)
 	pxa168_add_uart(3);
 	pxa168_add_ssp(0);
 	pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
+	platform_device_register(&pxa168_device_gpio);
 
 	pxa168_add_eth(&gplugd_eth_platform_data);
 }
arch/arm/mach-mmp/include/mach/gpio.h +0 -25
index 89d499e..691443d0 100644
@@ -1,33 +1,8 @@
 #ifndef __ASM_MACH_GPIO_H
 #define __ASM_MACH_GPIO_H
 
-#include <mach/addr-map.h>
 #include <mach/irqs.h>
-#include <asm-generic/gpio.h>
-
-#define GPIO_REGS_VIRT	(APB_VIRT_BASE + 0x19000)
-
-#define BANK_OFF(n)	(((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
-#define GPIO_REG(x)	(*((volatile u32 *)(GPIO_REGS_VIRT + (x))))
 
 #define NR_BUILTIN_GPIO		IRQ_GPIO_NUM
 
-#define gpio_to_bank(gpio)	((gpio) >> 5)
-
-#define __gpio_is_inverted(gpio)	(0)
-#define __gpio_is_occupied(gpio)	(0)
-
-/* NOTE: these macros are defined here to make optimization of
- * gpio_{get,set}_value() to work when 'gpio' is a constant.
- * Usage of these macros otherwise is no longer recommended,
- * use generic GPIO API whenever possible.
- */
-#define GPIO_bit(gpio)	(1 << ((gpio) & 0x1f))
-
-#define GPLR(x)		GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x00)
-#define GPDR(x)		GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x0c)
-#define GPSR(x)		GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x18)
-#define GPCR(x)		GPIO_REG(BANK_OFF(gpio_to_bank(x)) + 0x24)
-
-#include <plat/gpio.h>
 #endif /* __ASM_MACH_GPIO_H */
arch/arm/mach-mmp/include/mach/irqs.h +2 -2
index 2971a00..6a72198 100644
@@ -220,8 +220,8 @@
 
 #define IRQ_GPIO_START			128
 #define IRQ_GPIO_NUM			192
-#define pxa_gpio_to_irq(gpio)		(IRQ_GPIO_START + (gpio))
-#define pxa_irq_to_gpio(irq)		((irq) - IRQ_GPIO_START)
+#define mmp_gpio_to_irq(gpio)		(IRQ_GPIO_START + (gpio))
+#define mmp_irq_to_gpio(irq)		((irq) - IRQ_GPIO_START)
 
 #define IRQ_BOARD_START			(IRQ_GPIO_START + IRQ_GPIO_NUM)
 
arch/arm/mach-mmp/include/mach/mmp2.h +3 -0
index de7b888..d228a28 100644
@@ -12,6 +12,7 @@ extern void mmp2_clear_pmic_int(void);
 
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
+#include <linux/platform_device.h>
 #include <mach/devices.h>
 
 extern struct pxa_device_desc mmp2_device_uart1;
@@ -29,6 +30,8 @@ extern struct pxa_device_desc mmp2_device_sdh1;
 extern struct pxa_device_desc mmp2_device_sdh2;
 extern struct pxa_device_desc mmp2_device_sdh3;
 
+extern struct platform_device mmp2_device_gpio;
+
 static inline int mmp2_add_uart(int id)
 {
 	struct pxa_device_desc *d = NULL;
arch/arm/mach-mmp/include/mach/pxa168.h +3 -0
index 7fb568d..22eccf0 100644
@@ -9,6 +9,7 @@ extern void pxa168_clear_keypad_wakeup(void);
 
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
+#include <linux/platform_device.h>
 #include <mach/devices.h>
 #include <plat/pxa3xx_nand.h>
 #include <video/pxa168fb.h>
@@ -35,6 +36,8 @@ extern struct pxa_device_desc pxa168_device_fb;
 extern struct pxa_device_desc pxa168_device_keypad;
 extern struct pxa_device_desc pxa168_device_eth;
 
+extern struct platform_device pxa168_device_gpio;
+
 struct pxa168_usb_pdata {
 	/* If NULL, default phy init routine for PXA168 would be called */
 	int (*phy_init)(void __iomem *usb_phy_reg_base);
arch/arm/mach-mmp/include/mach/pxa910.h +3 -0
index 91be755..fb84fd6 100644
@@ -8,6 +8,7 @@ extern void __init pxa910_init_irq(void);
 
 #include <linux/i2c.h>
 #include <linux/i2c/pxa-i2c.h>
+#include <linux/platform_device.h>
 #include <mach/devices.h>
 #include <plat/pxa3xx_nand.h>
 
@@ -21,6 +22,8 @@ extern struct pxa_device_desc pxa910_device_pwm3;
 extern struct pxa_device_desc pxa910_device_pwm4;
 extern struct pxa_device_desc pxa910_device_nand;
 
+extern struct platform_device pxa910_device_gpio;
+
 static inline int pxa910_add_uart(int id)
 {
 	struct pxa_device_desc *d = NULL;
arch/arm/mach-mmp/jasper.c +1 -0
index 5d6421d..f49bad2 100644
@@ -166,6 +166,7 @@ static void __init jasper_init(void)
 	mmp2_add_uart(3);
 	mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info));
 	mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
+	platform_device_register(&mmp2_device_gpio);
 
 	regulator_has_full_constraints();
 }
arch/arm/mach-mmp/mmp2.c +26 -17

67 lines not on this page · raw message

arch/arm/mach-mmp/pxa168.c +27 -17

65 lines not on this page · raw message

arch/arm/mach-mmp/pxa910.c +27 -17

62 lines not on this page · raw message

arch/arm/mach-mmp/tavorevb.c +3 -2
index c5e1529..1cd3e50 100644
@@ -70,8 +70,8 @@ static struct resource smc91x_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= pxa_gpio_to_irq(80),
-		.end	= pxa_gpio_to_irq(80),
+		.start	= mmp_gpio_to_irq(80),
+		.end	= mmp_gpio_to_irq(80),
 		.flags	= IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
 	}
 };
@@ -92,6 +92,7 @@ static void __init tavorevb_init(void)
 
 	/* on-chip devices */
 	pxa910_add_uart(1);
+	platform_device_register(&pxa910_device_gpio);
 
 	/* off-chip devices */
 	platform_device_register(&smc91x_device);
arch/arm/mach-mmp/teton_bga.c +2 -1
index 79bbbc2..8ea6eeb 100644
@@ -66,7 +66,7 @@ static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
 static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
 	{
 		I2C_BOARD_INFO("ds1337", 0x68),
-		.irq = pxa_gpio_to_irq(RTC_INT_GPIO)
+		.irq = mmp_gpio_to_irq(RTC_INT_GPIO)
 	},
 };
 
@@ -78,6 +78,7 @@ static void __init teton_bga_init(void)
 	pxa168_add_uart(1);
 	pxa168_add_keypad(&teton_bga_keypad_info);
 	pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
+	platform_device_register(&pxa168_device_gpio);
 }
 
 MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
arch/arm/mach-mmp/ttc_dkb.c +2 -1
index a420b07..e367438 100644
@@ -122,6 +122,7 @@ static struct platform_device ttc_dkb_device_onenand = {
 };
 
 static struct platform_device *ttc_dkb_devices[] = {
+	&pxa910_device_gpio,
 	&ttc_dkb_device_onenand,
 };
 
@@ -136,7 +137,7 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
 	{
 		.type		= "max7312",
 		.addr		= 0x23,
-		.irq		= pxa_gpio_to_irq(80),
+		.irq		= mmp_gpio_to_irq(80),
 		.platform_data	= &max7312_data,
 	},
 };
arch/arm/mach-pxa/Kconfig +5 -0
index cd19309..046f345 100644
@@ -604,12 +604,14 @@ endmenu
 config PXA25x
 	bool
 	select CPU_XSCALE
+	select GPIO_PXA
 	help
 	  Select code specific to PXA21x/25x/26x variants
 
 config PXA27x
 	bool
 	select CPU_XSCALE
+	select GPIO_PXA
 	help
 	  Select code specific to PXA27x variants
 
@@ -622,6 +624,7 @@ config CPU_PXA26x
 config PXA3xx
 	bool
 	select CPU_XSC3
+	select GPIO_PXA
 	help
 	  Select code specific to PXA3xx variants
 
@@ -647,6 +650,7 @@ config CPU_PXA320
 config CPU_PXA930
 	bool
 	select PXA3xx
+	select GPIO_PXA
 	help
 	  PXA930 (codename Tavor-P)
 
@@ -659,6 +663,7 @@ config CPU_PXA935
 config PXA95x
 	bool
 	select CPU_PJ4
+	select GPIO_PXA
 	help
 	  Select code specific to PXA95x variants
 
arch/arm/mach-pxa/devices.c +36 -0
index 2e04254..4d6b9f2 100644
@@ -1051,6 +1051,42 @@ struct platform_device pxa3xx_device_ssp4 = {
 };
 #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */
 
+struct resource pxa_resources_gpio[] = {
+	{
+		.start	= 0x40e00000,
+		.end	= 0x40e0ffff,
+		.name	= "gpio_phys_base",
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= io_p2v(0x40e00000),
+		.end	= io_p2v(0x40e0ffff),
+		.name	= "gpio_virtual_base",
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= IRQ_GPIO0,
+		.end	= IRQ_GPIO0,
+		.name	= "gpio0",
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.start	= IRQ_GPIO1,
+		.end	= IRQ_GPIO1,
+		.name	= "gpio1",
+		.flags	= IORESOURCE_IRQ,
+	}, {
+		.start	= IRQ_GPIO_2_x,
+		.end	= IRQ_GPIO_2_x,
+		.name	= "gpio_mux",
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+struct platform_device pxa_device_gpio = {
+	.name		= "pxa-gpio",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(pxa_resources_gpio),
+	.resource	= pxa_resources_gpio,
+};
+
 /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
  * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */
 void __init pxa2xx_set_spi_info(unsigned id, struct pxa2xx_spi_master *info)
arch/arm/mach-pxa/devices.h +1 -0
index 2fd5a8b..54d121d 100644
@@ -1,3 +1,4 @@
+extern struct platform_device pxa_device_gpio;
 extern struct platform_device pxa_device_pmu;
 extern struct platform_device pxa_device_mci;
 extern struct platform_device pxa3xx_device_mci2;
arch/arm/mach-pxa/include/mach/gpio.h +0 -64

71 lines not on this page · raw message

arch/arm/mach-pxa/pxa25x.c +1 -3
index 2ae1739..d802a96 100644
@@ -311,14 +311,12 @@ set_pwer:
 void __init pxa25x_init_irq(void)
 {
 	pxa_init_irq(32, pxa25x_set_wake);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 84, pxa25x_set_wake);
 }
 
 #ifdef CONFIG_CPU_PXA26x
 void __init pxa26x_init_irq(void)
 {
 	pxa_init_irq(32, pxa25x_set_wake);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 89, pxa25x_set_wake);
 }
 #endif
 
@@ -339,6 +337,7 @@ void __init pxa25x_map_io(void)
 }
 
 static struct platform_device *pxa25x_devices[] __initdata = {
+	&pxa_device_gpio,
 	&pxa25x_device_udc,
 	&pxa_device_pmu,
 	&pxa_device_i2s,
@@ -368,7 +367,6 @@ static int __init pxa25x_init(void)
 
 		register_syscore_ops(&pxa_irq_syscore_ops);
 		register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-		register_syscore_ops(&pxa_gpio_syscore_ops);
 		register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
 		ret = platform_add_devices(pxa25x_devices,
arch/arm/mach-pxa/pxa27x.c +1 -2
index 03d0728..572ae34 100644
@@ -385,7 +385,6 @@ static int pxa27x_set_wake(struct irq_data *d, unsigned int on)
 void __init pxa27x_init_irq(void)
 {
 	pxa_init_irq(34, pxa27x_set_wake);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake);
 }
 
 static struct map_desc pxa27x_io_desc[] __initdata = {
@@ -421,6 +420,7 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+	&pxa_device_gpio,
 	&pxa27x_device_udc,
 	&pxa_device_pmu,
 	&pxa_device_i2s,
@@ -454,7 +454,6 @@ static int __init pxa27x_init(void)
 
 		register_syscore_ops(&pxa_irq_syscore_ops);
 		register_syscore_ops(&pxa2xx_mfp_syscore_ops);
-		register_syscore_ops(&pxa_gpio_syscore_ops);
 		register_syscore_ops(&pxa2xx_clock_syscore_ops);
 
 		ret = platform_add_devices(devices, ARRAY_SIZE(devices));
arch/arm/mach-pxa/pxa3xx.c +1 -2
index f18a6eb..807d343 100644
@@ -389,7 +389,6 @@ void __init pxa3xx_init_irq(void)
 
 	pxa_init_irq(56, pxa3xx_set_wake);
 	pxa_init_ext_wakeup_irq(pxa3xx_set_wake);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
 }
 
 static struct map_desc pxa3xx_io_desc[] __initdata = {
@@ -418,6 +417,7 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+	&pxa_device_gpio,
 	&pxa27x_device_udc,
 	&pxa_device_pmu,
 	&pxa_device_i2s,
@@ -461,7 +461,6 @@ static int __init pxa3xx_init(void)
 
 		register_syscore_ops(&pxa_irq_syscore_ops);
 		register_syscore_ops(&pxa3xx_mfp_syscore_ops);
-		register_syscore_ops(&pxa_gpio_syscore_ops);
 		register_syscore_ops(&pxa3xx_clock_syscore_ops);
 
 		ret = platform_add_devices(devices, ARRAY_SIZE(devices));
arch/arm/mach-pxa/pxa95x.c +1 -2
index de25ceb..c89e209 100644
@@ -235,7 +235,6 @@ static struct clk_lookup pxa95x_clkregs[] = {
 void __init pxa95x_init_irq(void)
 {
 	pxa_init_irq(96, NULL);
-	pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL);
 }
 
 /*
@@ -248,6 +247,7 @@ void __init pxa95x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
 }
 
 static struct platform_device *devices[] __initdata = {
+	&pxa_device_gpio,
 	&sa1100_device_rtc,
 	&pxa_device_rtc,
 	&pxa27x_device_ssp1,
@@ -282,7 +282,6 @@ static int __init pxa95x_init(void)
 			return ret;
 
 		register_syscore_ops(&pxa_irq_syscore_ops);
-		register_syscore_ops(&pxa_gpio_syscore_ops);
 		register_syscore_ops(&pxa3xx_clock_syscore_ops);
 
 		ret = platform_add_devices(devices, ARRAY_SIZE(devices));
arch/arm/plat-pxa/Makefile +0 -1
index 3aca5ba..f302d04 100644
@@ -4,7 +4,6 @@
 
 obj-y	:= dma.o
 
-obj-$(CONFIG_GENERIC_GPIO)	+= gpio.o
 obj-$(CONFIG_PXA3xx)		+= mfp.o
 obj-$(CONFIG_PXA95x)		+= mfp.o
 obj-$(CONFIG_ARCH_MMP)		+= mfp.o
arch/arm/plat-pxa/gpio.c deleted +0 -352

352 lines not on this page · raw message

arch/arm/plat-pxa/include/plat/gpio.h deleted +0 -65

65 lines not on this page · raw message

drivers/gpio/Kconfig +6 -0
index 6465030..08fe9f6 100644
@@ -141,6 +141,12 @@ config GPIO_PL061
 	help
 	  Say yes here to support the PrimeCell PL061 GPIO device
 
+config GPIO_PXA
+	def_bool y
+	depends on ARCH_PXA || ARCH_MMP
+	help
+	  Say yes here to support the PXA GPIO device
+
 config GPIO_XILINX
 	bool "Xilinx GPIO support"
 	depends on PPC_OF || MICROBLAZE
drivers/gpio/Makefile +1 -0
index a4c8ac9..194899f 100644
@@ -40,6 +40,7 @@ obj-$(CONFIG_GPIO_PCA953X)	+= gpio-pca953x.o
 obj-$(CONFIG_GPIO_PCF857X)	+= gpio-pcf857x.o
 obj-$(CONFIG_GPIO_PCH)		+= gpio-pch.o
 obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
+obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_PLAT_SAMSUNG)	+= gpio-samsung.o
drivers/gpio/gpio-pxa.c new file +558 -0

558 lines not on this page · raw message

include/linux/gpio-pxa.h new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.7.2.5
#6 lore raw

v2 cover ARM: pxa: move gpio driver into drivers directory

In reply to Haojian Zhuang
Quoted 8 lines · Haojian Zhuang

Changelog:
v2:
1. Remove gpio.c from mach-pxa & mach-mmp that is introduced from v1.
2. Remove init function in gpio.c. Move the platfrom_device_register() into platform driver.
3. Initialize pxa_gpio_regs in gpio-pxa.c
4. Simplify code of identifing pxa gpio series or mmp gpio series.
5. Use linux/io.h instead of asm/io.h.

This series looks fine to me. You don't mention what it's based upon - should I assume my gpio patch series? If so, it looks fine to be submitted to the patch system.

It would be nice to have a few acks from people against it first though.

Thanks.

#7 lore raw

v2 cover ARM: pxa: move gpio driver into drivers directory

Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Haojian Zhuang

Changelog:
v2:
1. Remove gpio.c from mach-pxa & mach-mmp that is introduced from v1.
2. Remove init function in gpio.c. Move the platfrom_device_register() into platform driver.
3. Initialize pxa_gpio_regs in gpio-pxa.c
4. Simplify code of identifing pxa gpio series or mmp gpio series.
5. Use linux/io.h instead of asm/io.h.

Quoted 5 lines

This series looks fine to me. You don't mention what it's based upon - should I assume my gpio patch series? If so, it looks fine to be submitted to the patch system.

It would be nice to have a few acks from people against it first though.

I assume this clashes with patches 7103/1 and 7104/1 in the patch system. Should I ignore those two for the meantime?

#8 lore raw

v2 cover ARM: pxa: move gpio driver into drivers directory

2011/10/1 Russell King - ARM Linux <[email protected]>:

Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Haojian Zhuang
Quoted 8 lines

Changelog:
v2:
? ? 1. Remove gpio.c from mach-pxa & mach-mmp that is introduced from v1. ? ? 2. Remove init function in gpio.c. Move the platfrom_device_register() ? ? ? ?into platform driver.
? ? 3. Initialize pxa_gpio_regs in gpio-pxa.c
? ? 4. Simplify code of identifing pxa gpio series or mmp gpio series. ? ? 5. Use linux/io.h instead of asm/io.h.

Quoted 8 lines
Quoted 5 lines

This series looks fine to me. ?You don't mention what it's based upon - should I assume my gpio patch series? ?If so, it looks fine to be submitted to the patch system.

It would be nice to have a few acks from people against it first though.

I assume this clashes with patches 7103/1 and 7104/1 in the patch system. Should I ignore those two for the meantime?

This series includes the stuff in those patches so if these are cleared feel free to drop 7103/1 + 7104/1 and apply these instead, they do the same thing and some more.

Yours,
Linus Walleij

maintainer
#9 lore raw

v2 cover ARM: pxa: move gpio driver into drivers directory

In reply to Russell King - ARM Linux
Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Haojian Zhuang

Changelog:
v2:
? ? ? 1. Remove gpio.c from mach-pxa & mach-mmp that is introduced from v1. ? ? ? 2. Remove init function in gpio.c. Move the platfrom_device_register() ? ? ? ? ?into platform driver.
? ? ? 3. Initialize pxa_gpio_regs in gpio-pxa.c
? ? ? 4. Simplify code of identifing pxa gpio series or mmp gpio series. ? ? ? 5. Use linux/io.h instead of asm/io.h.

Quoted 8 lines

This series looks fine to me. ?You don't mention what it's based upon - should I assume my gpio patch series? ?If so, it looks fine to be submitted to the patch system.

It would be nice to have a few acks from people against it first though.

Thanks.

I'm sorry that I was in holiday in the last week, and I missed these mails. It seems that linus's patch is already merged into your git tree. And my codebase is linux-next.git.

So I'll re-format these patches based on your git tree, and I'll paste it again.

Thanks
Haojian