From b8f649f1f531914a30ecb420e7565ee04dccc2ad Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Tue, 9 Apr 2013 18:12:04 +0800 Subject: ARM: pxa: move PXA_GPIO_TO_IRQ macro Since PXA_GPIO_TO_IRQ() & MMP_GPIO_TO_IRQ() macro are depended on arch code, move them from gpio driver to platform driver instead. Signed-off-by: Haojian Zhuang Acked-by: Linus Walleij --- arch/arm/mach-mmp/aspenite.c | 7 +++++++ arch/arm/mach-mmp/avengers_lite.c | 7 +++++++ arch/arm/mach-mmp/brownstone.c | 7 +++++++ arch/arm/mach-mmp/flint.c | 7 +++++++ arch/arm/mach-mmp/gplugd.c | 7 +++++++ arch/arm/mach-mmp/jasper.c | 8 ++++++++ arch/arm/mach-mmp/tavorevb.c | 7 +++++++ arch/arm/mach-mmp/teton_bga.c | 7 +++++++ arch/arm/mach-mmp/ttc_dkb.c | 7 +++++++ 9 files changed, 64 insertions(+) (limited to 'arch/arm/mach-mmp') diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index 9f64d5632e0..fa21aac5246 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c @@ -9,6 +9,7 @@ * publishhed by the Free Software Foundation. */ #include +#include #include #include #include @@ -110,6 +111,10 @@ static unsigned long common_pin_config[] __initdata = { GPIO121_KP_MKIN4, }; +static struct pxa_gpio_platform_data pxa168_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct smc91x_platdata smc91x_info = { .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, }; @@ -248,6 +253,8 @@ 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_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&pxa168_device_gpio); /* off-chip devices */ diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c index 1f94957b56a..a451a0f4d51 100644 --- a/arch/arm/mach-mmp/avengers_lite.c +++ b/arch/arm/mach-mmp/avengers_lite.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -32,12 +33,18 @@ static unsigned long avengers_lite_pin_config_V16F[] __initdata = { GPIO89_UART2_RXD, }; +static struct pxa_gpio_platform_data pxa168_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static void __init avengers_lite_init(void) { mfp_config(ARRAY_AND_SIZE(avengers_lite_pin_config_V16F)); /* on-chip devices */ pxa168_add_uart(2); + platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&pxa168_device_gpio); } diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 2358011c7d8..ac25544b8cd 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -104,6 +105,10 @@ static unsigned long brownstone_pin_config[] __initdata = { GPIO89_GPIO, }; +static struct pxa_gpio_platform_data mmp2_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct regulator_consumer_supply max8649_supply[] = { REGULATOR_SUPPLY("vcc_core", NULL), }; @@ -202,6 +207,8 @@ static void __init brownstone_init(void) /* on-chip devices */ mmp2_add_uart(1); mmp2_add_uart(3); + platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&mmp2_device_gpio); mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index 754c352dd02..6291c33d83e 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -77,6 +78,10 @@ static unsigned long flint_pin_config[] __initdata = { GPIO160_ND_RDY1, }; +static struct pxa_gpio_platform_data mmp2_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct smc91x_platdata flint_smc91x_info = { .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, }; @@ -111,6 +116,8 @@ static void __init flint_init(void) /* on-chip devices */ mmp2_add_uart(1); mmp2_add_uart(2); + platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&mmp2_device_gpio); /* off-chip devices */ diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c index f62b68d926f..d81b2475e67 100644 --- a/arch/arm/mach-mmp/gplugd.c +++ b/arch/arm/mach-mmp/gplugd.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -128,6 +129,10 @@ static unsigned long gplugd_pin_config[] __initdata = { GPIO116_I2S_TXD }; +static struct pxa_gpio_platform_data pxa168_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct i2c_board_info gplugd_i2c_board_info[] = { { .type = "isl1208", @@ -186,6 +191,8 @@ static void __init gplugd_init(void) pxa168_add_uart(3); pxa168_add_ssp(1); pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); + platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&pxa168_device_gpio); pxa168_add_eth(&gplugd_eth_platform_data); diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index 66634fd0ecb..0e9e5c05b37 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -99,6 +100,10 @@ static unsigned long jasper_pin_config[] __initdata = { GPIO151_MMC3_CLK, }; +static struct pxa_gpio_platform_data mmp2_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct regulator_consumer_supply max8649_supply[] = { REGULATOR_SUPPLY("vcc_core", NULL), }; @@ -165,6 +170,9 @@ static void __init jasper_init(void) mmp2_add_uart(1); mmp2_add_uart(3); mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); + platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); + platform_device_register(&mmp2_device_gpio); mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ regulator_has_full_constraints(); diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c index 4c127d23955..cdfc9bfee1a 100644 --- a/arch/arm/mach-mmp/tavorevb.c +++ b/arch/arm/mach-mmp/tavorevb.c @@ -8,6 +8,7 @@ * publishhed by the Free Software Foundation. */ #include +#include #include #include #include @@ -60,6 +61,10 @@ static unsigned long tavorevb_pin_config[] __initdata = { DF_RDY0_DF_RDY0, }; +static struct pxa_gpio_platform_data pxa910_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct smc91x_platdata tavorevb_smc91x_info = { .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, }; @@ -93,6 +98,8 @@ static void __init tavorevb_init(void) /* on-chip devices */ pxa910_add_uart(1); + platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&pxa910_device_gpio); /* off-chip devices */ diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c index 8609967975e..e4d95b4c6bb 100644 --- a/arch/arm/mach-mmp/teton_bga.c +++ b/arch/arm/mach-mmp/teton_bga.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +50,10 @@ static unsigned long teton_bga_pin_config[] __initdata = { GPIO78_GPIO, }; +static struct pxa_gpio_platform_data pxa168_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static unsigned int teton_bga_matrix_key_map[] = { KEY(0, 6, KEY_ESC), KEY(0, 7, KEY_ENTER), @@ -79,6 +84,8 @@ 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_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_device_register(&pxa168_device_gpio); } diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index 22a9058f9f4..6aa78887292 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,10 @@ static unsigned long ttc_dkb_pin_config[] __initdata = { DF_RDY0_DF_RDY0, }; +static struct pxa_gpio_platform_data pxa910_gpio_pdata = { + .irq_base = MMP_GPIO_TO_IRQ(0), +}; + static struct mtd_partition ttc_dkb_onenand_partitions[] = { { .name = "bootloader", @@ -284,6 +289,8 @@ static void __init ttc_dkb_init(void) /* off-chip devices */ pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); + platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata, + sizeof(struct pxa_gpio_platform_data)); platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); #ifdef CONFIG_USB_MV_UDC -- cgit v1.2.3