diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-15 15:33:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-15 15:33:40 -0500 |
commit | 16c1020362083b320868c0deef492249089c3cd3 (patch) | |
tree | ff200df3502e6010745713275d69fd0a07e399cf /arch/arm/mach-at91 | |
parent | 65e5d002b5ad220db2bf9557f53de5a98f7dab86 (diff) | |
parent | bbba75606963c82febf7bd2761ea848ac5d1a1bb (diff) |
Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm: (161 commits)
ARM: pxa: fix building issue of missing physmap.h
ARM: mmp: PXA910 drive strength FAST using wrong value
ARM: mmp: MMP2 drive strength FAST using wrong value
ARM: pxa: fix recursive calls in pxa_low_gpio_chip
AT91: Support for gsia18s board
AT91: Acme Systems FOX Board G20 board files
AT91: board-sam9m10g45ek.c: Remove duplicate inclusion of mach/hardware.h
ARM: pxa: fix suspend/resume array index miscalculation
ARM: pxa: use cpu_has_ipr() consistently in irq.c
ARM: pxa: remove unused variable in clock-pxa3xx.c
ARM: pxa: fix warning in zeus.c
ARM: sa1111: fix typo in sa1111_retrigger_lowirq()
ARM mxs: clkdev related compile fixes
ARM i.MX mx31_3ds: Fix MC13783 regulator names
ARM: plat-stmp3xxx: irq_data conversion.
ARM: plat-spear: irq_data conversion.
ARM: plat-orion: irq_data conversion.
ARM: plat-omap: irq_data conversion.
ARM: plat-nomadik: irq_data conversion.
ARM: plat-mxc: irq_data conversion.
...
Fix up trivial conflict in arch/arm/plat-omap/gpio.c (Lennert
Buytenhek's irq_data conversion clashing with some omap irq updates)
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 13 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-foxg20.c | 274 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-gsia18s.c | 584 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9m10g45ek.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/gpio.c | 34 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/gsia18s.h | 33 | ||||
-rw-r--r-- | arch/arm/mach-at91/irq.c | 36 |
8 files changed, 941 insertions, 36 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index c015b684b4fe..19390231a0e9 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -362,6 +362,12 @@ config MACH_CPU9G20 | |||
362 | Select this if you are using a Eukrea Electromatique's | 362 | Select this if you are using a Eukrea Electromatique's |
363 | CPU9G20 Board <http://www.eukrea.com/> | 363 | CPU9G20 Board <http://www.eukrea.com/> |
364 | 364 | ||
365 | config MACH_ACMENETUSFOXG20 | ||
366 | bool "Acme Systems srl FOX Board G20" | ||
367 | help | ||
368 | Select this if you are using Acme Systems | ||
369 | FOX Board G20 <http://www.acmesystems.it> | ||
370 | |||
365 | config MACH_PORTUXG20 | 371 | config MACH_PORTUXG20 |
366 | bool "taskit PortuxG20" | 372 | bool "taskit PortuxG20" |
367 | help | 373 | help |
@@ -381,6 +387,13 @@ config MACH_PCONTROL_G20 | |||
381 | Select this if you are using taskit's Stamp9G20 CPU module on this | 387 | Select this if you are using taskit's Stamp9G20 CPU module on this |
382 | carrier board, beeing the decentralized unit of a building automation | 388 | carrier board, beeing the decentralized unit of a building automation |
383 | system; featuring nvram, eth-switch, iso-rs485, display, io | 389 | system; featuring nvram, eth-switch, iso-rs485, display, io |
390 | |||
391 | config MACH_GSIA18S | ||
392 | bool "GS_IA18_S board" | ||
393 | help | ||
394 | This enables support for the GS_IA18_S board | ||
395 | produced by GeoSIG Ltd company. This is an internet accelerograph. | ||
396 | <http://www.geosig.com> | ||
384 | endif | 397 | endif |
385 | 398 | ||
386 | if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20) | 399 | if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20) |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index d13add71f72a..a83835e0c185 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -63,9 +63,11 @@ obj-$(CONFIG_MACH_AT91SAM9RLEK) += board-sam9rlek.o | |||
63 | # AT91SAM9G20 board-specific support | 63 | # AT91SAM9G20 board-specific support |
64 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o | 64 | obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o |
65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o | 65 | obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o |
66 | obj-$(CONFIG_MACH_ACMENETUSFOXG20) += board-foxg20.o | ||
66 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o | 67 | obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o |
67 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o | 68 | obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o |
68 | obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o | 69 | obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o |
70 | obj-$(CONFIG_MACH_GSIA18S) += board-gsia18s.o board-stamp9g20.o | ||
69 | 71 | ||
70 | # AT91SAM9260/AT91SAM9G20 board-specific support | 72 | # AT91SAM9260/AT91SAM9G20 board-specific support |
71 | obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o | 73 | obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o |
diff --git a/arch/arm/mach-at91/board-foxg20.c b/arch/arm/mach-at91/board-foxg20.c new file mode 100644 index 000000000000..dfc7dfe738e4 --- /dev/null +++ b/arch/arm/mach-at91/board-foxg20.c | |||
@@ -0,0 +1,274 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 SAN People | ||
3 | * Copyright (C) 2008 Atmel | ||
4 | * Copyright (C) 2010 Lee McLoughlin - lee@lmmrtech.com | ||
5 | * Copyright (C) 2010 Sergio Tanzilli - tanzilli@acmesystems.it | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/types.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/mm.h> | ||
25 | #include <linux/module.h> | ||
26 | #include <linux/platform_device.h> | ||
27 | #include <linux/spi/spi.h> | ||
28 | #include <linux/spi/at73c213.h> | ||
29 | #include <linux/gpio.h> | ||
30 | #include <linux/gpio_keys.h> | ||
31 | #include <linux/input.h> | ||
32 | #include <linux/clk.h> | ||
33 | #include <linux/w1-gpio.h> | ||
34 | |||
35 | #include <mach/hardware.h> | ||
36 | #include <asm/setup.h> | ||
37 | #include <asm/mach-types.h> | ||
38 | #include <asm/irq.h> | ||
39 | |||
40 | #include <asm/mach/arch.h> | ||
41 | #include <asm/mach/map.h> | ||
42 | #include <asm/mach/irq.h> | ||
43 | |||
44 | #include <mach/board.h> | ||
45 | #include <mach/at91sam9_smc.h> | ||
46 | |||
47 | #include "sam9_smc.h" | ||
48 | #include "generic.h" | ||
49 | |||
50 | /* | ||
51 | * The FOX Board G20 hardware comes as the "Netus G20" board with | ||
52 | * just the cpu, ram, dataflash and two header connectors. | ||
53 | * This is plugged into the FOX Board which provides the ethernet, | ||
54 | * usb, rtc, leds, switch, ... | ||
55 | * | ||
56 | * For more info visit: http://www.acmesystems.it/foxg20 | ||
57 | */ | ||
58 | |||
59 | |||
60 | static void __init foxg20_map_io(void) | ||
61 | { | ||
62 | /* Initialize processor: 18.432 MHz crystal */ | ||
63 | at91sam9260_initialize(18432000); | ||
64 | |||
65 | /* DBGU on ttyS0. (Rx & Tx only) */ | ||
66 | at91_register_uart(0, 0, 0); | ||
67 | |||
68 | /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
69 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
70 | ATMEL_UART_CTS | ||
71 | | ATMEL_UART_RTS | ||
72 | | ATMEL_UART_DTR | ||
73 | | ATMEL_UART_DSR | ||
74 | | ATMEL_UART_DCD | ||
75 | | ATMEL_UART_RI); | ||
76 | |||
77 | /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ | ||
78 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
79 | ATMEL_UART_CTS | ||
80 | | ATMEL_UART_RTS); | ||
81 | |||
82 | /* USART2 on ttyS3. (Rx & Tx only) */ | ||
83 | at91_register_uart(AT91SAM9260_ID_US2, 3, 0); | ||
84 | |||
85 | /* USART3 on ttyS4. (Rx, Tx, RTS, CTS) */ | ||
86 | at91_register_uart(AT91SAM9260_ID_US3, 4, | ||
87 | ATMEL_UART_CTS | ||
88 | | ATMEL_UART_RTS); | ||
89 | |||
90 | /* USART4 on ttyS5. (Rx & Tx only) */ | ||
91 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
92 | |||
93 | /* USART5 on ttyS6. (Rx & Tx only) */ | ||
94 | at91_register_uart(AT91SAM9260_ID_US5, 6, 0); | ||
95 | |||
96 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
97 | at91_set_serial_console(0); | ||
98 | |||
99 | /* Set the internal pull-up resistor on DRXD */ | ||
100 | at91_set_A_periph(AT91_PIN_PB14, 1); | ||
101 | |||
102 | } | ||
103 | |||
104 | static void __init foxg20_init_irq(void) | ||
105 | { | ||
106 | at91sam9260_init_interrupts(NULL); | ||
107 | } | ||
108 | |||
109 | |||
110 | /* | ||
111 | * USB Host port | ||
112 | */ | ||
113 | static struct at91_usbh_data __initdata foxg20_usbh_data = { | ||
114 | .ports = 2, | ||
115 | }; | ||
116 | |||
117 | /* | ||
118 | * USB Device port | ||
119 | */ | ||
120 | static struct at91_udc_data __initdata foxg20_udc_data = { | ||
121 | .vbus_pin = AT91_PIN_PC6, | ||
122 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
123 | }; | ||
124 | |||
125 | |||
126 | /* | ||
127 | * SPI devices. | ||
128 | */ | ||
129 | static struct spi_board_info foxg20_spi_devices[] = { | ||
130 | #if !defined(CONFIG_MMC_AT91) | ||
131 | { | ||
132 | .modalias = "mtd_dataflash", | ||
133 | .chip_select = 1, | ||
134 | .max_speed_hz = 15 * 1000 * 1000, | ||
135 | .bus_num = 0, | ||
136 | }, | ||
137 | #endif | ||
138 | }; | ||
139 | |||
140 | |||
141 | /* | ||
142 | * MACB Ethernet device | ||
143 | */ | ||
144 | static struct at91_eth_data __initdata foxg20_macb_data = { | ||
145 | .phy_irq_pin = AT91_PIN_PA7, | ||
146 | .is_rmii = 1, | ||
147 | }; | ||
148 | |||
149 | /* | ||
150 | * MCI (SD/MMC) | ||
151 | * det_pin, wp_pin and vcc_pin are not connected | ||
152 | */ | ||
153 | static struct at91_mmc_data __initdata foxg20_mmc_data = { | ||
154 | .slot_b = 1, | ||
155 | .wire4 = 1, | ||
156 | }; | ||
157 | |||
158 | |||
159 | /* | ||
160 | * LEDs | ||
161 | */ | ||
162 | static struct gpio_led foxg20_leds[] = { | ||
163 | { /* user led, red */ | ||
164 | .name = "user_led", | ||
165 | .gpio = AT91_PIN_PC7, | ||
166 | .active_low = 0, | ||
167 | .default_trigger = "heartbeat", | ||
168 | }, | ||
169 | }; | ||
170 | |||
171 | |||
172 | /* | ||
173 | * GPIO Buttons | ||
174 | */ | ||
175 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
176 | static struct gpio_keys_button foxg20_buttons[] = { | ||
177 | { | ||
178 | .gpio = AT91_PIN_PC4, | ||
179 | .code = BTN_1, | ||
180 | .desc = "Button 1", | ||
181 | .active_low = 1, | ||
182 | .wakeup = 1, | ||
183 | }, | ||
184 | }; | ||
185 | |||
186 | static struct gpio_keys_platform_data foxg20_button_data = { | ||
187 | .buttons = foxg20_buttons, | ||
188 | .nbuttons = ARRAY_SIZE(foxg20_buttons), | ||
189 | }; | ||
190 | |||
191 | static struct platform_device foxg20_button_device = { | ||
192 | .name = "gpio-keys", | ||
193 | .id = -1, | ||
194 | .num_resources = 0, | ||
195 | .dev = { | ||
196 | .platform_data = &foxg20_button_data, | ||
197 | } | ||
198 | }; | ||
199 | |||
200 | static void __init foxg20_add_device_buttons(void) | ||
201 | { | ||
202 | at91_set_gpio_input(AT91_PIN_PC4, 1); /* btn1 */ | ||
203 | at91_set_deglitch(AT91_PIN_PC4, 1); | ||
204 | |||
205 | platform_device_register(&foxg20_button_device); | ||
206 | } | ||
207 | #else | ||
208 | static void __init foxg20_add_device_buttons(void) {} | ||
209 | #endif | ||
210 | |||
211 | |||
212 | #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) | ||
213 | static struct w1_gpio_platform_data w1_gpio_pdata = { | ||
214 | /* If you choose to use a pin other than PB16 it needs to be 3.3V */ | ||
215 | .pin = AT91_PIN_PB16, | ||
216 | .is_open_drain = 1, | ||
217 | }; | ||
218 | |||
219 | static struct platform_device w1_device = { | ||
220 | .name = "w1-gpio", | ||
221 | .id = -1, | ||
222 | .dev.platform_data = &w1_gpio_pdata, | ||
223 | }; | ||
224 | |||
225 | static void __init at91_add_device_w1(void) | ||
226 | { | ||
227 | at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); | ||
228 | at91_set_multi_drive(w1_gpio_pdata.pin, 1); | ||
229 | platform_device_register(&w1_device); | ||
230 | } | ||
231 | |||
232 | #endif | ||
233 | |||
234 | |||
235 | static struct i2c_board_info __initdata foxg20_i2c_devices[] = { | ||
236 | { | ||
237 | I2C_BOARD_INFO("24c512", 0x50), | ||
238 | }, | ||
239 | }; | ||
240 | |||
241 | |||
242 | static void __init foxg20_board_init(void) | ||
243 | { | ||
244 | /* Serial */ | ||
245 | at91_add_device_serial(); | ||
246 | /* USB Host */ | ||
247 | at91_add_device_usbh(&foxg20_usbh_data); | ||
248 | /* USB Device */ | ||
249 | at91_add_device_udc(&foxg20_udc_data); | ||
250 | /* SPI */ | ||
251 | at91_add_device_spi(foxg20_spi_devices, ARRAY_SIZE(foxg20_spi_devices)); | ||
252 | /* Ethernet */ | ||
253 | at91_add_device_eth(&foxg20_macb_data); | ||
254 | /* MMC */ | ||
255 | at91_add_device_mmc(0, &foxg20_mmc_data); | ||
256 | /* I2C */ | ||
257 | at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); | ||
258 | /* LEDs */ | ||
259 | at91_gpio_leds(foxg20_leds, ARRAY_SIZE(foxg20_leds)); | ||
260 | /* Push Buttons */ | ||
261 | foxg20_add_device_buttons(); | ||
262 | #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) | ||
263 | at91_add_device_w1(); | ||
264 | #endif | ||
265 | } | ||
266 | |||
267 | MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") | ||
268 | /* Maintainer: Sergio Tanzilli */ | ||
269 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
270 | .timer = &at91sam926x_timer, | ||
271 | .map_io = foxg20_map_io, | ||
272 | .init_irq = foxg20_init_irq, | ||
273 | .init_machine = foxg20_board_init, | ||
274 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-gsia18s.c b/arch/arm/mach-at91/board-gsia18s.c new file mode 100644 index 000000000000..bc28136ee249 --- /dev/null +++ b/arch/arm/mach-at91/board-gsia18s.c | |||
@@ -0,0 +1,584 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> | ||
3 | * taskit GmbH | ||
4 | * 2010 Igor Plyatov <plyatov@gmail.com> | ||
5 | * GeoSIG Ltd | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/gpio.h> | ||
24 | #include <linux/w1-gpio.h> | ||
25 | #include <linux/i2c.h> | ||
26 | #include <linux/i2c/pcf857x.h> | ||
27 | #include <linux/gpio_keys.h> | ||
28 | #include <linux/input.h> | ||
29 | |||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | ||
32 | |||
33 | #include <mach/board.h> | ||
34 | #include <mach/at91sam9_smc.h> | ||
35 | #include <mach/gsia18s.h> | ||
36 | #include <mach/stamp9g20.h> | ||
37 | |||
38 | #include "sam9_smc.h" | ||
39 | #include "generic.h" | ||
40 | |||
41 | static void __init gsia18s_map_io(void) | ||
42 | { | ||
43 | stamp9g20_map_io(); | ||
44 | |||
45 | /* | ||
46 | * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI). | ||
47 | * Used for Internal Analog Modem. | ||
48 | */ | ||
49 | at91_register_uart(AT91SAM9260_ID_US0, 1, | ||
50 | ATMEL_UART_CTS | ATMEL_UART_RTS | | ||
51 | ATMEL_UART_DTR | ATMEL_UART_DSR | | ||
52 | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
53 | /* | ||
54 | * USART1 on ttyS2 (Rx, Tx, CTS, RTS). | ||
55 | * Used for GPS or WiFi or Data stream. | ||
56 | */ | ||
57 | at91_register_uart(AT91SAM9260_ID_US1, 2, | ||
58 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
59 | /* | ||
60 | * USART2 on ttyS3 (Rx, Tx, CTS, RTS). | ||
61 | * Used for External Modem. | ||
62 | */ | ||
63 | at91_register_uart(AT91SAM9260_ID_US2, 3, | ||
64 | ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
65 | /* | ||
66 | * USART3 on ttyS4 (Rx, Tx, RTS). | ||
67 | * Used for RS-485. | ||
68 | */ | ||
69 | at91_register_uart(AT91SAM9260_ID_US3, 4, ATMEL_UART_RTS); | ||
70 | |||
71 | /* | ||
72 | * USART4 on ttyS5 (Rx, Tx). | ||
73 | * Used for TRX433 Radio Module. | ||
74 | */ | ||
75 | at91_register_uart(AT91SAM9260_ID_US4, 5, 0); | ||
76 | } | ||
77 | |||
78 | static void __init init_irq(void) | ||
79 | { | ||
80 | at91sam9260_init_interrupts(NULL); | ||
81 | } | ||
82 | |||
83 | /* | ||
84 | * Two USB Host ports | ||
85 | */ | ||
86 | static struct at91_usbh_data __initdata usbh_data = { | ||
87 | .ports = 2, | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * USB Device port | ||
92 | */ | ||
93 | static struct at91_udc_data __initdata udc_data = { | ||
94 | .vbus_pin = AT91_PIN_PA22, | ||
95 | .pullup_pin = 0, /* pull-up driven by UDC */ | ||
96 | }; | ||
97 | |||
98 | /* | ||
99 | * MACB Ethernet device | ||
100 | */ | ||
101 | static struct at91_eth_data __initdata macb_data = { | ||
102 | .phy_irq_pin = AT91_PIN_PA28, | ||
103 | .is_rmii = 1, | ||
104 | }; | ||
105 | |||
106 | /* | ||
107 | * LEDs and GPOs | ||
108 | */ | ||
109 | static struct gpio_led gpio_leds[] = { | ||
110 | { | ||
111 | .name = "gpo:spi1reset", | ||
112 | .gpio = AT91_PIN_PC1, | ||
113 | .active_low = 0, | ||
114 | .default_trigger = "none", | ||
115 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
116 | }, | ||
117 | { | ||
118 | .name = "gpo:trig_net_out", | ||
119 | .gpio = AT91_PIN_PB20, | ||
120 | .active_low = 0, | ||
121 | .default_trigger = "none", | ||
122 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
123 | }, | ||
124 | { | ||
125 | .name = "gpo:trig_net_dir", | ||
126 | .gpio = AT91_PIN_PB19, | ||
127 | .active_low = 0, | ||
128 | .default_trigger = "none", | ||
129 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
130 | }, | ||
131 | { | ||
132 | .name = "gpo:charge_dis", | ||
133 | .gpio = AT91_PIN_PC2, | ||
134 | .active_low = 0, | ||
135 | .default_trigger = "none", | ||
136 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
137 | }, | ||
138 | { | ||
139 | .name = "led:event", | ||
140 | .gpio = AT91_PIN_PB17, | ||
141 | .active_low = 1, | ||
142 | .default_trigger = "none", | ||
143 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
144 | }, | ||
145 | { | ||
146 | .name = "led:lan", | ||
147 | .gpio = AT91_PIN_PB18, | ||
148 | .active_low = 1, | ||
149 | .default_trigger = "none", | ||
150 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
151 | }, | ||
152 | { | ||
153 | .name = "led:error", | ||
154 | .gpio = AT91_PIN_PB16, | ||
155 | .active_low = 1, | ||
156 | .default_trigger = "none", | ||
157 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
158 | } | ||
159 | }; | ||
160 | |||
161 | static struct gpio_led_platform_data gpio_led_info = { | ||
162 | .leds = gpio_leds, | ||
163 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
164 | }; | ||
165 | |||
166 | static struct platform_device leds = { | ||
167 | .name = "leds-gpio", | ||
168 | .id = 0, | ||
169 | .dev = { | ||
170 | .platform_data = &gpio_led_info, | ||
171 | } | ||
172 | }; | ||
173 | |||
174 | static void __init gsia18s_leds_init(void) | ||
175 | { | ||
176 | platform_device_register(&leds); | ||
177 | } | ||
178 | |||
179 | /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ | ||
180 | static struct gpio_led pcf_gpio_leds1[] = { | ||
181 | { /* bit 0 */ | ||
182 | .name = "gpo:hdc_power", | ||
183 | .gpio = PCF_GPIO_HDC_POWER, | ||
184 | .active_low = 0, | ||
185 | .default_trigger = "none", | ||
186 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
187 | }, | ||
188 | { /* bit 1 */ | ||
189 | .name = "gpo:wifi_setup", | ||
190 | .gpio = PCF_GPIO_WIFI_SETUP, | ||
191 | .active_low = 1, | ||
192 | .default_trigger = "none", | ||
193 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
194 | }, | ||
195 | { /* bit 2 */ | ||
196 | .name = "gpo:wifi_enable", | ||
197 | .gpio = PCF_GPIO_WIFI_ENABLE, | ||
198 | .active_low = 1, | ||
199 | .default_trigger = "none", | ||
200 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
201 | }, | ||
202 | { /* bit 3 */ | ||
203 | .name = "gpo:wifi_reset", | ||
204 | .gpio = PCF_GPIO_WIFI_RESET, | ||
205 | .active_low = 1, | ||
206 | .default_trigger = "none", | ||
207 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
208 | }, | ||
209 | /* bit 4 used as GPI */ | ||
210 | { /* bit 5 */ | ||
211 | .name = "gpo:gps_setup", | ||
212 | .gpio = PCF_GPIO_GPS_SETUP, | ||
213 | .active_low = 1, | ||
214 | .default_trigger = "none", | ||
215 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
216 | }, | ||
217 | { /* bit 6 */ | ||
218 | .name = "gpo:gps_standby", | ||
219 | .gpio = PCF_GPIO_GPS_STANDBY, | ||
220 | .active_low = 0, | ||
221 | .default_trigger = "none", | ||
222 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
223 | }, | ||
224 | { /* bit 7 */ | ||
225 | .name = "gpo:gps_power", | ||
226 | .gpio = PCF_GPIO_GPS_POWER, | ||
227 | .active_low = 0, | ||
228 | .default_trigger = "none", | ||
229 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
230 | } | ||
231 | }; | ||
232 | |||
233 | static struct gpio_led_platform_data pcf_gpio_led_info1 = { | ||
234 | .leds = pcf_gpio_leds1, | ||
235 | .num_leds = ARRAY_SIZE(pcf_gpio_leds1), | ||
236 | }; | ||
237 | |||
238 | static struct platform_device pcf_leds1 = { | ||
239 | .name = "leds-gpio", /* GS_IA18-CB_board */ | ||
240 | .id = 1, | ||
241 | .dev = { | ||
242 | .platform_data = &pcf_gpio_led_info1, | ||
243 | } | ||
244 | }; | ||
245 | |||
246 | /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ | ||
247 | static struct gpio_led pcf_gpio_leds2[] = { | ||
248 | { /* bit 0 */ | ||
249 | .name = "gpo:alarm_1", | ||
250 | .gpio = PCF_GPIO_ALARM1, | ||
251 | .active_low = 1, | ||
252 | .default_trigger = "none", | ||
253 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
254 | }, | ||
255 | { /* bit 1 */ | ||
256 | .name = "gpo:alarm_2", | ||
257 | .gpio = PCF_GPIO_ALARM2, | ||
258 | .active_low = 1, | ||
259 | .default_trigger = "none", | ||
260 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
261 | }, | ||
262 | { /* bit 2 */ | ||
263 | .name = "gpo:alarm_3", | ||
264 | .gpio = PCF_GPIO_ALARM3, | ||
265 | .active_low = 1, | ||
266 | .default_trigger = "none", | ||
267 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
268 | }, | ||
269 | { /* bit 3 */ | ||
270 | .name = "gpo:alarm_4", | ||
271 | .gpio = PCF_GPIO_ALARM4, | ||
272 | .active_low = 1, | ||
273 | .default_trigger = "none", | ||
274 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
275 | }, | ||
276 | /* bits 4, 5, 6 not used */ | ||
277 | { /* bit 7 */ | ||
278 | .name = "gpo:alarm_v_relay_on", | ||
279 | .gpio = PCF_GPIO_ALARM_V_RELAY_ON, | ||
280 | .active_low = 0, | ||
281 | .default_trigger = "none", | ||
282 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
283 | }, | ||
284 | }; | ||
285 | |||
286 | static struct gpio_led_platform_data pcf_gpio_led_info2 = { | ||
287 | .leds = pcf_gpio_leds2, | ||
288 | .num_leds = ARRAY_SIZE(pcf_gpio_leds2), | ||
289 | }; | ||
290 | |||
291 | static struct platform_device pcf_leds2 = { | ||
292 | .name = "leds-gpio", | ||
293 | .id = 2, | ||
294 | .dev = { | ||
295 | .platform_data = &pcf_gpio_led_info2, | ||
296 | } | ||
297 | }; | ||
298 | |||
299 | /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ | ||
300 | static struct gpio_led pcf_gpio_leds3[] = { | ||
301 | { /* bit 0 */ | ||
302 | .name = "gpo:modem_power", | ||
303 | .gpio = PCF_GPIO_MODEM_POWER, | ||
304 | .active_low = 1, | ||
305 | .default_trigger = "none", | ||
306 | .default_state = LEDS_GPIO_DEFSTATE_OFF, | ||
307 | }, | ||
308 | /* bits 1 and 2 not used */ | ||
309 | { /* bit 3 */ | ||
310 | .name = "gpo:modem_reset", | ||
311 | .gpio = PCF_GPIO_MODEM_RESET, | ||
312 | .active_low = 1, | ||
313 | .default_trigger = "none", | ||
314 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
315 | }, | ||
316 | /* bits 4, 5 and 6 not used */ | ||
317 | { /* bit 7 */ | ||
318 | .name = "gpo:trx_reset", | ||
319 | .gpio = PCF_GPIO_TRX_RESET, | ||
320 | .active_low = 1, | ||
321 | .default_trigger = "none", | ||
322 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
323 | } | ||
324 | }; | ||
325 | |||
326 | static struct gpio_led_platform_data pcf_gpio_led_info3 = { | ||
327 | .leds = pcf_gpio_leds3, | ||
328 | .num_leds = ARRAY_SIZE(pcf_gpio_leds3), | ||
329 | }; | ||
330 | |||
331 | static struct platform_device pcf_leds3 = { | ||
332 | .name = "leds-gpio", | ||
333 | .id = 3, | ||
334 | .dev = { | ||
335 | .platform_data = &pcf_gpio_led_info3, | ||
336 | } | ||
337 | }; | ||
338 | |||
339 | static void __init gsia18s_pcf_leds_init(void) | ||
340 | { | ||
341 | platform_device_register(&pcf_leds1); | ||
342 | platform_device_register(&pcf_leds2); | ||
343 | platform_device_register(&pcf_leds3); | ||
344 | } | ||
345 | |||
346 | /* | ||
347 | * SPI busses. | ||
348 | */ | ||
349 | static struct spi_board_info gsia18s_spi_devices[] = { | ||
350 | { /* User accessible spi0, cs0 used for communication with MSP RTC */ | ||
351 | .modalias = "spidev", | ||
352 | .bus_num = 0, | ||
353 | .chip_select = 0, | ||
354 | .max_speed_hz = 580000, | ||
355 | .mode = SPI_MODE_1, | ||
356 | }, | ||
357 | { /* User accessible spi1, cs0 used for communication with int. DSP */ | ||
358 | .modalias = "spidev", | ||
359 | .bus_num = 1, | ||
360 | .chip_select = 0, | ||
361 | .max_speed_hz = 5600000, | ||
362 | .mode = SPI_MODE_0, | ||
363 | }, | ||
364 | { /* User accessible spi1, cs1 used for communication with ext. DSP */ | ||
365 | .modalias = "spidev", | ||
366 | .bus_num = 1, | ||
367 | .chip_select = 1, | ||
368 | .max_speed_hz = 5600000, | ||
369 | .mode = SPI_MODE_0, | ||
370 | }, | ||
371 | { /* User accessible spi1, cs2 used for communication with ext. DSP */ | ||
372 | .modalias = "spidev", | ||
373 | .bus_num = 1, | ||
374 | .chip_select = 2, | ||
375 | .max_speed_hz = 5600000, | ||
376 | .mode = SPI_MODE_0, | ||
377 | }, | ||
378 | { /* User accessible spi1, cs3 used for communication with ext. DSP */ | ||
379 | .modalias = "spidev", | ||
380 | .bus_num = 1, | ||
381 | .chip_select = 3, | ||
382 | .max_speed_hz = 5600000, | ||
383 | .mode = SPI_MODE_0, | ||
384 | } | ||
385 | }; | ||
386 | |||
387 | /* | ||
388 | * GPI Buttons | ||
389 | */ | ||
390 | static struct gpio_keys_button buttons[] = { | ||
391 | { | ||
392 | .gpio = GPIO_TRIG_NET_IN, | ||
393 | .code = BTN_1, | ||
394 | .desc = "TRIG_NET_IN", | ||
395 | .type = EV_KEY, | ||
396 | .active_low = 0, | ||
397 | .wakeup = 1, | ||
398 | }, | ||
399 | { /* SW80 on the GS_IA18_S-MN board*/ | ||
400 | .gpio = GPIO_CARD_UNMOUNT_0, | ||
401 | .code = BTN_2, | ||
402 | .desc = "Card umount 0", | ||
403 | .type = EV_KEY, | ||
404 | .active_low = 1, | ||
405 | .wakeup = 1, | ||
406 | }, | ||
407 | { /* SW79 on the GS_IA18_S-MN board*/ | ||
408 | .gpio = GPIO_CARD_UNMOUNT_1, | ||
409 | .code = BTN_3, | ||
410 | .desc = "Card umount 1", | ||
411 | .type = EV_KEY, | ||
412 | .active_low = 1, | ||
413 | .wakeup = 1, | ||
414 | }, | ||
415 | { /* SW280 on the GS_IA18-CB board*/ | ||
416 | .gpio = GPIO_KEY_POWER, | ||
417 | .code = KEY_POWER, | ||
418 | .desc = "Power Off Button", | ||
419 | .type = EV_KEY, | ||
420 | .active_low = 0, | ||
421 | .wakeup = 1, | ||
422 | } | ||
423 | }; | ||
424 | |||
425 | static struct gpio_keys_platform_data button_data = { | ||
426 | .buttons = buttons, | ||
427 | .nbuttons = ARRAY_SIZE(buttons), | ||
428 | }; | ||
429 | |||
430 | static struct platform_device button_device = { | ||
431 | .name = "gpio-keys", | ||
432 | .id = -1, | ||
433 | .num_resources = 0, | ||
434 | .dev = { | ||
435 | .platform_data = &button_data, | ||
436 | } | ||
437 | }; | ||
438 | |||
439 | static void __init gsia18s_add_device_buttons(void) | ||
440 | { | ||
441 | at91_set_gpio_input(GPIO_TRIG_NET_IN, 1); | ||
442 | at91_set_deglitch(GPIO_TRIG_NET_IN, 1); | ||
443 | at91_set_gpio_input(GPIO_CARD_UNMOUNT_0, 1); | ||
444 | at91_set_deglitch(GPIO_CARD_UNMOUNT_0, 1); | ||
445 | at91_set_gpio_input(GPIO_CARD_UNMOUNT_1, 1); | ||
446 | at91_set_deglitch(GPIO_CARD_UNMOUNT_1, 1); | ||
447 | at91_set_gpio_input(GPIO_KEY_POWER, 0); | ||
448 | at91_set_deglitch(GPIO_KEY_POWER, 1); | ||
449 | |||
450 | platform_device_register(&button_device); | ||
451 | } | ||
452 | |||
453 | /* | ||
454 | * I2C | ||
455 | */ | ||
456 | static int pcf8574x_0x20_setup(struct i2c_client *client, int gpio, | ||
457 | unsigned int ngpio, void *context) | ||
458 | { | ||
459 | int status; | ||
460 | |||
461 | status = gpio_request(gpio + PCF_GPIO_ETH_DETECT, "eth_det"); | ||
462 | if (status < 0) { | ||
463 | pr_err("error: can't request GPIO%d\n", | ||
464 | gpio + PCF_GPIO_ETH_DETECT); | ||
465 | return status; | ||
466 | } | ||
467 | status = gpio_direction_input(gpio + PCF_GPIO_ETH_DETECT); | ||
468 | if (status < 0) { | ||
469 | pr_err("error: can't setup GPIO%d as input\n", | ||
470 | gpio + PCF_GPIO_ETH_DETECT); | ||
471 | return status; | ||
472 | } | ||
473 | status = gpio_export(gpio + PCF_GPIO_ETH_DETECT, false); | ||
474 | if (status < 0) { | ||
475 | pr_err("error: can't export GPIO%d\n", | ||
476 | gpio + PCF_GPIO_ETH_DETECT); | ||
477 | return status; | ||
478 | } | ||
479 | status = gpio_sysfs_set_active_low(gpio + PCF_GPIO_ETH_DETECT, 1); | ||
480 | if (status < 0) { | ||
481 | pr_err("error: gpio_sysfs_set active_low(GPIO%d, 1)\n", | ||
482 | gpio + PCF_GPIO_ETH_DETECT); | ||
483 | return status; | ||
484 | } | ||
485 | |||
486 | return 0; | ||
487 | } | ||
488 | |||
489 | static int pcf8574x_0x20_teardown(struct i2c_client *client, int gpio, | ||
490 | unsigned ngpio, void *context) | ||
491 | { | ||
492 | gpio_free(gpio + PCF_GPIO_ETH_DETECT); | ||
493 | return 0; | ||
494 | } | ||
495 | |||
496 | static struct pcf857x_platform_data pcf20_pdata = { | ||
497 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE0, | ||
498 | .n_latch = (1 << 4), | ||
499 | .setup = pcf8574x_0x20_setup, | ||
500 | .teardown = pcf8574x_0x20_teardown, | ||
501 | }; | ||
502 | |||
503 | static struct pcf857x_platform_data pcf22_pdata = { | ||
504 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE1, | ||
505 | }; | ||
506 | |||
507 | static struct pcf857x_platform_data pcf24_pdata = { | ||
508 | .gpio_base = GS_IA18_S_PCF_GPIO_BASE2, | ||
509 | }; | ||
510 | |||
511 | static struct i2c_board_info __initdata gsia18s_i2c_devices[] = { | ||
512 | { /* U1 on the GS_IA18-CB_V3 board */ | ||
513 | I2C_BOARD_INFO("pcf8574", 0x20), | ||
514 | .platform_data = &pcf20_pdata, | ||
515 | }, | ||
516 | { /* U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ | ||
517 | I2C_BOARD_INFO("pcf8574", 0x22), | ||
518 | .platform_data = &pcf22_pdata, | ||
519 | }, | ||
520 | { /* U1 on the GS_2G-OPT23-A_V0 board (Modem) */ | ||
521 | I2C_BOARD_INFO("pcf8574", 0x24), | ||
522 | .platform_data = &pcf24_pdata, | ||
523 | }, | ||
524 | { /* U161 on the GS_IA18_S-MN board */ | ||
525 | I2C_BOARD_INFO("24c1024", 0x50), | ||
526 | }, | ||
527 | { /* U162 on the GS_IA18_S-MN board */ | ||
528 | I2C_BOARD_INFO("24c01", 0x53), | ||
529 | }, | ||
530 | }; | ||
531 | |||
532 | /* | ||
533 | * Compact Flash | ||
534 | */ | ||
535 | static struct at91_cf_data __initdata gsia18s_cf1_data = { | ||
536 | .irq_pin = AT91_PIN_PA27, | ||
537 | .det_pin = AT91_PIN_PB30, | ||
538 | .rst_pin = AT91_PIN_PB31, | ||
539 | .chipselect = 5, | ||
540 | .flags = AT91_CF_TRUE_IDE, | ||
541 | }; | ||
542 | |||
543 | /* Power Off by RTC */ | ||
544 | static void gsia18s_power_off(void) | ||
545 | { | ||
546 | pr_notice("Power supply will be switched off automatically now or after 60 seconds without ArmDAS.\n"); | ||
547 | at91_set_gpio_output(AT91_PIN_PA25, 1); | ||
548 | /* Spin to death... */ | ||
549 | while (1) | ||
550 | ; | ||
551 | } | ||
552 | |||
553 | static int __init gsia18s_power_off_init(void) | ||
554 | { | ||
555 | pm_power_off = gsia18s_power_off; | ||
556 | return 0; | ||
557 | } | ||
558 | |||
559 | /* ---------------------------------------------------------------------------*/ | ||
560 | |||
561 | static void __init gsia18s_board_init(void) | ||
562 | { | ||
563 | stamp9g20_board_init(); | ||
564 | at91_add_device_usbh(&usbh_data); | ||
565 | at91_add_device_udc(&udc_data); | ||
566 | at91_add_device_eth(&macb_data); | ||
567 | gsia18s_leds_init(); | ||
568 | gsia18s_pcf_leds_init(); | ||
569 | gsia18s_add_device_buttons(); | ||
570 | at91_add_device_i2c(gsia18s_i2c_devices, | ||
571 | ARRAY_SIZE(gsia18s_i2c_devices)); | ||
572 | at91_add_device_cf(&gsia18s_cf1_data); | ||
573 | at91_add_device_spi(gsia18s_spi_devices, | ||
574 | ARRAY_SIZE(gsia18s_spi_devices)); | ||
575 | gsia18s_power_off_init(); | ||
576 | } | ||
577 | |||
578 | MACHINE_START(GSIA18S, "GS_IA18_S") | ||
579 | .boot_params = AT91_SDRAM_BASE + 0x100, | ||
580 | .timer = &at91sam926x_timer, | ||
581 | .map_io = gsia18s_map_io, | ||
582 | .init_irq = init_irq, | ||
583 | .init_machine = gsia18s_board_init, | ||
584 | MACHINE_END | ||
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index 86ff4b52db32..6c999dbd2bcf 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
38 | #include <asm/mach/irq.h> | 38 | #include <asm/mach/irq.h> |
39 | 39 | ||
40 | #include <mach/hardware.h> | ||
41 | #include <mach/board.h> | 40 | #include <mach/board.h> |
42 | #include <mach/gpio.h> | 41 | #include <mach/gpio.h> |
43 | #include <mach/at91sam9_smc.h> | 42 | #include <mach/at91sam9_smc.h> |
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index ae4772e744ac..af818a21587c 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -274,10 +274,10 @@ EXPORT_SYMBOL(at91_get_gpio_value); | |||
274 | static u32 wakeups[MAX_GPIO_BANKS]; | 274 | static u32 wakeups[MAX_GPIO_BANKS]; |
275 | static u32 backups[MAX_GPIO_BANKS]; | 275 | static u32 backups[MAX_GPIO_BANKS]; |
276 | 276 | ||
277 | static int gpio_irq_set_wake(unsigned pin, unsigned state) | 277 | static int gpio_irq_set_wake(struct irq_data *d, unsigned state) |
278 | { | 278 | { |
279 | unsigned mask = pin_to_mask(pin); | 279 | unsigned mask = pin_to_mask(d->irq); |
280 | unsigned bank = (pin - PIN_BASE) / 32; | 280 | unsigned bank = (d->irq - PIN_BASE) / 32; |
281 | 281 | ||
282 | if (unlikely(bank >= MAX_GPIO_BANKS)) | 282 | if (unlikely(bank >= MAX_GPIO_BANKS)) |
283 | return -EINVAL; | 283 | return -EINVAL; |
@@ -344,25 +344,25 @@ void at91_gpio_resume(void) | |||
344 | * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. | 344 | * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. |
345 | */ | 345 | */ |
346 | 346 | ||
347 | static void gpio_irq_mask(unsigned pin) | 347 | static void gpio_irq_mask(struct irq_data *d) |
348 | { | 348 | { |
349 | void __iomem *pio = pin_to_controller(pin); | 349 | void __iomem *pio = pin_to_controller(d->irq); |
350 | unsigned mask = pin_to_mask(pin); | 350 | unsigned mask = pin_to_mask(d->irq); |
351 | 351 | ||
352 | if (pio) | 352 | if (pio) |
353 | __raw_writel(mask, pio + PIO_IDR); | 353 | __raw_writel(mask, pio + PIO_IDR); |
354 | } | 354 | } |
355 | 355 | ||
356 | static void gpio_irq_unmask(unsigned pin) | 356 | static void gpio_irq_unmask(struct irq_data *d) |
357 | { | 357 | { |
358 | void __iomem *pio = pin_to_controller(pin); | 358 | void __iomem *pio = pin_to_controller(d->irq); |
359 | unsigned mask = pin_to_mask(pin); | 359 | unsigned mask = pin_to_mask(d->irq); |
360 | 360 | ||
361 | if (pio) | 361 | if (pio) |
362 | __raw_writel(mask, pio + PIO_IER); | 362 | __raw_writel(mask, pio + PIO_IER); |
363 | } | 363 | } |
364 | 364 | ||
365 | static int gpio_irq_type(unsigned pin, unsigned type) | 365 | static int gpio_irq_type(struct irq_data *d, unsigned type) |
366 | { | 366 | { |
367 | switch (type) { | 367 | switch (type) { |
368 | case IRQ_TYPE_NONE: | 368 | case IRQ_TYPE_NONE: |
@@ -375,10 +375,10 @@ static int gpio_irq_type(unsigned pin, unsigned type) | |||
375 | 375 | ||
376 | static struct irq_chip gpio_irqchip = { | 376 | static struct irq_chip gpio_irqchip = { |
377 | .name = "GPIO", | 377 | .name = "GPIO", |
378 | .mask = gpio_irq_mask, | 378 | .irq_mask = gpio_irq_mask, |
379 | .unmask = gpio_irq_unmask, | 379 | .irq_unmask = gpio_irq_unmask, |
380 | .set_type = gpio_irq_type, | 380 | .irq_set_type = gpio_irq_type, |
381 | .set_wake = gpio_irq_set_wake, | 381 | .irq_set_wake = gpio_irq_set_wake, |
382 | }; | 382 | }; |
383 | 383 | ||
384 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 384 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) |
@@ -393,7 +393,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
393 | pio = at91_gpio->regbase; | 393 | pio = at91_gpio->regbase; |
394 | 394 | ||
395 | /* temporarily mask (level sensitive) parent IRQ */ | 395 | /* temporarily mask (level sensitive) parent IRQ */ |
396 | desc->chip->ack(irq); | 396 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
397 | for (;;) { | 397 | for (;;) { |
398 | /* Reading ISR acks pending (edge triggered) GPIO interrupts. | 398 | /* Reading ISR acks pending (edge triggered) GPIO interrupts. |
399 | * When there none are pending, we're finished unless we need | 399 | * When there none are pending, we're finished unless we need |
@@ -419,7 +419,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
419 | * another IRQ must be generated before it actually gets | 419 | * another IRQ must be generated before it actually gets |
420 | * here to be disabled on the GPIO controller. | 420 | * here to be disabled on the GPIO controller. |
421 | */ | 421 | */ |
422 | gpio_irq_mask(pin); | 422 | gpio_irq_mask(irq_get_irq_data(pin)); |
423 | } | 423 | } |
424 | else | 424 | else |
425 | generic_handle_irq(pin); | 425 | generic_handle_irq(pin); |
@@ -429,7 +429,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
429 | isr >>= 1; | 429 | isr >>= 1; |
430 | } | 430 | } |
431 | } | 431 | } |
432 | desc->chip->unmask(irq); | 432 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
433 | /* now it may re-trigger */ | 433 | /* now it may re-trigger */ |
434 | } | 434 | } |
435 | 435 | ||
diff --git a/arch/arm/mach-at91/include/mach/gsia18s.h b/arch/arm/mach-at91/include/mach/gsia18s.h new file mode 100644 index 000000000000..307c194926f9 --- /dev/null +++ b/arch/arm/mach-at91/include/mach/gsia18s.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* Buttons */ | ||
2 | #define GPIO_TRIG_NET_IN AT91_PIN_PB21 | ||
3 | #define GPIO_CARD_UNMOUNT_0 AT91_PIN_PB13 | ||
4 | #define GPIO_CARD_UNMOUNT_1 AT91_PIN_PB12 | ||
5 | #define GPIO_KEY_POWER AT91_PIN_PA25 | ||
6 | |||
7 | /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ | ||
8 | #define GS_IA18_S_PCF_GPIO_BASE0 NR_BUILTIN_GPIO | ||
9 | #define PCF_GPIO_HDC_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 0) | ||
10 | #define PCF_GPIO_WIFI_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 1) | ||
11 | #define PCF_GPIO_WIFI_ENABLE (GS_IA18_S_PCF_GPIO_BASE0 + 2) | ||
12 | #define PCF_GPIO_WIFI_RESET (GS_IA18_S_PCF_GPIO_BASE0 + 3) | ||
13 | #define PCF_GPIO_ETH_DETECT 4 /* this is a GPI */ | ||
14 | #define PCF_GPIO_GPS_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 5) | ||
15 | #define PCF_GPIO_GPS_STANDBY (GS_IA18_S_PCF_GPIO_BASE0 + 6) | ||
16 | #define PCF_GPIO_GPS_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 7) | ||
17 | |||
18 | /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ | ||
19 | #define GS_IA18_S_PCF_GPIO_BASE1 (GS_IA18_S_PCF_GPIO_BASE0 + 8) | ||
20 | #define PCF_GPIO_ALARM1 (GS_IA18_S_PCF_GPIO_BASE1 + 0) | ||
21 | #define PCF_GPIO_ALARM2 (GS_IA18_S_PCF_GPIO_BASE1 + 1) | ||
22 | #define PCF_GPIO_ALARM3 (GS_IA18_S_PCF_GPIO_BASE1 + 2) | ||
23 | #define PCF_GPIO_ALARM4 (GS_IA18_S_PCF_GPIO_BASE1 + 3) | ||
24 | /* bits 4, 5, 6 not used */ | ||
25 | #define PCF_GPIO_ALARM_V_RELAY_ON (GS_IA18_S_PCF_GPIO_BASE1 + 7) | ||
26 | |||
27 | /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ | ||
28 | #define GS_IA18_S_PCF_GPIO_BASE2 (GS_IA18_S_PCF_GPIO_BASE1 + 8) | ||
29 | #define PCF_GPIO_MODEM_POWER (GS_IA18_S_PCF_GPIO_BASE2 + 0) | ||
30 | #define PCF_GPIO_MODEM_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 3) | ||
31 | /* bits 1, 2, 4, 5 not used */ | ||
32 | #define PCF_GPIO_TRX_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 6) | ||
33 | /* bit 7 not used */ | ||
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c index da3494a53423..b56d6b3a4087 100644 --- a/arch/arm/mach-at91/irq.c +++ b/arch/arm/mach-at91/irq.c | |||
@@ -34,23 +34,23 @@ | |||
34 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
35 | 35 | ||
36 | 36 | ||
37 | static void at91_aic_mask_irq(unsigned int irq) | 37 | static void at91_aic_mask_irq(struct irq_data *d) |
38 | { | 38 | { |
39 | /* Disable interrupt on AIC */ | 39 | /* Disable interrupt on AIC */ |
40 | at91_sys_write(AT91_AIC_IDCR, 1 << irq); | 40 | at91_sys_write(AT91_AIC_IDCR, 1 << d->irq); |
41 | } | 41 | } |
42 | 42 | ||
43 | static void at91_aic_unmask_irq(unsigned int irq) | 43 | static void at91_aic_unmask_irq(struct irq_data *d) |
44 | { | 44 | { |
45 | /* Enable interrupt on AIC */ | 45 | /* Enable interrupt on AIC */ |
46 | at91_sys_write(AT91_AIC_IECR, 1 << irq); | 46 | at91_sys_write(AT91_AIC_IECR, 1 << d->irq); |
47 | } | 47 | } |
48 | 48 | ||
49 | unsigned int at91_extern_irq; | 49 | unsigned int at91_extern_irq; |
50 | 50 | ||
51 | #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) | 51 | #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) |
52 | 52 | ||
53 | static int at91_aic_set_type(unsigned irq, unsigned type) | 53 | static int at91_aic_set_type(struct irq_data *d, unsigned type) |
54 | { | 54 | { |
55 | unsigned int smr, srctype; | 55 | unsigned int smr, srctype; |
56 | 56 | ||
@@ -62,13 +62,13 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
62 | srctype = AT91_AIC_SRCTYPE_RISING; | 62 | srctype = AT91_AIC_SRCTYPE_RISING; |
63 | break; | 63 | break; |
64 | case IRQ_TYPE_LEVEL_LOW: | 64 | case IRQ_TYPE_LEVEL_LOW: |
65 | if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ | 65 | if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ |
66 | srctype = AT91_AIC_SRCTYPE_LOW; | 66 | srctype = AT91_AIC_SRCTYPE_LOW; |
67 | else | 67 | else |
68 | return -EINVAL; | 68 | return -EINVAL; |
69 | break; | 69 | break; |
70 | case IRQ_TYPE_EDGE_FALLING: | 70 | case IRQ_TYPE_EDGE_FALLING: |
71 | if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ | 71 | if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ |
72 | srctype = AT91_AIC_SRCTYPE_FALLING; | 72 | srctype = AT91_AIC_SRCTYPE_FALLING; |
73 | else | 73 | else |
74 | return -EINVAL; | 74 | return -EINVAL; |
@@ -77,8 +77,8 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
77 | return -EINVAL; | 77 | return -EINVAL; |
78 | } | 78 | } |
79 | 79 | ||
80 | smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE; | 80 | smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; |
81 | at91_sys_write(AT91_AIC_SMR(irq), smr | srctype); | 81 | at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype); |
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
@@ -87,15 +87,15 @@ static int at91_aic_set_type(unsigned irq, unsigned type) | |||
87 | static u32 wakeups; | 87 | static u32 wakeups; |
88 | static u32 backups; | 88 | static u32 backups; |
89 | 89 | ||
90 | static int at91_aic_set_wake(unsigned irq, unsigned value) | 90 | static int at91_aic_set_wake(struct irq_data *d, unsigned value) |
91 | { | 91 | { |
92 | if (unlikely(irq >= 32)) | 92 | if (unlikely(d->irq >= 32)) |
93 | return -EINVAL; | 93 | return -EINVAL; |
94 | 94 | ||
95 | if (value) | 95 | if (value) |
96 | wakeups |= (1 << irq); | 96 | wakeups |= (1 << d->irq); |
97 | else | 97 | else |
98 | wakeups &= ~(1 << irq); | 98 | wakeups &= ~(1 << d->irq); |
99 | 99 | ||
100 | return 0; | 100 | return 0; |
101 | } | 101 | } |
@@ -119,11 +119,11 @@ void at91_irq_resume(void) | |||
119 | 119 | ||
120 | static struct irq_chip at91_aic_chip = { | 120 | static struct irq_chip at91_aic_chip = { |
121 | .name = "AIC", | 121 | .name = "AIC", |
122 | .ack = at91_aic_mask_irq, | 122 | .irq_ack = at91_aic_mask_irq, |
123 | .mask = at91_aic_mask_irq, | 123 | .irq_mask = at91_aic_mask_irq, |
124 | .unmask = at91_aic_unmask_irq, | 124 | .irq_unmask = at91_aic_unmask_irq, |
125 | .set_type = at91_aic_set_type, | 125 | .irq_set_type = at91_aic_set_type, |
126 | .set_wake = at91_aic_set_wake, | 126 | .irq_set_wake = at91_aic_set_wake, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | /* | 129 | /* |