Skip to content

Commit

Permalink
arm/mxc: do not use gpio_to_irq() for static initializers
Browse files Browse the repository at this point in the history
The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and replaces
all the uses of gpio_to_irq() in static initializers with
IMX_GPIO_TO_IRQ().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Shawn Guo authored and Sascha Hauer committed Aug 16, 2011
1 parent 93ee7a9 commit e309fb1
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mach-cpuimx35.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mach-mx27_3ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mach-vpr200.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
};

Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-mx5/board-cpuimx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,31 @@
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,
.iotype = UPIO_MEM,
.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,
.iotype = UPIO_MEM,
.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,
.iotype = UPIO_MEM,
.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,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-mx5/board-cpuimx51sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
};

Expand Down Expand Up @@ -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)
},
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-mx5/board-mx53_ard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mx5/mx51_efika.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
};

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/plat-mxc/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,6 @@
.type = _type, \
}

#define IMX_GPIO_TO_IRQ(gpio) (MXC_GPIO_IRQ_START + (gpio))

#endif /* __ASM_ARCH_MXC_HARDWARE_H__ */

0 comments on commit e309fb1

Please sign in to comment.