diff options
author | Olof Johansson <olof@lixom.net> | 2013-04-11 05:55:24 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-04-11 05:56:18 -0400 |
commit | 70384d3f12ae0981195a3d8d3e3f033887e6603c (patch) | |
tree | ccd70a8734f60e4abd750d9748c4df6013dc9aa0 | |
parent | 67028154bebd0fae7f9b2d77a5cf7bcf5e3c8ef0 (diff) | |
parent | 0a43cd3b1cc1b7e1dfc461cf55b414610d038769 (diff) |
Merge branch 'armsoc/pxa' of git://github.com/hzhuang1/linux into next/boards
A series dealing with gpio configuration cleanup from Haojian Zhuang.
* 'armsoc/pxa' of git://github.com/hzhuang1/linux:
ARM: pxa: move debug uart code
ARM: pxa: select PXA935 on saar & tavorevb
ARM: mmp: add more compatible names in gpio driver
ARM: pxa: move PXA_GPIO_TO_IRQ macro
ARM: pxa: remove cpu_is_xxx in gpio driver
Signed-off-by: Olof Johansson <olof@lixom.net>
37 files changed, 302 insertions, 141 deletions
diff --git a/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt index e13787498bcf..9b3f1d4a88d6 100644 --- a/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt +++ b/Documentation/devicetree/bindings/gpio/mrvl-gpio.txt | |||
@@ -1,7 +1,10 @@ | |||
1 | * Marvell PXA GPIO controller | 1 | * Marvell PXA GPIO controller |
2 | 2 | ||
3 | Required properties: | 3 | Required properties: |
4 | - compatible : Should be "mrvl,pxa-gpio" or "mrvl,mmp-gpio" | 4 | - compatible : Should be "intel,pxa25x-gpio", "intel,pxa26x-gpio", |
5 | "intel,pxa27x-gpio", "intel,pxa3xx-gpio", | ||
6 | "marvell,pxa93x-gpio", "marvell,mmp-gpio" or | ||
7 | "marvell,mmp2-gpio". | ||
5 | - reg : Address and length of the register set for the device | 8 | - reg : Address and length of the register set for the device |
6 | - interrupts : Should be the port interrupt shared by all gpio pins. | 9 | - interrupts : Should be the port interrupt shared by all gpio pins. |
7 | There're three gpio interrupts in arch-pxa, and they're gpio0, | 10 | There're three gpio interrupts in arch-pxa, and they're gpio0, |
@@ -18,7 +21,7 @@ Required properties: | |||
18 | Example: | 21 | Example: |
19 | 22 | ||
20 | gpio: gpio@d4019000 { | 23 | gpio: gpio@d4019000 { |
21 | compatible = "mrvl,mmp-gpio"; | 24 | compatible = "marvell,mmp-gpio"; |
22 | reg = <0xd4019000 0x1000>; | 25 | reg = <0xd4019000 0x1000>; |
23 | interrupts = <49>; | 26 | interrupts = <49>; |
24 | interrupt-name = "gpio_mux"; | 27 | interrupt-name = "gpio_mux"; |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 9b31f4311ea2..e5d2e6bbe76f 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -312,6 +312,13 @@ choice | |||
312 | Say Y here if you want kernel low-level debugging support | 312 | Say Y here if you want kernel low-level debugging support |
313 | on PicoXcell based platforms. | 313 | on PicoXcell based platforms. |
314 | 314 | ||
315 | config DEBUG_PXA_UART1 | ||
316 | depends on ARCH_PXA | ||
317 | bool "Use PXA UART1 for low-level debug" | ||
318 | help | ||
319 | Say Y here if you want kernel low-level debugging support | ||
320 | on PXA UART1. | ||
321 | |||
315 | config DEBUG_REALVIEW_STD_PORT | 322 | config DEBUG_REALVIEW_STD_PORT |
316 | bool "RealView Default UART" | 323 | bool "RealView Default UART" |
317 | depends on ARCH_REALVIEW | 324 | depends on ARCH_REALVIEW |
@@ -593,6 +600,8 @@ config DEBUG_LL_INCLUDE | |||
593 | default "debug/mvebu.S" if DEBUG_MVEBU_UART | 600 | default "debug/mvebu.S" if DEBUG_MVEBU_UART |
594 | default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART | 601 | default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART |
595 | default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART | 602 | default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART |
603 | default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \ | ||
604 | DEBUG_MMP_UART3 | ||
596 | default "debug/socfpga.S" if DEBUG_SOCFPGA_UART | 605 | default "debug/socfpga.S" if DEBUG_SOCFPGA_UART |
597 | default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 | 606 | default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1 |
598 | default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ | 607 | default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ |
diff --git a/arch/arm/boot/dts/mmp2.dtsi b/arch/arm/boot/dts/mmp2.dtsi index 1429ac05b36d..4e8b08c628c7 100644 --- a/arch/arm/boot/dts/mmp2.dtsi +++ b/arch/arm/boot/dts/mmp2.dtsi | |||
@@ -160,7 +160,7 @@ | |||
160 | }; | 160 | }; |
161 | 161 | ||
162 | gpio@d4019000 { | 162 | gpio@d4019000 { |
163 | compatible = "mrvl,mmp-gpio"; | 163 | compatible = "marvell,mmp2-gpio"; |
164 | #address-cells = <1>; | 164 | #address-cells = <1>; |
165 | #size-cells = <1>; | 165 | #size-cells = <1>; |
166 | reg = <0xd4019000 0x1000>; | 166 | reg = <0xd4019000 0x1000>; |
diff --git a/arch/arm/boot/dts/pxa168.dtsi b/arch/arm/boot/dts/pxa168.dtsi index 31a718696080..975dad21ac38 100644 --- a/arch/arm/boot/dts/pxa168.dtsi +++ b/arch/arm/boot/dts/pxa168.dtsi | |||
@@ -77,7 +77,7 @@ | |||
77 | }; | 77 | }; |
78 | 78 | ||
79 | gpio@d4019000 { | 79 | gpio@d4019000 { |
80 | compatible = "mrvl,mmp-gpio"; | 80 | compatible = "marvell,mmp-gpio"; |
81 | #address-cells = <1>; | 81 | #address-cells = <1>; |
82 | #size-cells = <1>; | 82 | #size-cells = <1>; |
83 | reg = <0xd4019000 0x1000>; | 83 | reg = <0xd4019000 0x1000>; |
diff --git a/arch/arm/boot/dts/pxa910.dtsi b/arch/arm/boot/dts/pxa910.dtsi index 825aaca33034..0247c622f580 100644 --- a/arch/arm/boot/dts/pxa910.dtsi +++ b/arch/arm/boot/dts/pxa910.dtsi | |||
@@ -89,7 +89,7 @@ | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | gpio@d4019000 { | 91 | gpio@d4019000 { |
92 | compatible = "mrvl,mmp-gpio"; | 92 | compatible = "marvell,mmp-gpio"; |
93 | #address-cells = <1>; | 93 | #address-cells = <1>; |
94 | #size-cells = <1>; | 94 | #size-cells = <1>; |
95 | reg = <0xd4019000 0x1000>; | 95 | reg = <0xd4019000 0x1000>; |
diff --git a/arch/arm/include/debug/pxa.S b/arch/arm/include/debug/pxa.S new file mode 100644 index 000000000000..e1e795aa3d7f --- /dev/null +++ b/arch/arm/include/debug/pxa.S | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Early serial output macro for Marvell PXA/MMP SoC | ||
3 | * | ||
4 | * Copyright (C) 1994-1999 Russell King | ||
5 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
6 | * | ||
7 | * Copyright (C) 2013 Haojian Zhuang | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #if defined(CONFIG_DEBUG_PXA_UART1) | ||
15 | #define PXA_UART_REG_PHYS_BASE 0x40100000 | ||
16 | #define PXA_UART_REG_VIRT_BASE 0xf2100000 | ||
17 | #elif defined(CONFIG_DEBUG_MMP_UART2) | ||
18 | #define PXA_UART_REG_PHYS_BASE 0xd4017000 | ||
19 | #define PXA_UART_REG_VIRT_BASE 0xfe017000 | ||
20 | #elif defined(CONFIG_DEBUG_MMP_UART3) | ||
21 | #define PXA_UART_REG_PHYS_BASE 0xd4018000 | ||
22 | #define PXA_UART_REG_VIRT_BASE 0xfe018000 | ||
23 | #else | ||
24 | #error "Select uart for DEBUG_LL" | ||
25 | #endif | ||
26 | |||
27 | .macro addruart, rp, rv, tmp | ||
28 | ldr \rp, =PXA_UART_REG_PHYS_BASE | ||
29 | ldr \rv, =PXA_UART_REG_VIRT_BASE | ||
30 | .endm | ||
31 | |||
32 | #define UART_SHIFT 2 | ||
33 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c index 9f64d5632e07..fa21aac52467 100644 --- a/arch/arm/mach-mmp/aspenite.c +++ b/arch/arm/mach-mmp/aspenite.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * publishhed by the Free Software Foundation. | 9 | * publishhed by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #include <linux/gpio.h> | 11 | #include <linux/gpio.h> |
12 | #include <linux/gpio-pxa.h> | ||
12 | #include <linux/init.h> | 13 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
14 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
@@ -110,6 +111,10 @@ static unsigned long common_pin_config[] __initdata = { | |||
110 | GPIO121_KP_MKIN4, | 111 | GPIO121_KP_MKIN4, |
111 | }; | 112 | }; |
112 | 113 | ||
114 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { | ||
115 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
116 | }; | ||
117 | |||
113 | static struct smc91x_platdata smc91x_info = { | 118 | static struct smc91x_platdata smc91x_info = { |
114 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | 119 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
115 | }; | 120 | }; |
@@ -248,6 +253,8 @@ static void __init common_init(void) | |||
248 | pxa168_add_nand(&aspenite_nand_info); | 253 | pxa168_add_nand(&aspenite_nand_info); |
249 | pxa168_add_fb(&aspenite_lcd_info); | 254 | pxa168_add_fb(&aspenite_lcd_info); |
250 | pxa168_add_keypad(&aspenite_keypad_info); | 255 | pxa168_add_keypad(&aspenite_keypad_info); |
256 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, | ||
257 | sizeof(struct pxa_gpio_platform_data)); | ||
251 | platform_device_register(&pxa168_device_gpio); | 258 | platform_device_register(&pxa168_device_gpio); |
252 | 259 | ||
253 | /* off-chip devices */ | 260 | /* off-chip devices */ |
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c index 1f94957b56ae..a451a0f4d512 100644 --- a/arch/arm/mach-mmp/avengers_lite.c +++ b/arch/arm/mach-mmp/avengers_lite.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/gpio-pxa.h> | ||
15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
16 | 17 | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
@@ -32,12 +33,18 @@ static unsigned long avengers_lite_pin_config_V16F[] __initdata = { | |||
32 | GPIO89_UART2_RXD, | 33 | GPIO89_UART2_RXD, |
33 | }; | 34 | }; |
34 | 35 | ||
36 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { | ||
37 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
38 | }; | ||
39 | |||
35 | static void __init avengers_lite_init(void) | 40 | static void __init avengers_lite_init(void) |
36 | { | 41 | { |
37 | mfp_config(ARRAY_AND_SIZE(avengers_lite_pin_config_V16F)); | 42 | mfp_config(ARRAY_AND_SIZE(avengers_lite_pin_config_V16F)); |
38 | 43 | ||
39 | /* on-chip devices */ | 44 | /* on-chip devices */ |
40 | pxa168_add_uart(2); | 45 | pxa168_add_uart(2); |
46 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, | ||
47 | sizeof(struct pxa_gpio_platform_data)); | ||
41 | platform_device_register(&pxa168_device_gpio); | 48 | platform_device_register(&pxa168_device_gpio); |
42 | } | 49 | } |
43 | 50 | ||
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 2358011c7d8e..ac25544b8cdb 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/gpio-pxa.h> | ||
17 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
18 | #include <linux/regulator/max8649.h> | 19 | #include <linux/regulator/max8649.h> |
19 | #include <linux/regulator/fixed.h> | 20 | #include <linux/regulator/fixed.h> |
@@ -104,6 +105,10 @@ static unsigned long brownstone_pin_config[] __initdata = { | |||
104 | GPIO89_GPIO, | 105 | GPIO89_GPIO, |
105 | }; | 106 | }; |
106 | 107 | ||
108 | static struct pxa_gpio_platform_data mmp2_gpio_pdata = { | ||
109 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
110 | }; | ||
111 | |||
107 | static struct regulator_consumer_supply max8649_supply[] = { | 112 | static struct regulator_consumer_supply max8649_supply[] = { |
108 | REGULATOR_SUPPLY("vcc_core", NULL), | 113 | REGULATOR_SUPPLY("vcc_core", NULL), |
109 | }; | 114 | }; |
@@ -202,6 +207,8 @@ static void __init brownstone_init(void) | |||
202 | /* on-chip devices */ | 207 | /* on-chip devices */ |
203 | mmp2_add_uart(1); | 208 | mmp2_add_uart(1); |
204 | mmp2_add_uart(3); | 209 | mmp2_add_uart(3); |
210 | platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, | ||
211 | sizeof(struct pxa_gpio_platform_data)); | ||
205 | platform_device_register(&mmp2_device_gpio); | 212 | platform_device_register(&mmp2_device_gpio); |
206 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); | 213 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); |
207 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | 214 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ |
diff --git a/arch/arm/mach-mmp/clock-mmp2.c b/arch/arm/mach-mmp/clock-mmp2.c index 21d22002cd19..53d77cbd6000 100644 --- a/arch/arm/mach-mmp/clock-mmp2.c +++ b/arch/arm/mach-mmp/clock-mmp2.c | |||
@@ -98,7 +98,7 @@ static struct clk_lookup mmp2_clkregs[] = { | |||
98 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | 98 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), |
99 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | 99 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), |
100 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 100 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
101 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 101 | INIT_CLKREG(&clk_gpio, "mmp2-gpio", NULL), |
102 | INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), | 102 | INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), |
103 | INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), | 103 | INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), |
104 | INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), | 104 | INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), |
diff --git a/arch/arm/mach-mmp/clock-pxa168.c b/arch/arm/mach-mmp/clock-pxa168.c index 5e6c18ccebd4..c572f219ae26 100644 --- a/arch/arm/mach-mmp/clock-pxa168.c +++ b/arch/arm/mach-mmp/clock-pxa168.c | |||
@@ -78,7 +78,7 @@ static struct clk_lookup pxa168_clkregs[] = { | |||
78 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), | 78 | INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL), |
79 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 79 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
80 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), | 80 | INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), |
81 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 81 | INIT_CLKREG(&clk_gpio, "mmp-gpio", NULL), |
82 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), | 82 | INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), |
83 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), | 83 | INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), |
84 | INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), | 84 | INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"), |
diff --git a/arch/arm/mach-mmp/clock-pxa910.c b/arch/arm/mach-mmp/clock-pxa910.c index 933ea71d0b56..379e1df61c70 100644 --- a/arch/arm/mach-mmp/clock-pxa910.c +++ b/arch/arm/mach-mmp/clock-pxa910.c | |||
@@ -56,7 +56,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
56 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | 56 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), |
57 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | 57 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), |
58 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 58 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
59 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | 59 | INIT_CLKREG(&clk_gpio, "mmp-gpio", NULL), |
60 | INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), | 60 | INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"), |
61 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), | 61 | INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), |
62 | }; | 62 | }; |
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index 754c352dd02b..6291c33d83e2 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/smc91x.h> | 16 | #include <linux/smc91x.h> |
17 | #include <linux/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/gpio-pxa.h> | ||
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | 21 | ||
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
@@ -77,6 +78,10 @@ static unsigned long flint_pin_config[] __initdata = { | |||
77 | GPIO160_ND_RDY1, | 78 | GPIO160_ND_RDY1, |
78 | }; | 79 | }; |
79 | 80 | ||
81 | static struct pxa_gpio_platform_data mmp2_gpio_pdata = { | ||
82 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
83 | }; | ||
84 | |||
80 | static struct smc91x_platdata flint_smc91x_info = { | 85 | static struct smc91x_platdata flint_smc91x_info = { |
81 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | 86 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
82 | }; | 87 | }; |
@@ -111,6 +116,8 @@ static void __init flint_init(void) | |||
111 | /* on-chip devices */ | 116 | /* on-chip devices */ |
112 | mmp2_add_uart(1); | 117 | mmp2_add_uart(1); |
113 | mmp2_add_uart(2); | 118 | mmp2_add_uart(2); |
119 | platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, | ||
120 | sizeof(struct pxa_gpio_platform_data)); | ||
114 | platform_device_register(&mmp2_device_gpio); | 121 | platform_device_register(&mmp2_device_gpio); |
115 | 122 | ||
116 | /* off-chip devices */ | 123 | /* off-chip devices */ |
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c index f62b68d926f4..d81b2475e67e 100644 --- a/arch/arm/mach-mmp/gplugd.c +++ b/arch/arm/mach-mmp/gplugd.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/gpio.h> | 13 | #include <linux/gpio.h> |
14 | #include <linux/gpio-pxa.h> | ||
14 | 15 | ||
15 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
16 | #include <asm/mach-types.h> | 17 | #include <asm/mach-types.h> |
@@ -128,6 +129,10 @@ static unsigned long gplugd_pin_config[] __initdata = { | |||
128 | GPIO116_I2S_TXD | 129 | GPIO116_I2S_TXD |
129 | }; | 130 | }; |
130 | 131 | ||
132 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { | ||
133 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
134 | }; | ||
135 | |||
131 | static struct i2c_board_info gplugd_i2c_board_info[] = { | 136 | static struct i2c_board_info gplugd_i2c_board_info[] = { |
132 | { | 137 | { |
133 | .type = "isl1208", | 138 | .type = "isl1208", |
@@ -186,6 +191,8 @@ static void __init gplugd_init(void) | |||
186 | pxa168_add_uart(3); | 191 | pxa168_add_uart(3); |
187 | pxa168_add_ssp(1); | 192 | pxa168_add_ssp(1); |
188 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); | 193 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info)); |
194 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, | ||
195 | sizeof(struct pxa_gpio_platform_data)); | ||
189 | platform_device_register(&pxa168_device_gpio); | 196 | platform_device_register(&pxa168_device_gpio); |
190 | 197 | ||
191 | pxa168_add_eth(&gplugd_eth_platform_data); | 198 | pxa168_add_eth(&gplugd_eth_platform_data); |
diff --git a/arch/arm/mach-mmp/include/mach/debug-macro.S b/arch/arm/mach-mmp/include/mach/debug-macro.S deleted file mode 100644 index 5c3cc29688ab..000000000000 --- a/arch/arm/mach-mmp/include/mach/debug-macro.S +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* arch/arm/mach-mmp/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copied from arch/arm/mach-pxa/include/mach/debug.S | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #if defined(CONFIG_DEBUG_MMP_UART2) | ||
13 | #define MMP_UART_OFFSET 0x00017000 | ||
14 | #elif defined(CONFIG_DEBUG_MMP_UART3) | ||
15 | #define MMP_UART_OFFSET 0x00018000 | ||
16 | #else | ||
17 | #error "Select uart for DEBUG_LL" | ||
18 | #endif | ||
19 | |||
20 | #include <mach/addr-map.h> | ||
21 | |||
22 | .macro addruart, rp, rv, tmp | ||
23 | ldr \rp, =APB_PHYS_BASE @ physical | ||
24 | ldr \rv, =APB_VIRT_BASE @ virtual | ||
25 | orr \rp, \rp, #MMP_UART_OFFSET | ||
26 | orr \rv, \rv, #MMP_UART_OFFSET | ||
27 | .endm | ||
28 | |||
29 | #define UART_SHIFT 2 | ||
30 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index 66634fd0ecb0..0e9e5c05b37c 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/gpio-pxa.h> | ||
15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
17 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
@@ -99,6 +100,10 @@ static unsigned long jasper_pin_config[] __initdata = { | |||
99 | GPIO151_MMC3_CLK, | 100 | GPIO151_MMC3_CLK, |
100 | }; | 101 | }; |
101 | 102 | ||
103 | static struct pxa_gpio_platform_data mmp2_gpio_pdata = { | ||
104 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
105 | }; | ||
106 | |||
102 | static struct regulator_consumer_supply max8649_supply[] = { | 107 | static struct regulator_consumer_supply max8649_supply[] = { |
103 | REGULATOR_SUPPLY("vcc_core", NULL), | 108 | REGULATOR_SUPPLY("vcc_core", NULL), |
104 | }; | 109 | }; |
@@ -165,6 +170,9 @@ static void __init jasper_init(void) | |||
165 | mmp2_add_uart(1); | 170 | mmp2_add_uart(1); |
166 | mmp2_add_uart(3); | 171 | mmp2_add_uart(3); |
167 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); | 172 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); |
173 | platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata, | ||
174 | sizeof(struct pxa_gpio_platform_data)); | ||
175 | platform_device_register(&mmp2_device_gpio); | ||
168 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | 176 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ |
169 | 177 | ||
170 | regulator_has_full_constraints(); | 178 | regulator_has_full_constraints(); |
diff --git a/arch/arm/mach-mmp/mmp-dt.c b/arch/arm/mach-mmp/mmp-dt.c index d063efa0a4f1..b37915dc4470 100644 --- a/arch/arm/mach-mmp/mmp-dt.c +++ b/arch/arm/mach-mmp/mmp-dt.c | |||
@@ -28,7 +28,7 @@ static const struct of_dev_auxdata pxa168_auxdata_lookup[] __initconst = { | |||
28 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL), | 28 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4026000, "pxa2xx-uart.2", NULL), |
29 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | 29 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), |
30 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), | 30 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), |
31 | OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL), | 31 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), |
32 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | 32 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), |
33 | {} | 33 | {} |
34 | }; | 34 | }; |
@@ -39,7 +39,7 @@ static const struct of_dev_auxdata pxa910_auxdata_lookup[] __initconst = { | |||
39 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL), | 39 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4036000, "pxa2xx-uart.2", NULL), |
40 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | 40 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), |
41 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL), | 41 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4037000, "pxa2xx-i2c.1", NULL), |
42 | OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL), | 42 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp-gpio", NULL), |
43 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | 43 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), |
44 | {} | 44 | {} |
45 | }; | 45 | }; |
diff --git a/arch/arm/mach-mmp/mmp2-dt.c b/arch/arm/mach-mmp/mmp2-dt.c index fad431aa6e09..4ac256720f7d 100644 --- a/arch/arm/mach-mmp/mmp2-dt.c +++ b/arch/arm/mach-mmp/mmp2-dt.c | |||
@@ -31,7 +31,7 @@ static const struct of_dev_auxdata mmp2_auxdata_lookup[] __initconst = { | |||
31 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4016000, "pxa2xx-uart.3", NULL), | 31 | OF_DEV_AUXDATA("mrvl,mmp-uart", 0xd4016000, "pxa2xx-uart.3", NULL), |
32 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), | 32 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4011000, "pxa2xx-i2c.0", NULL), |
33 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), | 33 | OF_DEV_AUXDATA("mrvl,mmp-twsi", 0xd4025000, "pxa2xx-i2c.1", NULL), |
34 | OF_DEV_AUXDATA("mrvl,mmp-gpio", 0xd4019000, "pxa-gpio", NULL), | 34 | OF_DEV_AUXDATA("marvell,mmp-gpio", 0xd4019000, "mmp2-gpio", NULL), |
35 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), | 35 | OF_DEV_AUXDATA("mrvl,mmp-rtc", 0xd4010000, "sa1100-rtc", NULL), |
36 | {} | 36 | {} |
37 | }; | 37 | }; |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index d94d114eef7b..c7592f168bbd 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -164,7 +164,7 @@ struct resource mmp2_resource_gpio[] = { | |||
164 | }; | 164 | }; |
165 | 165 | ||
166 | struct platform_device mmp2_device_gpio = { | 166 | struct platform_device mmp2_device_gpio = { |
167 | .name = "pxa-gpio", | 167 | .name = "mmp2-gpio", |
168 | .id = -1, | 168 | .id = -1, |
169 | .num_resources = ARRAY_SIZE(mmp2_resource_gpio), | 169 | .num_resources = ARRAY_SIZE(mmp2_resource_gpio), |
170 | .resource = mmp2_resource_gpio, | 170 | .resource = mmp2_resource_gpio, |
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c index 9bc7b86a86a7..a30dcf3b7d9e 100644 --- a/arch/arm/mach-mmp/pxa168.c +++ b/arch/arm/mach-mmp/pxa168.c | |||
@@ -125,7 +125,7 @@ struct resource pxa168_resource_gpio[] = { | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | struct platform_device pxa168_device_gpio = { | 127 | struct platform_device pxa168_device_gpio = { |
128 | .name = "pxa-gpio", | 128 | .name = "mmp-gpio", |
129 | .id = -1, | 129 | .id = -1, |
130 | .num_resources = ARRAY_SIZE(pxa168_resource_gpio), | 130 | .num_resources = ARRAY_SIZE(pxa168_resource_gpio), |
131 | .resource = pxa168_resource_gpio, | 131 | .resource = pxa168_resource_gpio, |
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 36cb321a3d70..ce6393acad86 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -152,7 +152,7 @@ struct resource pxa910_resource_gpio[] = { | |||
152 | }; | 152 | }; |
153 | 153 | ||
154 | struct platform_device pxa910_device_gpio = { | 154 | struct platform_device pxa910_device_gpio = { |
155 | .name = "pxa-gpio", | 155 | .name = "mmp-gpio", |
156 | .id = -1, | 156 | .id = -1, |
157 | .num_resources = ARRAY_SIZE(pxa910_resource_gpio), | 157 | .num_resources = ARRAY_SIZE(pxa910_resource_gpio), |
158 | .resource = pxa910_resource_gpio, | 158 | .resource = pxa910_resource_gpio, |
diff --git a/arch/arm/mach-mmp/tavorevb.c b/arch/arm/mach-mmp/tavorevb.c index 4c127d23955d..cdfc9bfee1a4 100644 --- a/arch/arm/mach-mmp/tavorevb.c +++ b/arch/arm/mach-mmp/tavorevb.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * publishhed by the Free Software Foundation. | 8 | * publishhed by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/gpio-pxa.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
13 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
@@ -60,6 +61,10 @@ static unsigned long tavorevb_pin_config[] __initdata = { | |||
60 | DF_RDY0_DF_RDY0, | 61 | DF_RDY0_DF_RDY0, |
61 | }; | 62 | }; |
62 | 63 | ||
64 | static struct pxa_gpio_platform_data pxa910_gpio_pdata = { | ||
65 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
66 | }; | ||
67 | |||
63 | static struct smc91x_platdata tavorevb_smc91x_info = { | 68 | static struct smc91x_platdata tavorevb_smc91x_info = { |
64 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | 69 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, |
65 | }; | 70 | }; |
@@ -93,6 +98,8 @@ static void __init tavorevb_init(void) | |||
93 | 98 | ||
94 | /* on-chip devices */ | 99 | /* on-chip devices */ |
95 | pxa910_add_uart(1); | 100 | pxa910_add_uart(1); |
101 | platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata, | ||
102 | sizeof(struct pxa_gpio_platform_data)); | ||
96 | platform_device_register(&pxa910_device_gpio); | 103 | platform_device_register(&pxa910_device_gpio); |
97 | 104 | ||
98 | /* off-chip devices */ | 105 | /* off-chip devices */ |
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c index 8609967975ed..e4d95b4c6bb2 100644 --- a/arch/arm/mach-mmp/teton_bga.c +++ b/arch/arm/mach-mmp/teton_bga.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/gpio-pxa.h> | ||
19 | #include <linux/input.h> | 20 | #include <linux/input.h> |
20 | #include <linux/platform_data/keypad-pxa27x.h> | 21 | #include <linux/platform_data/keypad-pxa27x.h> |
21 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
@@ -49,6 +50,10 @@ static unsigned long teton_bga_pin_config[] __initdata = { | |||
49 | GPIO78_GPIO, | 50 | GPIO78_GPIO, |
50 | }; | 51 | }; |
51 | 52 | ||
53 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { | ||
54 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
55 | }; | ||
56 | |||
52 | static unsigned int teton_bga_matrix_key_map[] = { | 57 | static unsigned int teton_bga_matrix_key_map[] = { |
53 | KEY(0, 6, KEY_ESC), | 58 | KEY(0, 6, KEY_ESC), |
54 | KEY(0, 7, KEY_ENTER), | 59 | KEY(0, 7, KEY_ENTER), |
@@ -79,6 +84,8 @@ static void __init teton_bga_init(void) | |||
79 | pxa168_add_uart(1); | 84 | pxa168_add_uart(1); |
80 | pxa168_add_keypad(&teton_bga_keypad_info); | 85 | pxa168_add_keypad(&teton_bga_keypad_info); |
81 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); | 86 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); |
87 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, | ||
88 | sizeof(struct pxa_gpio_platform_data)); | ||
82 | platform_device_register(&pxa168_device_gpio); | 89 | platform_device_register(&pxa168_device_gpio); |
83 | } | 90 | } |
84 | 91 | ||
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c index 22a9058f9f4d..6aa788872921 100644 --- a/arch/arm/mach-mmp/ttc_dkb.c +++ b/arch/arm/mach-mmp/ttc_dkb.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/i2c/pca953x.h> | 18 | #include <linux/i2c/pca953x.h> |
19 | #include <linux/gpio.h> | 19 | #include <linux/gpio.h> |
20 | #include <linux/gpio-pxa.h> | ||
20 | #include <linux/mfd/88pm860x.h> | 21 | #include <linux/mfd/88pm860x.h> |
21 | #include <linux/platform_data/mv_usb.h> | 22 | #include <linux/platform_data/mv_usb.h> |
22 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
@@ -75,6 +76,10 @@ static unsigned long ttc_dkb_pin_config[] __initdata = { | |||
75 | DF_RDY0_DF_RDY0, | 76 | DF_RDY0_DF_RDY0, |
76 | }; | 77 | }; |
77 | 78 | ||
79 | static struct pxa_gpio_platform_data pxa910_gpio_pdata = { | ||
80 | .irq_base = MMP_GPIO_TO_IRQ(0), | ||
81 | }; | ||
82 | |||
78 | static struct mtd_partition ttc_dkb_onenand_partitions[] = { | 83 | static struct mtd_partition ttc_dkb_onenand_partitions[] = { |
79 | { | 84 | { |
80 | .name = "bootloader", | 85 | .name = "bootloader", |
@@ -284,6 +289,8 @@ static void __init ttc_dkb_init(void) | |||
284 | 289 | ||
285 | /* off-chip devices */ | 290 | /* off-chip devices */ |
286 | pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); | 291 | pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); |
292 | platform_device_add_data(&pxa910_device_gpio, &pxa910_gpio_pdata, | ||
293 | sizeof(struct pxa_gpio_platform_data)); | ||
287 | platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); | 294 | platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); |
288 | 295 | ||
289 | #ifdef CONFIG_USB_MV_UDC | 296 | #ifdef CONFIG_USB_MV_UDC |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 86eec4159cbc..9075461999c1 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -51,11 +51,13 @@ config MACH_LITTLETON | |||
51 | config MACH_TAVOREVB | 51 | config MACH_TAVOREVB |
52 | bool "PXA930 Evaluation Board (aka TavorEVB)" | 52 | bool "PXA930 Evaluation Board (aka TavorEVB)" |
53 | select CPU_PXA930 | 53 | select CPU_PXA930 |
54 | select CPU_PXA935 | ||
54 | select PXA3xx | 55 | select PXA3xx |
55 | 56 | ||
56 | config MACH_SAAR | 57 | config MACH_SAAR |
57 | bool "PXA930 Handheld Platform (aka SAAR)" | 58 | bool "PXA930 Handheld Platform (aka SAAR)" |
58 | select CPU_PXA930 | 59 | select CPU_PXA930 |
60 | select CPU_PXA935 | ||
59 | select PXA3xx | 61 | select PXA3xx |
60 | 62 | ||
61 | comment "Third Party Dev Platforms (sorted by vendor name)" | 63 | comment "Third Party Dev Platforms (sorted by vendor name)" |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index daa86d39ed9e..666094315ab1 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -1107,8 +1107,33 @@ struct resource pxa_resource_gpio[] = { | |||
1107 | }, | 1107 | }, |
1108 | }; | 1108 | }; |
1109 | 1109 | ||
1110 | struct platform_device pxa_device_gpio = { | 1110 | struct platform_device pxa25x_device_gpio = { |
1111 | .name = "pxa-gpio", | 1111 | #ifdef CONFIG_CPU_PXA26x |
1112 | .name = "pxa26x-gpio", | ||
1113 | #else | ||
1114 | .name = "pxa25x-gpio", | ||
1115 | #endif | ||
1116 | .id = -1, | ||
1117 | .num_resources = ARRAY_SIZE(pxa_resource_gpio), | ||
1118 | .resource = pxa_resource_gpio, | ||
1119 | }; | ||
1120 | |||
1121 | struct platform_device pxa27x_device_gpio = { | ||
1122 | .name = "pxa27x-gpio", | ||
1123 | .id = -1, | ||
1124 | .num_resources = ARRAY_SIZE(pxa_resource_gpio), | ||
1125 | .resource = pxa_resource_gpio, | ||
1126 | }; | ||
1127 | |||
1128 | struct platform_device pxa3xx_device_gpio = { | ||
1129 | .name = "pxa3xx-gpio", | ||
1130 | .id = -1, | ||
1131 | .num_resources = ARRAY_SIZE(pxa_resource_gpio), | ||
1132 | .resource = pxa_resource_gpio, | ||
1133 | }; | ||
1134 | |||
1135 | struct platform_device pxa93x_device_gpio = { | ||
1136 | .name = "pxa93x-gpio", | ||
1112 | .id = -1, | 1137 | .id = -1, |
1113 | .num_resources = ARRAY_SIZE(pxa_resource_gpio), | 1138 | .num_resources = ARRAY_SIZE(pxa_resource_gpio), |
1114 | .resource = pxa_resource_gpio, | 1139 | .resource = pxa_resource_gpio, |
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h index 1475db107254..0f3fd0d65b12 100644 --- a/arch/arm/mach-pxa/devices.h +++ b/arch/arm/mach-pxa/devices.h | |||
@@ -16,7 +16,6 @@ extern struct platform_device pxa_device_ficp; | |||
16 | extern struct platform_device sa1100_device_rtc; | 16 | extern struct platform_device sa1100_device_rtc; |
17 | extern struct platform_device pxa_device_rtc; | 17 | extern struct platform_device pxa_device_rtc; |
18 | extern struct platform_device pxa_device_ac97; | 18 | extern struct platform_device pxa_device_ac97; |
19 | extern struct platform_device pxa_device_gpio; | ||
20 | 19 | ||
21 | extern struct platform_device pxa27x_device_i2c_power; | 20 | extern struct platform_device pxa27x_device_i2c_power; |
22 | extern struct platform_device pxa27x_device_ohci; | 21 | extern struct platform_device pxa27x_device_ohci; |
@@ -46,4 +45,9 @@ extern struct platform_device pxa_device_asoc_ssp2; | |||
46 | extern struct platform_device pxa_device_asoc_ssp3; | 45 | extern struct platform_device pxa_device_asoc_ssp3; |
47 | extern struct platform_device pxa_device_asoc_ssp4; | 46 | extern struct platform_device pxa_device_asoc_ssp4; |
48 | 47 | ||
48 | extern struct platform_device pxa25x_device_gpio; | ||
49 | extern struct platform_device pxa27x_device_gpio; | ||
50 | extern struct platform_device pxa3xx_device_gpio; | ||
51 | extern struct platform_device pxa93x_device_gpio; | ||
52 | |||
49 | void __init pxa_register_device(struct platform_device *dev, void *data); | 53 | void __init pxa_register_device(struct platform_device *dev, void *data); |
diff --git a/arch/arm/mach-pxa/include/mach/debug-macro.S b/arch/arm/mach-pxa/include/mach/debug-macro.S deleted file mode 100644 index 70b112e8ef68..000000000000 --- a/arch/arm/mach-pxa/include/mach/debug-macro.S +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | /* arch/arm/mach-pxa/include/mach/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include "hardware.h" | ||
15 | |||
16 | .macro addruart, rp, rv, tmp | ||
17 | mov \rp, #0x00100000 | ||
18 | orr \rv, \rp, #io_p2v(0x40000000) @ virtual | ||
19 | orr \rp, \rp, #0x40000000 @ physical | ||
20 | .endm | ||
21 | |||
22 | #define UART_SHIFT 2 | ||
23 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 3f5171eaf67b..f2c28972084d 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -208,7 +208,11 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
208 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), | 208 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), |
209 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), | 209 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), |
210 | INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), | 210 | INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), |
211 | INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL), | 211 | #ifdef CONFIG_CPU_PXA26x |
212 | INIT_CLKREG(&clk_dummy, "pxa26x-gpio", NULL), | ||
213 | #else | ||
214 | INIT_CLKREG(&clk_dummy, "pxa25x-gpio", NULL), | ||
215 | #endif | ||
212 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), | 216 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), |
213 | }; | 217 | }; |
214 | 218 | ||
@@ -340,7 +344,8 @@ void __init pxa25x_map_io(void) | |||
340 | } | 344 | } |
341 | 345 | ||
342 | static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = { | 346 | static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = { |
343 | .gpio_set_wake = gpio_set_wake, | 347 | .irq_base = PXA_GPIO_TO_IRQ(0), |
348 | .gpio_set_wake = gpio_set_wake, | ||
344 | }; | 349 | }; |
345 | 350 | ||
346 | static struct platform_device *pxa25x_devices[] __initdata = { | 351 | static struct platform_device *pxa25x_devices[] __initdata = { |
@@ -375,7 +380,7 @@ static int __init pxa25x_init(void) | |||
375 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); | 380 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); |
376 | register_syscore_ops(&pxa2xx_clock_syscore_ops); | 381 | register_syscore_ops(&pxa2xx_clock_syscore_ops); |
377 | 382 | ||
378 | pxa_register_device(&pxa_device_gpio, &pxa25x_gpio_info); | 383 | pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info); |
379 | ret = platform_add_devices(pxa25x_devices, | 384 | ret = platform_add_devices(pxa25x_devices, |
380 | ARRAY_SIZE(pxa25x_devices)); | 385 | ARRAY_SIZE(pxa25x_devices)); |
381 | if (ret) | 386 | if (ret) |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 3203a9f5b4a2..301471a07a10 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -237,7 +237,7 @@ static struct clk_lookup pxa27x_clkregs[] = { | |||
237 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), | 237 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), |
238 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), | 238 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), |
239 | INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), | 239 | INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), |
240 | INIT_CLKREG(&clk_dummy, "pxa-gpio", NULL), | 240 | INIT_CLKREG(&clk_dummy, "pxa27x-gpio", NULL), |
241 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), | 241 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), |
242 | }; | 242 | }; |
243 | 243 | ||
@@ -431,7 +431,8 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info) | |||
431 | } | 431 | } |
432 | 432 | ||
433 | static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = { | 433 | static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = { |
434 | .gpio_set_wake = gpio_set_wake, | 434 | .irq_base = PXA_GPIO_TO_IRQ(0), |
435 | .gpio_set_wake = gpio_set_wake, | ||
435 | }; | 436 | }; |
436 | 437 | ||
437 | static struct platform_device *devices[] __initdata = { | 438 | static struct platform_device *devices[] __initdata = { |
@@ -470,7 +471,7 @@ static int __init pxa27x_init(void) | |||
470 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); | 471 | register_syscore_ops(&pxa2xx_mfp_syscore_ops); |
471 | register_syscore_ops(&pxa2xx_clock_syscore_ops); | 472 | register_syscore_ops(&pxa2xx_clock_syscore_ops); |
472 | 473 | ||
473 | pxa_register_device(&pxa_device_gpio, &pxa27x_gpio_info); | 474 | pxa_register_device(&pxa27x_device_gpio, &pxa27x_gpio_info); |
474 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 475 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
475 | } | 476 | } |
476 | 477 | ||
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index 656a1bb16d14..87011f3de69d 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/gpio-pxa.h> | ||
18 | #include <linux/pm.h> | 19 | #include <linux/pm.h> |
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
@@ -92,7 +93,8 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
92 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), | 93 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), |
93 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), | 94 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), |
94 | INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL), | 95 | INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL), |
95 | INIT_CLKREG(&clk_pxa3xx_gpio, "pxa-gpio", NULL), | 96 | INIT_CLKREG(&clk_pxa3xx_gpio, "pxa3xx-gpio", NULL), |
97 | INIT_CLKREG(&clk_pxa3xx_gpio, "pxa93x-gpio", NULL), | ||
96 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), | 98 | INIT_CLKREG(&clk_dummy, "sa1100-rtc", NULL), |
97 | }; | 99 | }; |
98 | 100 | ||
@@ -435,8 +437,11 @@ void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info) | |||
435 | pxa_register_device(&pxa3xx_device_i2c_power, info); | 437 | pxa_register_device(&pxa3xx_device_i2c_power, info); |
436 | } | 438 | } |
437 | 439 | ||
440 | static struct pxa_gpio_platform_data pxa3xx_gpio_pdata = { | ||
441 | .irq_base = PXA_GPIO_TO_IRQ(0), | ||
442 | }; | ||
443 | |||
438 | static struct platform_device *devices[] __initdata = { | 444 | static struct platform_device *devices[] __initdata = { |
439 | &pxa_device_gpio, | ||
440 | &pxa27x_device_udc, | 445 | &pxa27x_device_udc, |
441 | &pxa_device_pmu, | 446 | &pxa_device_pmu, |
442 | &pxa_device_i2s, | 447 | &pxa_device_i2s, |
@@ -482,8 +487,18 @@ static int __init pxa3xx_init(void) | |||
482 | register_syscore_ops(&pxa3xx_mfp_syscore_ops); | 487 | register_syscore_ops(&pxa3xx_mfp_syscore_ops); |
483 | register_syscore_ops(&pxa3xx_clock_syscore_ops); | 488 | register_syscore_ops(&pxa3xx_clock_syscore_ops); |
484 | 489 | ||
485 | if (!of_have_populated_dt()) | 490 | if (of_have_populated_dt()) |
486 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 491 | return 0; |
492 | |||
493 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
494 | if (ret) | ||
495 | return ret; | ||
496 | if (cpu_is_pxa300() || cpu_is_pxa310() || cpu_is_pxa320()) { | ||
497 | platform_device_add_data(&pxa3xx_device_gpio, | ||
498 | &pxa3xx_gpio_pdata, | ||
499 | sizeof(pxa3xx_gpio_pdata)); | ||
500 | ret = platform_device_register(&pxa3xx_device_gpio); | ||
501 | } | ||
487 | } | 502 | } |
488 | 503 | ||
489 | return ret; | 504 | return ret; |
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c index 8aeacf908784..ab624487cf39 100644 --- a/arch/arm/mach-pxa/pxa930.c +++ b/arch/arm/mach-pxa/pxa930.c | |||
@@ -12,12 +12,15 @@ | |||
12 | 12 | ||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
16 | #include <linux/irq.h> | ||
17 | #include <linux/gpio-pxa.h> | ||
18 | #include <linux/platform_device.h> | ||
18 | 19 | ||
19 | #include <mach/pxa930.h> | 20 | #include <mach/pxa930.h> |
20 | 21 | ||
22 | #include "devices.h" | ||
23 | |||
21 | static struct mfp_addr_map pxa930_mfp_addr_map[] __initdata = { | 24 | static struct mfp_addr_map pxa930_mfp_addr_map[] __initdata = { |
22 | 25 | ||
23 | MFP_ADDR(GPIO0, 0x02e0), | 26 | MFP_ADDR(GPIO0, 0x02e0), |
@@ -190,11 +193,21 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = { | |||
190 | MFP_ADDR_END, | 193 | MFP_ADDR_END, |
191 | }; | 194 | }; |
192 | 195 | ||
196 | static struct pxa_gpio_platform_data pxa93x_gpio_pdata = { | ||
197 | .irq_base = PXA_GPIO_TO_IRQ(0), | ||
198 | }; | ||
199 | |||
193 | static int __init pxa930_init(void) | 200 | static int __init pxa930_init(void) |
194 | { | 201 | { |
202 | int ret = 0; | ||
203 | |||
195 | if (cpu_is_pxa93x()) { | 204 | if (cpu_is_pxa93x()) { |
196 | mfp_init_base(io_p2v(MFPR_BASE)); | 205 | mfp_init_base(io_p2v(MFPR_BASE)); |
197 | mfp_init_addr(pxa930_mfp_addr_map); | 206 | mfp_init_addr(pxa930_mfp_addr_map); |
207 | platform_device_add_data(&pxa93x_device_gpio, | ||
208 | &pxa93x_gpio_pdata, | ||
209 | sizeof(pxa93x_gpio_pdata)); | ||
210 | ret = platform_device_register(&pxa93x_device_gpio); | ||
198 | } | 211 | } |
199 | 212 | ||
200 | if (cpu_is_pxa935()) | 213 | if (cpu_is_pxa935()) |
diff --git a/drivers/clk/mmp/clk-mmp2.c b/drivers/clk/mmp/clk-mmp2.c index ade435820c7e..d1f1a19d4351 100644 --- a/drivers/clk/mmp/clk-mmp2.c +++ b/drivers/clk/mmp/clk-mmp2.c | |||
@@ -221,7 +221,7 @@ void __init mmp2_clk_init(void) | |||
221 | 221 | ||
222 | clk = mmp_clk_register_apbc("gpio", "vctcxo", | 222 | clk = mmp_clk_register_apbc("gpio", "vctcxo", |
223 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); | 223 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); |
224 | clk_register_clkdev(clk, NULL, "pxa-gpio"); | 224 | clk_register_clkdev(clk, NULL, "mmp2-gpio"); |
225 | 225 | ||
226 | clk = mmp_clk_register_apbc("kpc", "clk32", | 226 | clk = mmp_clk_register_apbc("kpc", "clk32", |
227 | apbc_base + APBC_KPC, 10, 0, &clk_lock); | 227 | apbc_base + APBC_KPC, 10, 0, &clk_lock); |
diff --git a/drivers/clk/mmp/clk-pxa168.c b/drivers/clk/mmp/clk-pxa168.c index e8d036c12cbf..28b3b51c794b 100644 --- a/drivers/clk/mmp/clk-pxa168.c +++ b/drivers/clk/mmp/clk-pxa168.c | |||
@@ -172,7 +172,7 @@ void __init pxa168_clk_init(void) | |||
172 | 172 | ||
173 | clk = mmp_clk_register_apbc("gpio", "vctcxo", | 173 | clk = mmp_clk_register_apbc("gpio", "vctcxo", |
174 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); | 174 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); |
175 | clk_register_clkdev(clk, NULL, "pxa-gpio"); | 175 | clk_register_clkdev(clk, NULL, "mmp-gpio"); |
176 | 176 | ||
177 | clk = mmp_clk_register_apbc("kpc", "clk32", | 177 | clk = mmp_clk_register_apbc("kpc", "clk32", |
178 | apbc_base + APBC_KPC, 10, 0, &clk_lock); | 178 | apbc_base + APBC_KPC, 10, 0, &clk_lock); |
diff --git a/drivers/clk/mmp/clk-pxa910.c b/drivers/clk/mmp/clk-pxa910.c index 7048c31d6e7e..6ec05698ed38 100644 --- a/drivers/clk/mmp/clk-pxa910.c +++ b/drivers/clk/mmp/clk-pxa910.c | |||
@@ -177,7 +177,7 @@ void __init pxa910_clk_init(void) | |||
177 | 177 | ||
178 | clk = mmp_clk_register_apbc("gpio", "vctcxo", | 178 | clk = mmp_clk_register_apbc("gpio", "vctcxo", |
179 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); | 179 | apbc_base + APBC_GPIO, 10, 0, &clk_lock); |
180 | clk_register_clkdev(clk, NULL, "pxa-gpio"); | 180 | clk_register_clkdev(clk, NULL, "mmp-gpio"); |
181 | 181 | ||
182 | clk = mmp_clk_register_apbc("kpc", "clk32", | 182 | clk = mmp_clk_register_apbc("kpc", "clk32", |
183 | apbc_base + APBC_KPC, 10, 0, &clk_lock); | 183 | apbc_base + APBC_KPC, 10, 0, &clk_lock); |
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 9cc108d2b770..b80717e1ce5b 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -86,20 +86,61 @@ struct pxa_gpio_chip { | |||
86 | #endif | 86 | #endif |
87 | }; | 87 | }; |
88 | 88 | ||
89 | enum { | 89 | enum pxa_gpio_type { |
90 | PXA25X_GPIO = 0, | 90 | PXA25X_GPIO = 0, |
91 | PXA26X_GPIO, | 91 | PXA26X_GPIO, |
92 | PXA27X_GPIO, | 92 | PXA27X_GPIO, |
93 | PXA3XX_GPIO, | 93 | PXA3XX_GPIO, |
94 | PXA93X_GPIO, | 94 | PXA93X_GPIO, |
95 | MMP_GPIO = 0x10, | 95 | MMP_GPIO = 0x10, |
96 | MMP2_GPIO, | ||
97 | }; | ||
98 | |||
99 | struct pxa_gpio_id { | ||
100 | enum pxa_gpio_type type; | ||
101 | int gpio_nums; | ||
96 | }; | 102 | }; |
97 | 103 | ||
98 | static DEFINE_SPINLOCK(gpio_lock); | 104 | static DEFINE_SPINLOCK(gpio_lock); |
99 | static struct pxa_gpio_chip *pxa_gpio_chips; | 105 | static struct pxa_gpio_chip *pxa_gpio_chips; |
100 | static int gpio_type; | 106 | static enum pxa_gpio_type gpio_type; |
101 | static void __iomem *gpio_reg_base; | 107 | static void __iomem *gpio_reg_base; |
102 | 108 | ||
109 | static struct pxa_gpio_id pxa25x_id = { | ||
110 | .type = PXA25X_GPIO, | ||
111 | .gpio_nums = 85, | ||
112 | }; | ||
113 | |||
114 | static struct pxa_gpio_id pxa26x_id = { | ||
115 | .type = PXA26X_GPIO, | ||
116 | .gpio_nums = 90, | ||
117 | }; | ||
118 | |||
119 | static struct pxa_gpio_id pxa27x_id = { | ||
120 | .type = PXA27X_GPIO, | ||
121 | .gpio_nums = 121, | ||
122 | }; | ||
123 | |||
124 | static struct pxa_gpio_id pxa3xx_id = { | ||
125 | .type = PXA3XX_GPIO, | ||
126 | .gpio_nums = 128, | ||
127 | }; | ||
128 | |||
129 | static struct pxa_gpio_id pxa93x_id = { | ||
130 | .type = PXA93X_GPIO, | ||
131 | .gpio_nums = 192, | ||
132 | }; | ||
133 | |||
134 | static struct pxa_gpio_id mmp_id = { | ||
135 | .type = MMP_GPIO, | ||
136 | .gpio_nums = 128, | ||
137 | }; | ||
138 | |||
139 | static struct pxa_gpio_id mmp2_id = { | ||
140 | .type = MMP2_GPIO, | ||
141 | .gpio_nums = 192, | ||
142 | }; | ||
143 | |||
103 | #define for_each_gpio_chip(i, c) \ | 144 | #define for_each_gpio_chip(i, c) \ |
104 | for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++) | 145 | for (i = 0, c = &pxa_gpio_chips[0]; i <= pxa_last_gpio; i += 32, c++) |
105 | 146 | ||
@@ -432,47 +473,39 @@ static struct irq_chip pxa_muxed_gpio_chip = { | |||
432 | .irq_set_wake = pxa_gpio_set_wake, | 473 | .irq_set_wake = pxa_gpio_set_wake, |
433 | }; | 474 | }; |
434 | 475 | ||
435 | static int pxa_gpio_nums(void) | 476 | static int pxa_gpio_nums(struct platform_device *pdev) |
436 | { | 477 | { |
478 | const struct platform_device_id *id = platform_get_device_id(pdev); | ||
479 | struct pxa_gpio_id *pxa_id = (struct pxa_gpio_id *)id->driver_data; | ||
437 | int count = 0; | 480 | int count = 0; |
438 | 481 | ||
439 | #ifdef CONFIG_ARCH_PXA | 482 | switch (pxa_id->type) { |
440 | if (cpu_is_pxa25x()) { | 483 | case PXA25X_GPIO: |
441 | #ifdef CONFIG_CPU_PXA26x | 484 | case PXA26X_GPIO: |
442 | count = 89; | 485 | case PXA27X_GPIO: |
443 | gpio_type = PXA26X_GPIO; | 486 | case PXA3XX_GPIO: |
444 | #elif defined(CONFIG_PXA25x) | 487 | case PXA93X_GPIO: |
445 | count = 84; | 488 | case MMP_GPIO: |
446 | gpio_type = PXA26X_GPIO; | 489 | case MMP2_GPIO: |
447 | #endif /* CONFIG_CPU_PXA26x */ | 490 | gpio_type = pxa_id->type; |
448 | } else if (cpu_is_pxa27x()) { | 491 | count = pxa_id->gpio_nums - 1; |
449 | count = 120; | 492 | break; |
450 | gpio_type = PXA27X_GPIO; | 493 | default: |
451 | } else if (cpu_is_pxa93x()) { | 494 | count = -EINVAL; |
452 | count = 191; | 495 | break; |
453 | gpio_type = PXA93X_GPIO; | ||
454 | } else if (cpu_is_pxa3xx()) { | ||
455 | count = 127; | ||
456 | gpio_type = PXA3XX_GPIO; | ||
457 | } | ||
458 | #endif /* CONFIG_ARCH_PXA */ | ||
459 | |||
460 | #ifdef CONFIG_ARCH_MMP | ||
461 | if (cpu_is_pxa168() || cpu_is_pxa910()) { | ||
462 | count = 127; | ||
463 | gpio_type = MMP_GPIO; | ||
464 | } else if (cpu_is_mmp2()) { | ||
465 | count = 191; | ||
466 | gpio_type = MMP_GPIO; | ||
467 | } | 496 | } |
468 | #endif /* CONFIG_ARCH_MMP */ | ||
469 | return count; | 497 | return count; |
470 | } | 498 | } |
471 | 499 | ||
472 | #ifdef CONFIG_OF | 500 | #ifdef CONFIG_OF |
473 | static struct of_device_id pxa_gpio_dt_ids[] = { | 501 | static struct of_device_id pxa_gpio_dt_ids[] = { |
474 | { .compatible = "mrvl,pxa-gpio" }, | 502 | { .compatible = "intel,pxa25x-gpio", .data = &pxa25x_id, }, |
475 | { .compatible = "mrvl,mmp-gpio", .data = (void *)MMP_GPIO }, | 503 | { .compatible = "intel,pxa26x-gpio", .data = &pxa26x_id, }, |
504 | { .compatible = "intel,pxa27x-gpio", .data = &pxa27x_id, }, | ||
505 | { .compatible = "intel,pxa3xx-gpio", .data = &pxa3xx_id, }, | ||
506 | { .compatible = "marvell,pxa93x-gpio", .data = &pxa93x_id, }, | ||
507 | { .compatible = "marvell,mmp-gpio", .data = &mmp_id, }, | ||
508 | { .compatible = "marvell,mmp2-gpio", .data = &mmp2_id, }, | ||
476 | {} | 509 | {} |
477 | }; | 510 | }; |
478 | 511 | ||
@@ -492,16 +525,18 @@ const struct irq_domain_ops pxa_irq_domain_ops = { | |||
492 | 525 | ||
493 | static int pxa_gpio_probe_dt(struct platform_device *pdev) | 526 | static int pxa_gpio_probe_dt(struct platform_device *pdev) |
494 | { | 527 | { |
495 | int ret, nr_banks, nr_gpios; | 528 | int ret, nr_gpios; |
496 | struct device_node *prev, *next, *np = pdev->dev.of_node; | 529 | struct device_node *prev, *next, *np = pdev->dev.of_node; |
497 | const struct of_device_id *of_id = | 530 | const struct of_device_id *of_id = |
498 | of_match_device(pxa_gpio_dt_ids, &pdev->dev); | 531 | of_match_device(pxa_gpio_dt_ids, &pdev->dev); |
532 | const struct pxa_gpio_id *gpio_id; | ||
499 | 533 | ||
500 | if (!of_id) { | 534 | if (!of_id || !of_id->data) { |
501 | dev_err(&pdev->dev, "Failed to find gpio controller\n"); | 535 | dev_err(&pdev->dev, "Failed to find gpio controller\n"); |
502 | return -EFAULT; | 536 | return -EFAULT; |
503 | } | 537 | } |
504 | gpio_type = (int)of_id->data; | 538 | gpio_id = of_id->data; |
539 | gpio_type = gpio_id->type; | ||
505 | 540 | ||
506 | next = of_get_next_child(np, NULL); | 541 | next = of_get_next_child(np, NULL); |
507 | prev = next; | 542 | prev = next; |
@@ -510,14 +545,8 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev) | |||
510 | ret = -EINVAL; | 545 | ret = -EINVAL; |
511 | goto err; | 546 | goto err; |
512 | } | 547 | } |
513 | for (nr_banks = 1; ; nr_banks++) { | ||
514 | next = of_get_next_child(np, prev); | ||
515 | if (!next) | ||
516 | break; | ||
517 | prev = next; | ||
518 | } | ||
519 | of_node_put(prev); | 548 | of_node_put(prev); |
520 | nr_gpios = nr_banks << 5; | 549 | nr_gpios = gpio_id->gpio_nums; |
521 | pxa_last_gpio = nr_gpios - 1; | 550 | pxa_last_gpio = nr_gpios - 1; |
522 | 551 | ||
523 | irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0); | 552 | irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0); |
@@ -546,19 +575,18 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
546 | int gpio, irq, ret, use_of = 0; | 575 | int gpio, irq, ret, use_of = 0; |
547 | int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; | 576 | int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; |
548 | 577 | ||
549 | ret = pxa_gpio_probe_dt(pdev); | 578 | info = dev_get_platdata(&pdev->dev); |
550 | if (ret < 0) { | 579 | if (info) { |
551 | pxa_last_gpio = pxa_gpio_nums(); | 580 | irq_base = info->irq_base; |
552 | #ifdef CONFIG_ARCH_PXA | 581 | if (irq_base <= 0) |
553 | if (gpio_is_pxa_type(gpio_type)) | 582 | return -EINVAL; |
554 | irq_base = PXA_GPIO_TO_IRQ(0); | 583 | pxa_last_gpio = pxa_gpio_nums(pdev); |
555 | #endif | ||
556 | #ifdef CONFIG_ARCH_MMP | ||
557 | if (gpio_is_mmp_type(gpio_type)) | ||
558 | irq_base = MMP_GPIO_TO_IRQ(0); | ||
559 | #endif | ||
560 | } else { | 584 | } else { |
585 | irq_base = 0; | ||
561 | use_of = 1; | 586 | use_of = 1; |
587 | ret = pxa_gpio_probe_dt(pdev); | ||
588 | if (ret < 0) | ||
589 | return -EINVAL; | ||
562 | } | 590 | } |
563 | 591 | ||
564 | if (!pxa_last_gpio) | 592 | if (!pxa_last_gpio) |
@@ -595,7 +623,6 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
595 | } | 623 | } |
596 | 624 | ||
597 | /* Initialize GPIO chips */ | 625 | /* Initialize GPIO chips */ |
598 | info = dev_get_platdata(&pdev->dev); | ||
599 | pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL); | 626 | pxa_init_gpio_chip(pxa_last_gpio, info ? info->gpio_set_wake : NULL); |
600 | 627 | ||
601 | /* clear all GPIO edge detects */ | 628 | /* clear all GPIO edge detects */ |
@@ -635,12 +662,24 @@ static int pxa_gpio_probe(struct platform_device *pdev) | |||
635 | return 0; | 662 | return 0; |
636 | } | 663 | } |
637 | 664 | ||
665 | static const struct platform_device_id gpio_id_table[] = { | ||
666 | { "pxa25x-gpio", (unsigned long)&pxa25x_id }, | ||
667 | { "pxa26x-gpio", (unsigned long)&pxa26x_id }, | ||
668 | { "pxa27x-gpio", (unsigned long)&pxa27x_id }, | ||
669 | { "pxa3xx-gpio", (unsigned long)&pxa3xx_id }, | ||
670 | { "pxa93x-gpio", (unsigned long)&pxa93x_id }, | ||
671 | { "mmp-gpio", (unsigned long)&mmp_id }, | ||
672 | { "mmp2-gpio", (unsigned long)&mmp2_id }, | ||
673 | { }, | ||
674 | }; | ||
675 | |||
638 | static struct platform_driver pxa_gpio_driver = { | 676 | static struct platform_driver pxa_gpio_driver = { |
639 | .probe = pxa_gpio_probe, | 677 | .probe = pxa_gpio_probe, |
640 | .driver = { | 678 | .driver = { |
641 | .name = "pxa-gpio", | 679 | .name = "pxa-gpio", |
642 | .of_match_table = of_match_ptr(pxa_gpio_dt_ids), | 680 | .of_match_table = of_match_ptr(pxa_gpio_dt_ids), |
643 | }, | 681 | }, |
682 | .id_table = gpio_id_table, | ||
644 | }; | 683 | }; |
645 | module_platform_driver(pxa_gpio_driver); | 684 | module_platform_driver(pxa_gpio_driver); |
646 | 685 | ||
diff --git a/include/linux/gpio-pxa.h b/include/linux/gpio-pxa.h index d755b28ba635..d90ebbe02ca4 100644 --- a/include/linux/gpio-pxa.h +++ b/include/linux/gpio-pxa.h | |||
@@ -14,6 +14,7 @@ extern int pxa_last_gpio; | |||
14 | extern int pxa_irq_to_gpio(int irq); | 14 | extern int pxa_irq_to_gpio(int irq); |
15 | 15 | ||
16 | struct pxa_gpio_platform_data { | 16 | struct pxa_gpio_platform_data { |
17 | int irq_base; | ||
17 | int (*gpio_set_wake)(unsigned int gpio, unsigned int on); | 18 | int (*gpio_set_wake)(unsigned int gpio, unsigned int on); |
18 | }; | 19 | }; |
19 | 20 | ||