Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 438196c3 authored by Shawn Guo's avatar Shawn Guo
Browse files

ARM: imx: eliminate macro IRQ_GPIOx()



This patch changes all the static gpio irq number assigning with
IRQ_GPIOA() ... IRQ_GPIOF() to run-time assigning with gpio_to_irq
call, and in turn eliminates these macros.

Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
parent ed175343
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ static struct spi_board_info __maybe_unused
		.bus_num	= 0,
		.chip_select	= 0,
		.max_speed_hz	= 1500000,
		.irq		= IRQ_GPIOD(25),
		/* irq number is run-time assigned */
		.platform_data	= &ads7846_config,
		.mode           = SPI_MODE_2,
	},
@@ -329,6 +329,7 @@ void __init eukrea_mbimx27_baseboard_init(void)
	/* SPI_CS0 init */
	mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT);
	imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data);
	eukrea_mbimx27_spi_board_info[0].irq = gpio_to_irq(IMX_GPIO_NR(4, 25));
	spi_register_board_info(eukrea_mbimx27_spi_board_info,
			ARRAY_SIZE(eukrea_mbimx27_spi_board_info));

+4 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/platform_device.h>
#include <linux/mtd/physmap.h>
#include <linux/dm9000.h>
#include <linux/gpio.h>
#include <linux/i2c.h>

#include <asm/mach-types.h>
@@ -87,8 +88,7 @@ static struct resource dm9000_resources[] = {
		.end    = MX1_CS4_PHYS + 0x00C00003,
		.flags  = IORESOURCE_MEM,
	}, {
		.start  = IRQ_GPIOB(14),
		.end    = IRQ_GPIOB(14),
		/* irq number is run-time assigned */
		.flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
	},
};
@@ -129,6 +129,8 @@ static void __init apf9328_init(void)

	imx1_add_imx_i2c(&apf9328_i2c_data);

	dm9000_resources[2].start = gpio_to_irq(IMX_GPIO_NR(2, 14));
	dm9000_resources[2].end = gpio_to_irq(IMX_GPIO_NR(2, 14));
	platform_add_devices(devices, ARRAY_SIZE(devices));
}

+8 −4
Original line number Diff line number Diff line
@@ -169,28 +169,28 @@ static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = {
static struct plat_serial8250_port serial_platform_data[] = {
	{
		.mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000),
		.irq = IRQ_GPIOB(23),
		/* irq number is run-time assigned */
		.uartclk = 14745600,
		.regshift = 1,
		.iotype = UPIO_MEM,
		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
	}, {
		.mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000),
		.irq = IRQ_GPIOB(22),
		/* irq number is run-time assigned */
		.uartclk = 14745600,
		.regshift = 1,
		.iotype = UPIO_MEM,
		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
	}, {
		.mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000),
		.irq = IRQ_GPIOB(27),
		/* irq number is run-time assigned */
		.uartclk = 14745600,
		.regshift = 1,
		.iotype = UPIO_MEM,
		.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
	}, {
		.mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000),
		.irq = IRQ_GPIOB(30),
		/* irq number is run-time assigned */
		.uartclk = 14745600,
		.regshift = 1,
		.iotype = UPIO_MEM,
@@ -279,6 +279,10 @@ static void __init eukrea_cpuimx27_init(void)
#endif

#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
	serial_platform_data[0].irq = IMX_GPIO_NR(2, 23);
	serial_platform_data[1].irq = IMX_GPIO_NR(2, 22);
	serial_platform_data[2].irq = IMX_GPIO_NR(2, 27);
	serial_platform_data[3].irq = IMX_GPIO_NR(2, 30);
	platform_device_register(&serial_device);
#endif

+5 −4
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include <asm/mach/time.h>
#include <asm/system.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <mach/iomux-mx27.h>

#include "devices-imx27.h"
@@ -47,7 +48,7 @@
#define TVP5150_RSTN (GPIO_PORTC + 18)
#define TVP5150_PWDN (GPIO_PORTC + 19)
#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
#define SDHC1_IRQ IRQ_GPIOB(25)
#define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25)

#define MOTHERBOARD_BIT2	(GPIO_PORTD + 31)
#define MOTHERBOARD_BIT1	(GPIO_PORTD + 30)
@@ -294,14 +295,14 @@ static int visstrim_m10_sdhc1_init(struct device *dev,
{
	int ret;

	ret = request_irq(SDHC1_IRQ, detect_irq, IRQF_TRIGGER_FALLING,
				"mmc-detect", data);
	ret = request_irq(gpio_to_irq(SDHC1_IRQ_GPIO), detect_irq,
			  IRQF_TRIGGER_FALLING, "mmc-detect", data);
	return ret;
}

static void visstrim_m10_sdhc1_exit(struct device *dev, void *data)
{
	free_irq(SDHC1_IRQ, data);
	free_irq(gpio_to_irq(SDHC1_IRQ_GPIO), data);
}

static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = {
+11 −5
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
		(MX21ADS_MMIO_BASE_ADDR + (offset))

#define MX21ADS_CS8900A_MMIO_SIZE   0x200000
#define MX21ADS_CS8900A_IRQ         IRQ_GPIOE(11)
#define MX21ADS_CS8900A_IRQ_GPIO    IMX_GPIO_NR(5, 11)
#define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000)
#define MX21ADS_VERSION_REG         MX21ADS_REG_ADDR(0x400000)
#define MX21ADS_IO_REG              MX21ADS_REG_ADDR(0x800000)
@@ -159,9 +159,10 @@ static struct platform_device mx21ads_nor_mtd_device = {
	.resource = &mx21ads_flash_resource,
};

static const struct resource mx21ads_cs8900_resources[] __initconst = {
static struct resource mx21ads_cs8900_resources[] __initdata = {
	DEFINE_RES_MEM(MX21_CS1_BASE_ADDR, MX21ADS_CS8900A_MMIO_SIZE),
	DEFINE_RES_IRQ(MX21ADS_CS8900A_IRQ),
	/* irq number is run-time assigned */
	DEFINE_RES_IRQ(-1),
};

static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = {
@@ -241,13 +242,13 @@ static int mx21ads_sdhc_get_ro(struct device *dev)
static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq,
	void *data)
{
	return request_irq(IRQ_GPIOD(25), detect_irq,
	return request_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), detect_irq,
		IRQF_TRIGGER_FALLING, "mmc-detect", data);
}

static void mx21ads_sdhc_exit(struct device *dev, void *data)
{
	free_irq(IRQ_GPIOD(25), data);
	free_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), data);
}

static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = {
@@ -304,6 +305,11 @@ static void __init mx21ads_board_init(void)
	imx21_add_mxc_nand(&mx21ads_nand_board_info);

	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));

	mx21ads_cs8900_resources[1].start =
			gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO);
	mx21ads_cs8900_resources[1].end =
			gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO);
	platform_device_register_full(&mx21ads_cs8900_devinfo);
}

Loading