linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h
@ 2011-08-12  7:54 Shawn Guo
  2011-08-12  7:54 ` [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number Shawn Guo
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

As one step to single image for multiple platforms, mach/gpio.h needs
to be removed from asm/gpio.h.  The patch set cleans up IMX/MXC
mach/gpio.h to an empty header.

It's based on v3.1-rc1 plus rmk's patch series below.

  [PATCH 00/13] Clean up mach/gpio.h headers

Shawn Guo (6):
      arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
      arm/imx: remove the uses of gpio_to_irq()
      gpio/mxc: add .to_irq for gpio chip
      arm/imx: remove gpio_to_irq() from mach/gpio.h
      gpio/mxc: move irq_to_gpio() into gpio-mxc driver
      arm/mxc: move IMX_GPIO_NR into mach/hardware.h

 arch/arm/mach-imx/mach-armadillo5x0.c        |    3 ++-
 arch/arm/mach-imx/mach-cpuimx35.c            |    2 +-
 arch/arm/mach-imx/mach-mx27_3ds.c            |    8 ++++----
 arch/arm/mach-imx/mach-mx31moboard.c         |    4 ++--
 arch/arm/mach-imx/mach-mx35_3ds.c            |    2 +-
 arch/arm/mach-imx/mach-vpr200.c              |    2 +-
 arch/arm/mach-imx/mx31moboard-devboard.c     |    4 ++--
 arch/arm/mach-imx/mx31moboard-marxbot.c      |    4 ++--
 arch/arm/mach-mx5/board-cpuimx51.c           |    8 ++++----
 arch/arm/mach-mx5/board-cpuimx51sd.c         |    4 ++--
 arch/arm/mach-mx5/board-mx51_3ds.c           |    2 +-
 arch/arm/mach-mx5/board-mx53_ard.c           |    4 ++--
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c |    4 ++--
 arch/arm/mach-mx5/mx51_efika.c               |    2 +-
 arch/arm/plat-mxc/include/mach/gpio.h        |   11 -----------
 arch/arm/plat-mxc/include/mach/hardware.h    |    6 ++++++
 drivers/gpio/gpio-mxc.c                      |   12 ++++++++++++

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
@ 2011-08-12  7:54 ` Shawn Guo
  2011-08-12  9:36   ` Jason Liu
  2011-08-12  7:54 ` [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq() Shawn Guo
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

Instead of irq_to_gpio(), gpio_to_irq() should be used to get irq
from gpio number.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-mx5/board-cpuimx51.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 7c893fa..68934ea 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
 	}, {
 		.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
-		.irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
+		.irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
 		.irqflags = IRQF_TRIGGER_HIGH,
 		.uartclk = CPUIMX51_QUART_XTAL,
 		.regshift = CPUIMX51_QUART_REGSHIFT,
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
  2011-08-12  7:54 ` [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number Shawn Guo
@ 2011-08-12  7:54 ` Shawn Guo
  2011-08-12  8:00   ` Russell King - ARM Linux
  2011-08-12  7:54 ` [PATCH 3/6] gpio/mxc: add .to_irq for gpio chip Shawn Guo
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

gpio_to_irq() is too generic to be defined and used by i.mx platform
code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/mach-armadillo5x0.c        |    3 ++-
 arch/arm/mach-imx/mach-cpuimx35.c            |    2 +-
 arch/arm/mach-imx/mach-mx27_3ds.c            |    8 ++++----
 arch/arm/mach-imx/mach-mx31moboard.c         |    4 ++--
 arch/arm/mach-imx/mach-mx35_3ds.c            |    2 +-
 arch/arm/mach-imx/mach-vpr200.c              |    2 +-
 arch/arm/mach-imx/mx31moboard-devboard.c     |    4 ++--
 arch/arm/mach-imx/mx31moboard-marxbot.c      |    4 ++--
 arch/arm/mach-mx5/board-cpuimx51.c           |    8 ++++----
 arch/arm/mach-mx5/board-cpuimx51sd.c         |    4 ++--
 arch/arm/mach-mx5/board-mx51_3ds.c           |    2 +-
 arch/arm/mach-mx5/board-mx53_ard.c           |    4 ++--
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c |    4 ++--
 arch/arm/mach-mx5/mx51_efika.c               |    2 +-
 arch/arm/plat-mxc/include/mach/hardware.h    |    2 ++
 15 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index ede2710..2ecb62d 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -527,7 +527,8 @@ static void __init armadillo5x0_init(void)
 	/* Get RTC IRQ and register the chip */
 	if (gpio_request(ARMADILLO5X0_RTC_GPIO, "rtc") == 0) {
 		if (gpio_direction_input(ARMADILLO5X0_RTC_GPIO) == 0)
-			armadillo5x0_i2c_rtc.irq = gpio_to_irq(ARMADILLO5X0_RTC_GPIO);
+			armadillo5x0_i2c_rtc.irq =
+				IMX_GPIO_TO_IRQ(ARMADILLO5X0_RTC_GPIO);
 		else
 			gpio_free(ARMADILLO5X0_RTC_GPIO);
 	}
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c
index f39a478b..13b7041 100644
--- a/arch/arm/mach-imx/mach-cpuimx35.c
+++ b/arch/arm/mach-imx/mach-cpuimx35.c
@@ -66,7 +66,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
 		I2C_BOARD_INFO("tsc2007", 0x48),
 		.type		= "tsc2007",
 		.platform_data	= &tsc2007_info,
-		.irq		= gpio_to_irq(TSC2007_IRQGPIO),
+		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
 	},
 };
 
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 6fa6934..7f3833e 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -46,7 +46,7 @@
 #define SD1_EN_GPIO		IMX_GPIO_NR(2, 25)
 #define OTG_PHY_RESET_GPIO	IMX_GPIO_NR(2, 23)
 #define SPI2_SS0		IMX_GPIO_NR(4, 21)
-#define EXPIO_PARENT_INT	gpio_to_irq(IMX_GPIO_NR(3, 28))
+#define EXPIO_PARENT_INT	IMX_GPIO_TO_IRQ(IMX_GPIO_NR(3, 28))
 #define PMIC_INT		IMX_GPIO_NR(3, 14)
 #define SPI1_SS0		IMX_GPIO_NR(4, 28)
 #define SD1_CD			IMX_GPIO_NR(2, 26)
@@ -171,13 +171,13 @@ static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = {
 static int mx27_3ds_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
 				void *data)
 {
-	return request_irq(gpio_to_irq(SD1_CD), detect_irq,
+	return request_irq(IMX_GPIO_TO_IRQ(SD1_CD), detect_irq,
 	IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
 }
 
 static void mx27_3ds_sdhc1_exit(struct device *dev, void *data)
 {
-	free_irq(gpio_to_irq(SD1_CD), data);
+	free_irq(IMX_GPIO_TO_IRQ(SD1_CD), data);
 }
 
 static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
@@ -359,7 +359,7 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
 		.bus_num	= 1,
 		.chip_select	= 0, /* SS0 */
 		.platform_data	= &mc13783_pdata,
-		.irq = gpio_to_irq(PMIC_INT),
+		.irq = IMX_GPIO_TO_IRQ(PMIC_INT),
 		.mode = SPI_CS_HIGH,
 	}, {
 		.modalias	= "l4f00242t03",
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index b358383..649a937 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -319,7 +319,7 @@ static int moboard_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
 		goto err_gpio_free;
 	gpio_direction_input(SDHC1_WP);
 
-	ret = request_irq(gpio_to_irq(SDHC1_CD), detect_irq,
+	ret = request_irq(IMX_GPIO_TO_IRQ(SDHC1_CD), detect_irq,
 		IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 		"sdhc1-card-detect", data);
 	if (ret)
@@ -337,7 +337,7 @@ err_gpio_free:
 
 static void moboard_sdhc1_exit(struct device *dev, void *data)
 {
-	free_irq(gpio_to_irq(SDHC1_CD), data);
+	free_irq(IMX_GPIO_TO_IRQ(SDHC1_CD), data);
 	gpio_free(SDHC1_WP);
 	gpio_free(SDHC1_CD);
 }
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index b3b9bd8..bc68eba 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -43,7 +43,7 @@
 
 #include "devices-imx35.h"
 
-#define EXPIO_PARENT_INT	gpio_to_irq(IMX_GPIO_NR(1, 1))
+#define EXPIO_PARENT_INT	IMX_GPIO_TO_IRQ(IMX_GPIO_NR(1, 1))
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
 	.flags = IMXUART_HAVE_RTSCTS,
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 7d8e012..5250283 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -162,7 +162,7 @@ static struct i2c_board_info vpr200_i2c_devices[] = {
 	}, {
 		I2C_BOARD_INFO("mc13892", 0x08),
 		.platform_data = &vpr200_pmic,
-		.irq = gpio_to_irq(GPIO_PMIC_INT),
+		.irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT),
 	}
 };
 
diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c
index 0aa2536..6dfb602 100644
--- a/arch/arm/mach-imx/mx31moboard-devboard.c
+++ b/arch/arm/mach-imx/mx31moboard-devboard.c
@@ -77,7 +77,7 @@ static int devboard_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
 		goto err_gpio_free;
 	gpio_direction_input(SDHC2_WP);
 
-	ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
+	ret = request_irq(IMX_GPIO_TO_IRQ(SDHC2_CD), detect_irq,
 		IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 		"sdhc2-card-detect", data);
 	if (ret)
@@ -95,7 +95,7 @@ err_gpio_free:
 
 static void devboard_sdhc2_exit(struct device *dev, void *data)
 {
-	free_irq(gpio_to_irq(SDHC2_CD), data);
+	free_irq(IMX_GPIO_TO_IRQ(SDHC2_CD), data);
 	gpio_free(SDHC2_WP);
 	gpio_free(SDHC2_CD);
 }
diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c
index bb639cb..8f8664f 100644
--- a/arch/arm/mach-imx/mx31moboard-marxbot.c
+++ b/arch/arm/mach-imx/mx31moboard-marxbot.c
@@ -89,7 +89,7 @@ static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
 		goto err_gpio_free;
 	gpio_direction_input(SDHC2_WP);
 
-	ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
+	ret = request_irq(IMX_GPIO_TO_IRQ(SDHC2_CD), detect_irq,
 		IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 		"sdhc2-card-detect", data);
 	if (ret)
@@ -107,7 +107,7 @@ err_gpio_free:
 
 static void marxbot_sdhc2_exit(struct device *dev, void *data)
 {
-	free_irq(gpio_to_irq(SDHC2_CD), data);
+	free_irq(IMX_GPIO_TO_IRQ(SDHC2_CD), data);
 	gpio_free(SDHC2_WP);
 	gpio_free(SDHC2_CD);
 }
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 68934ea..49ec98e 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -57,7 +57,7 @@
 static struct plat_serial8250_port serial_platform_data[] = {
 	{
 		.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
-		.irq = gpio_to_irq(CPUIMX51_QUARTA_GPIO),
+		.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTA_GPIO),
 		.irqflags = IRQF_TRIGGER_HIGH,
 		.uartclk = CPUIMX51_QUART_XTAL,
 		.regshift = CPUIMX51_QUART_REGSHIFT,
@@ -65,7 +65,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
 	}, {
 		.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
-		.irq = gpio_to_irq(CPUIMX51_QUARTB_GPIO),
+		.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTB_GPIO),
 		.irqflags = IRQF_TRIGGER_HIGH,
 		.uartclk = CPUIMX51_QUART_XTAL,
 		.regshift = CPUIMX51_QUART_REGSHIFT,
@@ -73,7 +73,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
 	}, {
 		.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
-		.irq = gpio_to_irq(CPUIMX51_QUARTC_GPIO),
+		.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTC_GPIO),
 		.irqflags = IRQF_TRIGGER_HIGH,
 		.uartclk = CPUIMX51_QUART_XTAL,
 		.regshift = CPUIMX51_QUART_REGSHIFT,
@@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
 		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
 	}, {
 		.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
-		.irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
+		.irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTD_GPIO),
 		.irqflags = IRQF_TRIGGER_HIGH,
 		.uartclk = CPUIMX51_QUART_XTAL,
 		.regshift = CPUIMX51_QUART_REGSHIFT,
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index ff096d5..8badbdb 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -129,7 +129,7 @@ static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
 		I2C_BOARD_INFO("tsc2007", 0x49),
 		.type		= "tsc2007",
 		.platform_data	= &tsc2007_info,
-		.irq		= gpio_to_irq(TSC2007_IRQGPIO),
+		.irq		= IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
 	},
 };
 
@@ -245,7 +245,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = {
 		.mode		= SPI_MODE_0,
 		.chip_select     = 0,
 		.platform_data   = &mcp251x_info,
-		.irq             = gpio_to_irq(CAN_IRQGPIO)
+		.irq             = IMX_GPIO_TO_IRQ(CAN_IRQGPIO)
 	},
 };
 
diff --git a/arch/arm/mach-mx5/board-mx51_3ds.c b/arch/arm/mach-mx5/board-mx51_3ds.c
index 07a3815..2cb2a4b 100644
--- a/arch/arm/mach-mx5/board-mx51_3ds.c
+++ b/arch/arm/mach-mx5/board-mx51_3ds.c
@@ -27,7 +27,7 @@
 #include "devices-imx51.h"
 #include "devices.h"
 
-#define EXPIO_PARENT_INT	gpio_to_irq(IMX_GPIO_NR(1, 6))
+#define EXPIO_PARENT_INT	IMX_GPIO_TO_IRQ(IMX_GPIO_NR(1, 6))
 #define MX51_3DS_ECSPI2_CS	(GPIO_PORTC + 28)
 
 static iomux_v3_cfg_t mx51_3ds_pads[] = {
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
index 76a67c4..ddc3015 100644
--- a/arch/arm/mach-mx5/board-mx53_ard.c
+++ b/arch/arm/mach-mx5/board-mx53_ard.c
@@ -134,8 +134,8 @@ static struct resource ard_smsc911x_resources[] = {
 		.flags = IORESOURCE_MEM,
 	},
 	{
-		.start =  gpio_to_irq(ARD_ETHERNET_INT_B),
-		.end =  gpio_to_irq(ARD_ETHERNET_INT_B),
+		.start =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
+		.end =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
 		.flags = IORESOURCE_IRQ,
 	},
 };
diff --git a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
index bbf4564..19675bb 100644
--- a/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
@@ -160,7 +160,7 @@ struct tsc2007_platform_data tsc2007_data = {
 static struct i2c_board_info mbimx51_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("tsc2007", 0x49),
-		.irq  = gpio_to_irq(MBIMX51_TSC2007_GPIO),
+		.irq  = IMX_GPIO_TO_IRQ(MBIMX51_TSC2007_GPIO),
 		.platform_data = &tsc2007_data,
 	}, {
 		I2C_BOARD_INFO("tlv320aic23", 0x1a),
@@ -197,7 +197,7 @@ void __init eukrea_mbimx51_baseboard_init(void)
 
 	gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq");
 	gpio_direction_input(MBIMX51_TSC2007_GPIO);
-	irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO),
+	irq_set_irq_type(IMX_GPIO_TO_IRQ(MBIMX51_TSC2007_GPIO),
 					IRQF_TRIGGER_FALLING);
 	i2c_register_board_info(1, mbimx51_i2c_devices,
 				ARRAY_SIZE(mbimx51_i2c_devices));
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c
index 4435e03..2a3015a 100644
--- a/arch/arm/mach-mx5/mx51_efika.c
+++ b/arch/arm/mach-mx5/mx51_efika.c
@@ -589,7 +589,7 @@ static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
 		.bus_num = 0,
 		.chip_select = 0,
 		.platform_data = &mx51_efika_mc13892_data,
-		.irq = gpio_to_irq(EFIKAMX_PMIC),
+		.irq = IMX_GPIO_TO_IRQ(EFIKAMX_PMIC),
 	},
 };
 
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index a8bfd56..77f6556 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -116,4 +116,6 @@
 	.type = _type,							\
 }
 
+#define IMX_GPIO_TO_IRQ(gpio)	(MXC_GPIO_IRQ_START + (gpio))
+
 #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/6] gpio/mxc: add .to_irq for gpio chip
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
  2011-08-12  7:54 ` [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number Shawn Guo
  2011-08-12  7:54 ` [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq() Shawn Guo
@ 2011-08-12  7:54 ` Shawn Guo
  2011-08-12  7:54 ` [PATCH 4/6] arm/imx: remove gpio_to_irq() from mach/gpio.h Shawn Guo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

It adds .to_irq support for gpio chip, so that __gpio_to_irq in
gpiolib becomes usable.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/gpio/gpio-mxc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 4340aca..64aff20 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -337,6 +337,15 @@ static void __devinit mxc_gpio_get_hw(struct platform_device *pdev)
 	mxc_gpio_hwtype = hwtype;
 }
 
+static int mxc_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
+{
+	struct bgpio_chip *bgc = to_bgpio_chip(gc);
+	struct mxc_gpio_port *port =
+		container_of(bgc, struct mxc_gpio_port, bgc);
+
+	return port->virtual_irq_start + offset;
+}
+
 static int __devinit mxc_gpio_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
@@ -403,6 +412,7 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
 	if (err)
 		goto out_iounmap;
 
+	port->bgc.gc.to_irq = mxc_gpio_to_irq;
 	port->bgc.gc.base = pdev->id * 32;
 	port->bgc.dir = port->bgc.read_reg(port->bgc.reg_dir);
 	port->bgc.data = port->bgc.read_reg(port->bgc.reg_set);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 4/6] arm/imx: remove gpio_to_irq() from mach/gpio.h
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
                   ` (2 preceding siblings ...)
  2011-08-12  7:54 ` [PATCH 3/6] gpio/mxc: add .to_irq for gpio chip Shawn Guo
@ 2011-08-12  7:54 ` Shawn Guo
  2011-08-12  7:55 ` [PATCH 5/6] gpio/mxc: move irq_to_gpio() into gpio-mxc driver Shawn Guo
  2011-08-12  7:55 ` [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h Shawn Guo
  5 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:54 UTC (permalink / raw)
  To: linux-arm-kernel

As all the users of gpio_to_irq() has migrated to IMX_GPIO_TO_IRQ,
gpio_to_irq() can be removed from mach/gpio.h now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/plat-mxc/include/mach/gpio.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 3e1ffc8..9a7c750 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -27,7 +27,6 @@
 /* range e.g. GPIO_1_5 is gpio 5 under linux */
 #define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
 
-#define gpio_to_irq(gpio)	(MXC_GPIO_IRQ_START + (gpio))
 #define irq_to_gpio(irq)	((irq) - MXC_GPIO_IRQ_START)
 
 #endif
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 5/6] gpio/mxc: move irq_to_gpio() into gpio-mxc driver
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
                   ` (3 preceding siblings ...)
  2011-08-12  7:54 ` [PATCH 4/6] arm/imx: remove gpio_to_irq() from mach/gpio.h Shawn Guo
@ 2011-08-12  7:55 ` Shawn Guo
  2011-08-12  7:55 ` [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h Shawn Guo
  5 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

As irq_to_gpio() is only being used by gpio-mxc driver, it should be
moved from mach/gpio.h into gpio-mxc.c.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
---
 arch/arm/plat-mxc/include/mach/gpio.h |    2 --
 drivers/gpio/gpio-mxc.c               |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 9a7c750..8e5276c 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -27,6 +27,4 @@
 /* range e.g. GPIO_1_5 is gpio 5 under linux */
 #define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
 
-#define irq_to_gpio(irq)	((irq) - MXC_GPIO_IRQ_START)
-
 #endif
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 64aff20..b588f8a 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -31,6 +31,8 @@
 #include <linux/of_device.h>
 #include <asm-generic/bug.h>
 
+#define irq_to_gpio(irq)	((irq) - MXC_GPIO_IRQ_START)
+
 enum mxc_gpio_hwtype {
 	IMX1_GPIO,	/* runs on i.mx1 */
 	IMX21_GPIO,	/* runs on i.mx21 and i.mx27 */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h
  2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
                   ` (4 preceding siblings ...)
  2011-08-12  7:55 ` [PATCH 5/6] gpio/mxc: move irq_to_gpio() into gpio-mxc driver Shawn Guo
@ 2011-08-12  7:55 ` Shawn Guo
  2011-08-12  8:02   ` Russell King - ARM Linux
  5 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  7:55 UTC (permalink / raw)
  To: linux-arm-kernel

The patch moves IMX_GPIO_NR into mach/hardware.h, so that mach/gpio.h
becomes an empty header and can wait for a global removal from
asm/gpio.h.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/plat-mxc/include/mach/gpio.h     |    8 --------
 arch/arm/plat-mxc/include/mach/hardware.h |    4 ++++
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
index 8e5276c..54fe5cb 100644
--- a/arch/arm/plat-mxc/include/mach/gpio.h
+++ b/arch/arm/plat-mxc/include/mach/gpio.h
@@ -19,12 +19,4 @@
 #ifndef __ASM_ARCH_MXC_GPIO_H__
 #define __ASM_ARCH_MXC_GPIO_H__
 
-#include <linux/spinlock.h>
-#include <mach/hardware.h>
-
-
-/* There's a off-by-one betweem the gpio bank number and the gpiochip */
-/* range e.g. GPIO_1_5 is gpio 5 under linux */
-#define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
-
 #endif
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 77f6556..f57ec47 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -116,6 +116,10 @@
 	.type = _type,							\
 }
 
+/* There's a off-by-one betweem the gpio bank number and the gpiochip */
+/* range e.g. GPIO_1_5 is gpio 5 under linux */
+#define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
+
 #define IMX_GPIO_TO_IRQ(gpio)	(MXC_GPIO_IRQ_START + (gpio))
 
 #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  7:54 ` [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq() Shawn Guo
@ 2011-08-12  8:00   ` Russell King - ARM Linux
  2011-08-12  8:22     ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2011-08-12  8:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> gpio_to_irq() is too generic to be defined and used by i.mx platform
> code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().

That makes no sense.  Why not continue to use gpio_to_irq() but provide
the .to_irq method in your gpiolib driver so it can work, and use that
in the places where its used at runtime?

(You won't be able to use it for static initialization obviously.)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h
  2011-08-12  7:55 ` [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h Shawn Guo
@ 2011-08-12  8:02   ` Russell King - ARM Linux
  2011-08-12  8:23     ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2011-08-12  8:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 03:55:01PM +0800, Shawn Guo wrote:
> The patch moves IMX_GPIO_NR into mach/hardware.h, so that mach/gpio.h
> becomes an empty header and can wait for a global removal from
> asm/gpio.h.
> 
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/plat-mxc/include/mach/gpio.h     |    8 --------
>  arch/arm/plat-mxc/include/mach/hardware.h |    4 ++++
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
> index 8e5276c..54fe5cb 100644
> --- a/arch/arm/plat-mxc/include/mach/gpio.h
> +++ b/arch/arm/plat-mxc/include/mach/gpio.h
> @@ -19,12 +19,4 @@
>  #ifndef __ASM_ARCH_MXC_GPIO_H__
>  #define __ASM_ARCH_MXC_GPIO_H__
>  
> -#include <linux/spinlock.h>
> -#include <mach/hardware.h>
> -
> -
> -/* There's a off-by-one betweem the gpio bank number and the gpiochip */
> -/* range e.g. GPIO_1_5 is gpio 5 under linux */
> -#define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
> -
>  #endif

Please also remove the ifndef...endif, replacing it with a single line
of /* empty */ - this matches what has been done on other SoCs, and will
make the empty files trivially grep-able.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  8:00   ` Russell King - ARM Linux
@ 2011-08-12  8:22     ` Shawn Guo
  2011-08-12  8:25       ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  8:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 09:00:00AM +0100, Russell King - ARM Linux wrote:
> On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> > gpio_to_irq() is too generic to be defined and used by i.mx platform
> > code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> > replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().
> 
> That makes no sense.  Why not continue to use gpio_to_irq() but provide
> the .to_irq method in your gpiolib driver so it can work, and use that
> in the places where its used at runtime?
> 
I did provide .to_irq in patch #3. 

> (You won't be able to use it for static initialization obviously.)
> 
All users of gpio_to_irq() in platform codes are static initialization.
And IMX_GPIO_TO_IRQ() is actually a renaming of gpio_to_irq().  Only
difference there is naming and place change, which I think is good, no?

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h
  2011-08-12  8:02   ` Russell King - ARM Linux
@ 2011-08-12  8:23     ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 09:02:40AM +0100, Russell King - ARM Linux wrote:
> On Fri, Aug 12, 2011 at 03:55:01PM +0800, Shawn Guo wrote:
> > The patch moves IMX_GPIO_NR into mach/hardware.h, so that mach/gpio.h
> > becomes an empty header and can wait for a global removal from
> > asm/gpio.h.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> >  arch/arm/plat-mxc/include/mach/gpio.h     |    8 --------
> >  arch/arm/plat-mxc/include/mach/hardware.h |    4 ++++
> >  2 files changed, 4 insertions(+), 8 deletions(-)
> > 
> > diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
> > index 8e5276c..54fe5cb 100644
> > --- a/arch/arm/plat-mxc/include/mach/gpio.h
> > +++ b/arch/arm/plat-mxc/include/mach/gpio.h
> > @@ -19,12 +19,4 @@
> >  #ifndef __ASM_ARCH_MXC_GPIO_H__
> >  #define __ASM_ARCH_MXC_GPIO_H__
> >  
> > -#include <linux/spinlock.h>
> > -#include <mach/hardware.h>
> > -
> > -
> > -/* There's a off-by-one betweem the gpio bank number and the gpiochip */
> > -/* range e.g. GPIO_1_5 is gpio 5 under linux */
> > -#define IMX_GPIO_NR(bank, nr)		(((bank) - 1) * 32 + (nr))
> > -
> >  #endif
> 
> Please also remove the ifndef...endif, replacing it with a single line
> of /* empty */ - this matches what has been done on other SoCs, and will
> make the empty files trivially grep-able.
> 
Ok, will do.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  8:22     ` Shawn Guo
@ 2011-08-12  8:25       ` Shawn Guo
  2011-08-12  8:57         ` Russell King - ARM Linux
  0 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  8:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 04:22:12PM +0800, Shawn Guo wrote:
> On Fri, Aug 12, 2011 at 09:00:00AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> > > gpio_to_irq() is too generic to be defined and used by i.mx platform
> > > code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> > > replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().
> > 
> > That makes no sense.  Why not continue to use gpio_to_irq() but provide
> > the .to_irq method in your gpiolib driver so it can work, and use that
> > in the places where its used at runtime?
> > 
> I did provide .to_irq in patch #3. 
> 
> > (You won't be able to use it for static initialization obviously.)
> > 
> All users of gpio_to_irq() in platform codes are static initialization.

Sorry, not all but most.

> And IMX_GPIO_TO_IRQ() is actually a renaming of gpio_to_irq().  Only
> difference there is naming and place change, which I think is good, no?
> 

But adding IMX namespace is still worth of the LOC changes?

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  8:25       ` Shawn Guo
@ 2011-08-12  8:57         ` Russell King - ARM Linux
  2011-08-12  9:27           ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2011-08-12  8:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 04:25:39PM +0800, Shawn Guo wrote:
> On Fri, Aug 12, 2011 at 04:22:12PM +0800, Shawn Guo wrote:
> > On Fri, Aug 12, 2011 at 09:00:00AM +0100, Russell King - ARM Linux wrote:
> > > On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> > > > gpio_to_irq() is too generic to be defined and used by i.mx platform
> > > > code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> > > > replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().
> > > 
> > > That makes no sense.  Why not continue to use gpio_to_irq() but provide
> > > the .to_irq method in your gpiolib driver so it can work, and use that
> > > in the places where its used at runtime?
> > > 
> > I did provide .to_irq in patch #3. 
> > 
> > > (You won't be able to use it for static initialization obviously.)
> > > 
> > All users of gpio_to_irq() in platform codes are static initialization.
> 
> Sorry, not all but most.

It would probably be a good idea to leave the runtime places using
gpio_to_irq() and only convert the static initializers.

> > And IMX_GPIO_TO_IRQ() is actually a renaming of gpio_to_irq().  Only
> > difference there is naming and place change, which I think is good, no?
> > 
> 
> But adding IMX namespace is still worth of the LOC changes?

Well, the static initializers still need something... the alternative is
to initialize them at runtime which probably wouldn't be so nice.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()
  2011-08-12  8:57         ` Russell King - ARM Linux
@ 2011-08-12  9:27           ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-12  9:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 09:57:59AM +0100, Russell King - ARM Linux wrote:
> On Fri, Aug 12, 2011 at 04:25:39PM +0800, Shawn Guo wrote:
> > On Fri, Aug 12, 2011 at 04:22:12PM +0800, Shawn Guo wrote:
> > > On Fri, Aug 12, 2011 at 09:00:00AM +0100, Russell King - ARM Linux wrote:
> > > > On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> > > > > gpio_to_irq() is too generic to be defined and used by i.mx platform
> > > > > code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> > > > > replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().
> > > > 
> > > > That makes no sense.  Why not continue to use gpio_to_irq() but provide
> > > > the .to_irq method in your gpiolib driver so it can work, and use that
> > > > in the places where its used at runtime?
> > > > 
> > > I did provide .to_irq in patch #3. 
> > > 
> > > > (You won't be able to use it for static initialization obviously.)
> > > > 
> > > All users of gpio_to_irq() in platform codes are static initialization.
> > 
> > Sorry, not all but most.
> 
> It would probably be a good idea to leave the runtime places using
> gpio_to_irq() and only convert the static initializers.
> 
Ok.

> > > And IMX_GPIO_TO_IRQ() is actually a renaming of gpio_to_irq().  Only
> > > difference there is naming and place change, which I think is good, no?
> > > 
> > 
> > But adding IMX namespace is still worth of the LOC changes?
> 
> Well, the static initializers still need something... the alternative is
> to initialize them at runtime which probably wouldn't be so nice.
> 
Let's leave static initializers with IMX_GPIO_TO_IRQ() for now, since
all of them will get killed by device tree support anyway?  With DT
support, the gpio number should be encoded in DT and needs to be
retrieved from DT at runtime, and gpio_to_irq() has to be used for
acquiring irq number then.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
  2011-08-12  7:54 ` [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number Shawn Guo
@ 2011-08-12  9:36   ` Jason Liu
  2011-08-12 11:13     ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Jason Liu @ 2011-08-12  9:36 UTC (permalink / raw)
  To: linux-arm-kernel

2011/8/12 Shawn Guo <shawn.guo@linaro.org>:
> Instead of irq_to_gpio(), gpio_to_irq() should be used to get irq
> from gpio number.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> ?arch/arm/mach-mx5/board-cpuimx51.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
> index 7c893fa..68934ea 100644
> --- a/arch/arm/mach-mx5/board-cpuimx51.c
> +++ b/arch/arm/mach-mx5/board-cpuimx51.c
> @@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
> ? ? ? ? ? ? ? ?.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
> ? ? ? ?}, {
> ? ? ? ? ? ? ? ?.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
> - ? ? ? ? ? ? ? .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
> + ? ? ? ? ? ? ? .irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
> ? ? ? ? ? ? ? ?.irqflags = IRQF_TRIGGER_HIGH,
> ? ? ? ? ? ? ? ?.uartclk = CPUIMX51_QUART_XTAL,
> ? ? ? ? ? ? ? ?.regshift = CPUIMX51_QUART_REGSHIFT,
> --

The fix has already in Sascah's tree:

Author: Ben Dooks <ben-linux@fluff.org>
Date:   Thu Aug 4 16:47:35 2011 +0100

    ARM: mx5: board-cpuimx51.c fixup irq_to_gpio() usage

    irq_to_gpio() is being called on a GPIO so change to using
    gpio_to_irq() instead.

    Signed-off-by: Ben Dooks <ben-linux@fluff.org>
    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Jason

> 1.7.4.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
  2011-08-12  9:36   ` Jason Liu
@ 2011-08-12 11:13     ` Shawn Guo
  2011-08-13  9:35       ` Russell King - ARM Linux
  0 siblings, 1 reply; 18+ messages in thread
From: Shawn Guo @ 2011-08-12 11:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 05:36:32PM +0800, Jason Liu wrote:
> 2011/8/12 Shawn Guo <shawn.guo@linaro.org>:
> > Instead of irq_to_gpio(), gpio_to_irq() should be used to get irq
> > from gpio number.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > ?arch/arm/mach-mx5/board-cpuimx51.c | ? ?2 +-
> > ?1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
> > index 7c893fa..68934ea 100644
> > --- a/arch/arm/mach-mx5/board-cpuimx51.c
> > +++ b/arch/arm/mach-mx5/board-cpuimx51.c
> > @@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
> > ? ? ? ? ? ? ? ?.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
> > ? ? ? ?}, {
> > ? ? ? ? ? ? ? ?.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
> > - ? ? ? ? ? ? ? .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
> > + ? ? ? ? ? ? ? .irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
> > ? ? ? ? ? ? ? ?.irqflags = IRQF_TRIGGER_HIGH,
> > ? ? ? ? ? ? ? ?.uartclk = CPUIMX51_QUART_XTAL,
> > ? ? ? ? ? ? ? ?.regshift = CPUIMX51_QUART_REGSHIFT,
> > --
> 
> The fix has already in Sascah's tree:
> 
> Author: Ben Dooks <ben-linux@fluff.org>
> Date:   Thu Aug 4 16:47:35 2011 +0100
> 
>     ARM: mx5: board-cpuimx51.c fixup irq_to_gpio() usage
> 
>     irq_to_gpio() is being called on a GPIO so change to using
>     gpio_to_irq() instead.
> 
>     Signed-off-by: Ben Dooks <ben-linux@fluff.org>
>     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> 
> Jason
> 
Sorry, I missed that.  Thanks for pointing it out, Jason.

I will fold Ben's patch here, as I see Russell would probably pick up
the series.  Otherwise, Russell, please let me know if I should base
it on Sascha's tree.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
  2011-08-12 11:13     ` Shawn Guo
@ 2011-08-13  9:35       ` Russell King - ARM Linux
  2011-08-13 12:12         ` Shawn Guo
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King - ARM Linux @ 2011-08-13  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 12, 2011 at 07:13:07PM +0800, Shawn Guo wrote:
> On Fri, Aug 12, 2011 at 05:36:32PM +0800, Jason Liu wrote:
> > 2011/8/12 Shawn Guo <shawn.guo@linaro.org>:
> > > Instead of irq_to_gpio(), gpio_to_irq() should be used to get irq
> > > from gpio number.
> > >
> > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > ---
> > > ?arch/arm/mach-mx5/board-cpuimx51.c | ? ?2 +-
> > > ?1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
> > > index 7c893fa..68934ea 100644
> > > --- a/arch/arm/mach-mx5/board-cpuimx51.c
> > > +++ b/arch/arm/mach-mx5/board-cpuimx51.c
> > > @@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
> > > ? ? ? ? ? ? ? ?.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
> > > ? ? ? ?}, {
> > > ? ? ? ? ? ? ? ?.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
> > > - ? ? ? ? ? ? ? .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
> > > + ? ? ? ? ? ? ? .irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
> > > ? ? ? ? ? ? ? ?.irqflags = IRQF_TRIGGER_HIGH,
> > > ? ? ? ? ? ? ? ?.uartclk = CPUIMX51_QUART_XTAL,
> > > ? ? ? ? ? ? ? ?.regshift = CPUIMX51_QUART_REGSHIFT,
> > > --
> > 
> > The fix has already in Sascah's tree:
> > 
> > Author: Ben Dooks <ben-linux@fluff.org>
> > Date:   Thu Aug 4 16:47:35 2011 +0100
> > 
> >     ARM: mx5: board-cpuimx51.c fixup irq_to_gpio() usage
> > 
> >     irq_to_gpio() is being called on a GPIO so change to using
> >     gpio_to_irq() instead.
> > 
> >     Signed-off-by: Ben Dooks <ben-linux@fluff.org>
> >     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > 
> > Jason
> > 
> Sorry, I missed that.  Thanks for pointing it out, Jason.
> 
> I will fold Ben's patch here, as I see Russell would probably pick up
> the series.  Otherwise, Russell, please let me know if I should base
> it on Sascha's tree.

Shouldn't this patch be targetted for -rc and maybe stable?  It's
difficult to tell from the commit description whether it really does
cause a runtime problem or not.

If it does go in to a -rc, then I can easily move my gpio patch set
forward.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number
  2011-08-13  9:35       ` Russell King - ARM Linux
@ 2011-08-13 12:12         ` Shawn Guo
  0 siblings, 0 replies; 18+ messages in thread
From: Shawn Guo @ 2011-08-13 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Aug 13, 2011 at 10:35:29AM +0100, Russell King - ARM Linux wrote:
> On Fri, Aug 12, 2011 at 07:13:07PM +0800, Shawn Guo wrote:
> > On Fri, Aug 12, 2011 at 05:36:32PM +0800, Jason Liu wrote:
> > > 2011/8/12 Shawn Guo <shawn.guo@linaro.org>:
> > > > Instead of irq_to_gpio(), gpio_to_irq() should be used to get irq
> > > > from gpio number.
> > > >
> > > > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > > ---
> > > > ?arch/arm/mach-mx5/board-cpuimx51.c | ? ?2 +-
> > > > ?1 files changed, 1 insertions(+), 1 deletions(-)
> > > >
> > > > diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
> > > > index 7c893fa..68934ea 100644
> > > > --- a/arch/arm/mach-mx5/board-cpuimx51.c
> > > > +++ b/arch/arm/mach-mx5/board-cpuimx51.c
> > > > @@ -81,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
> > > > ? ? ? ? ? ? ? ?.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
> > > > ? ? ? ?}, {
> > > > ? ? ? ? ? ? ? ?.mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
> > > > - ? ? ? ? ? ? ? .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
> > > > + ? ? ? ? ? ? ? .irq = gpio_to_irq(CPUIMX51_QUARTD_GPIO),
> > > > ? ? ? ? ? ? ? ?.irqflags = IRQF_TRIGGER_HIGH,
> > > > ? ? ? ? ? ? ? ?.uartclk = CPUIMX51_QUART_XTAL,
> > > > ? ? ? ? ? ? ? ?.regshift = CPUIMX51_QUART_REGSHIFT,
> > > > --
> > > 
> > > The fix has already in Sascah's tree:
> > > 
> > > Author: Ben Dooks <ben-linux@fluff.org>
> > > Date:   Thu Aug 4 16:47:35 2011 +0100
> > > 
> > >     ARM: mx5: board-cpuimx51.c fixup irq_to_gpio() usage
> > > 
> > >     irq_to_gpio() is being called on a GPIO so change to using
> > >     gpio_to_irq() instead.
> > > 
> > >     Signed-off-by: Ben Dooks <ben-linux@fluff.org>
> > >     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > 
> > > Jason
> > > 
> > Sorry, I missed that.  Thanks for pointing it out, Jason.
> > 
> > I will fold Ben's patch here, as I see Russell would probably pick up
> > the series.  Otherwise, Russell, please let me know if I should base
> > it on Sascha's tree.
> 
> Shouldn't this patch be targetted for -rc and maybe stable?  It's
> difficult to tell from the commit description whether it really does
> cause a runtime problem or not.
> 
> If it does go in to a -rc, then I can easily move my gpio patch set
> forward.
> 
Ah, yes.  I just noticed that the patch is on the way to -rc2 through
arm-soc tree.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2011-08-13 12:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12  7:54 [PATCH 0/6] Clean up plat-mxc/include/mach/gpio.h Shawn Guo
2011-08-12  7:54 ` [PATCH 1/6] arm/cpuimx51: gpio_to_irq() should be used to get irq from gpio number Shawn Guo
2011-08-12  9:36   ` Jason Liu
2011-08-12 11:13     ` Shawn Guo
2011-08-13  9:35       ` Russell King - ARM Linux
2011-08-13 12:12         ` Shawn Guo
2011-08-12  7:54 ` [PATCH 2/6] arm/imx: remove the uses of gpio_to_irq() Shawn Guo
2011-08-12  8:00   ` Russell King - ARM Linux
2011-08-12  8:22     ` Shawn Guo
2011-08-12  8:25       ` Shawn Guo
2011-08-12  8:57         ` Russell King - ARM Linux
2011-08-12  9:27           ` Shawn Guo
2011-08-12  7:54 ` [PATCH 3/6] gpio/mxc: add .to_irq for gpio chip Shawn Guo
2011-08-12  7:54 ` [PATCH 4/6] arm/imx: remove gpio_to_irq() from mach/gpio.h Shawn Guo
2011-08-12  7:55 ` [PATCH 5/6] gpio/mxc: move irq_to_gpio() into gpio-mxc driver Shawn Guo
2011-08-12  7:55 ` [PATCH 6/6] arm/mxc: move IMX_GPIO_NR into mach/hardware.h Shawn Guo
2011-08-12  8:02   ` Russell King - ARM Linux
2011-08-12  8:23     ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).