diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 19 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1003.c | 2 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1004.c | 2 | ||||
-rw-r--r-- | arch/avr32/kernel/time.c | 6 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 56 |
5 files changed, 63 insertions, 22 deletions
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 14dc5a143695..8538ba75ef92 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <asm/io.h> | 22 | #include <asm/io.h> |
23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
24 | #include <asm/atmel-mci.h> | ||
25 | |||
24 | #include <asm/arch/at32ap700x.h> | 26 | #include <asm/arch/at32ap700x.h> |
25 | #include <asm/arch/board.h> | 27 | #include <asm/arch/board.h> |
26 | #include <asm/arch/init.h> | 28 | #include <asm/arch/init.h> |
@@ -260,6 +262,21 @@ void __init setup_board(void) | |||
260 | at32_setup_serial_console(0); | 262 | at32_setup_serial_console(0); |
261 | } | 263 | } |
262 | 264 | ||
265 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | ||
266 | |||
267 | /* MMC card detect requires MACB0 *NOT* be used */ | ||
268 | #ifdef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM | ||
269 | static struct mci_platform_data __initdata mci0_data = { | ||
270 | .detect_pin = GPIO_PIN_PC(14), /* gpio30/sdcd */ | ||
271 | .wp_pin = GPIO_PIN_PC(15), /* gpio31/sdwp */ | ||
272 | }; | ||
273 | #define MCI_PDATA &mci0_data | ||
274 | #else | ||
275 | #define MCI_PDATA NULL | ||
276 | #endif /* SW6 for sd{cd,wp} routing */ | ||
277 | |||
278 | #endif /* SW2 for MMC signal routing */ | ||
279 | |||
263 | static int __init atstk1002_init(void) | 280 | static int __init atstk1002_init(void) |
264 | { | 281 | { |
265 | /* | 282 | /* |
@@ -309,7 +326,7 @@ static int __init atstk1002_init(void) | |||
309 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 326 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
310 | #endif | 327 | #endif |
311 | #ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM | 328 | #ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM |
312 | at32_add_device_mci(0, NULL); | 329 | at32_add_device_mci(0, MCI_PDATA); |
313 | #endif | 330 | #endif |
314 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM | 331 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM |
315 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | 332 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c index ea109f435a83..591fc73b554a 100644 --- a/arch/avr32/boards/atstk1000/atstk1003.c +++ b/arch/avr32/boards/atstk1000/atstk1003.c | |||
@@ -154,7 +154,7 @@ static int __init atstk1003_init(void) | |||
154 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 154 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
155 | #endif | 155 | #endif |
156 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 156 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
157 | at32_add_device_mci(0); | 157 | at32_add_device_mci(0, NULL); |
158 | #endif | 158 | #endif |
159 | at32_add_device_usba(0, NULL); | 159 | at32_add_device_usba(0, NULL); |
160 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM | 160 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM |
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c index c7236df74d74..d9c5e0a21256 100644 --- a/arch/avr32/boards/atstk1000/atstk1004.c +++ b/arch/avr32/boards/atstk1000/atstk1004.c | |||
@@ -137,7 +137,7 @@ static int __init atstk1004_init(void) | |||
137 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 137 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
138 | #endif | 138 | #endif |
139 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 139 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
140 | at32_add_device_mci(0); | 140 | at32_add_device_mci(0, NULL); |
141 | #endif | 141 | #endif |
142 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 142 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
143 | fbmem_start, fbmem_size, 0); | 143 | fbmem_start, fbmem_size, 0); |
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c index abd954fb7ba0..7e7f32771ae1 100644 --- a/arch/avr32/kernel/time.c +++ b/arch/avr32/kernel/time.c | |||
@@ -43,6 +43,9 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
43 | { | 43 | { |
44 | struct clock_event_device *evdev = dev_id; | 44 | struct clock_event_device *evdev = dev_id; |
45 | 45 | ||
46 | if (unlikely(!(intc_get_pending(0) & 1))) | ||
47 | return IRQ_NONE; | ||
48 | |||
46 | /* | 49 | /* |
47 | * Disable the interrupt until the clockevent subsystem | 50 | * Disable the interrupt until the clockevent subsystem |
48 | * reprograms it. | 51 | * reprograms it. |
@@ -55,7 +58,8 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
55 | 58 | ||
56 | static struct irqaction timer_irqaction = { | 59 | static struct irqaction timer_irqaction = { |
57 | .handler = timer_interrupt, | 60 | .handler = timer_interrupt, |
58 | .flags = IRQF_TIMER | IRQF_DISABLED, | 61 | /* Oprofile uses the same irq as the timer, so allow it to be shared */ |
62 | .flags = IRQF_TIMER | IRQF_DISABLED | IRQF_SHARED, | ||
59 | .name = "avr32_comparator", | 63 | .name = "avr32_comparator", |
60 | }; | 64 | }; |
61 | 65 | ||
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 351e1b42f937..1617048c86c5 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
15 | #include <linux/gpio.h> | ||
15 | #include <linux/spi/spi.h> | 16 | #include <linux/spi/spi.h> |
16 | #include <linux/usb/atmel_usba_udc.h> | 17 | #include <linux/usb/atmel_usba_udc.h> |
17 | 18 | ||
@@ -1285,7 +1286,6 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data) | |||
1285 | { | 1286 | { |
1286 | struct mci_platform_data _data; | 1287 | struct mci_platform_data _data; |
1287 | struct platform_device *pdev; | 1288 | struct platform_device *pdev; |
1288 | struct dw_dma_slave *dws; | ||
1289 | 1289 | ||
1290 | if (id != 0) | 1290 | if (id != 0) |
1291 | return NULL; | 1291 | return NULL; |
@@ -1300,7 +1300,9 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data) | |||
1300 | 1300 | ||
1301 | if (!data) { | 1301 | if (!data) { |
1302 | data = &_data; | 1302 | data = &_data; |
1303 | memset(data, 0, sizeof(struct mci_platform_data)); | 1303 | memset(data, -1, sizeof(struct mci_platform_data)); |
1304 | data->detect_pin = GPIO_PIN_NONE; | ||
1305 | data->wp_pin = GPIO_PIN_NONE; | ||
1304 | } | 1306 | } |
1305 | 1307 | ||
1306 | if (platform_device_add_data(pdev, data, | 1308 | if (platform_device_add_data(pdev, data, |
@@ -1314,12 +1316,10 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data) | |||
1314 | select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */ | 1316 | select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */ |
1315 | select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */ | 1317 | select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */ |
1316 | 1318 | ||
1317 | if (data) { | 1319 | if (gpio_is_valid(data->detect_pin)) |
1318 | if (data->detect_pin != GPIO_PIN_NONE) | 1320 | at32_select_gpio(data->detect_pin, 0); |
1319 | at32_select_gpio(data->detect_pin, 0); | 1321 | if (gpio_is_valid(data->wp_pin)) |
1320 | if (data->wp_pin != GPIO_PIN_NONE) | 1322 | at32_select_gpio(data->wp_pin, 0); |
1321 | at32_select_gpio(data->wp_pin, 0); | ||
1322 | } | ||
1323 | 1323 | ||
1324 | atmel_mci0_pclk.dev = &pdev->dev; | 1324 | atmel_mci0_pclk.dev = &pdev->dev; |
1325 | 1325 | ||
@@ -1853,11 +1853,11 @@ at32_add_device_cf(unsigned int id, unsigned int extint, | |||
1853 | if (at32_init_ide_or_cf(pdev, data->cs, extint)) | 1853 | if (at32_init_ide_or_cf(pdev, data->cs, extint)) |
1854 | goto fail; | 1854 | goto fail; |
1855 | 1855 | ||
1856 | if (data->detect_pin != GPIO_PIN_NONE) | 1856 | if (gpio_is_valid(data->detect_pin)) |
1857 | at32_select_gpio(data->detect_pin, AT32_GPIOF_DEGLITCH); | 1857 | at32_select_gpio(data->detect_pin, AT32_GPIOF_DEGLITCH); |
1858 | if (data->reset_pin != GPIO_PIN_NONE) | 1858 | if (gpio_is_valid(data->reset_pin)) |
1859 | at32_select_gpio(data->reset_pin, 0); | 1859 | at32_select_gpio(data->reset_pin, 0); |
1860 | if (data->vcc_pin != GPIO_PIN_NONE) | 1860 | if (gpio_is_valid(data->vcc_pin)) |
1861 | at32_select_gpio(data->vcc_pin, 0); | 1861 | at32_select_gpio(data->vcc_pin, 0); |
1862 | /* READY is used as extint, so we can't select it as gpio */ | 1862 | /* READY is used as extint, so we can't select it as gpio */ |
1863 | 1863 | ||
@@ -1937,9 +1937,11 @@ static struct clk atmel_ac97c0_pclk = { | |||
1937 | .index = 10, | 1937 | .index = 10, |
1938 | }; | 1938 | }; |
1939 | 1939 | ||
1940 | struct platform_device *__init at32_add_device_ac97c(unsigned int id) | 1940 | struct platform_device *__init |
1941 | at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data) | ||
1941 | { | 1942 | { |
1942 | struct platform_device *pdev; | 1943 | struct platform_device *pdev; |
1944 | struct ac97c_platform_data _data; | ||
1943 | 1945 | ||
1944 | if (id != 0) | 1946 | if (id != 0) |
1945 | return NULL; | 1947 | return NULL; |
@@ -1950,19 +1952,37 @@ struct platform_device *__init at32_add_device_ac97c(unsigned int id) | |||
1950 | 1952 | ||
1951 | if (platform_device_add_resources(pdev, atmel_ac97c0_resource, | 1953 | if (platform_device_add_resources(pdev, atmel_ac97c0_resource, |
1952 | ARRAY_SIZE(atmel_ac97c0_resource))) | 1954 | ARRAY_SIZE(atmel_ac97c0_resource))) |
1953 | goto err_add_resources; | 1955 | goto fail; |
1956 | |||
1957 | if (!data) { | ||
1958 | data = &_data; | ||
1959 | memset(data, 0, sizeof(struct ac97c_platform_data)); | ||
1960 | data->reset_pin = GPIO_PIN_NONE; | ||
1961 | } | ||
1954 | 1962 | ||
1955 | select_peripheral(PB(20), PERIPH_B, 0); /* SYNC */ | 1963 | data->dma_rx_periph_id = 3; |
1956 | select_peripheral(PB(21), PERIPH_B, 0); /* SDO */ | 1964 | data->dma_tx_periph_id = 4; |
1957 | select_peripheral(PB(22), PERIPH_B, 0); /* SDI */ | 1965 | data->dma_controller_id = 0; |
1958 | select_peripheral(PB(23), PERIPH_B, 0); /* SCLK */ | 1966 | |
1967 | if (platform_device_add_data(pdev, data, | ||
1968 | sizeof(struct ac97c_platform_data))) | ||
1969 | goto fail; | ||
1970 | |||
1971 | select_peripheral(PB(20), PERIPH_B, 0); /* SDO */ | ||
1972 | select_peripheral(PB(21), PERIPH_B, 0); /* SYNC */ | ||
1973 | select_peripheral(PB(22), PERIPH_B, 0); /* SCLK */ | ||
1974 | select_peripheral(PB(23), PERIPH_B, 0); /* SDI */ | ||
1975 | |||
1976 | /* TODO: gpio_is_valid(data->reset_pin) with kernel 2.6.26. */ | ||
1977 | if (data->reset_pin != GPIO_PIN_NONE) | ||
1978 | at32_select_gpio(data->reset_pin, 0); | ||
1959 | 1979 | ||
1960 | atmel_ac97c0_pclk.dev = &pdev->dev; | 1980 | atmel_ac97c0_pclk.dev = &pdev->dev; |
1961 | 1981 | ||
1962 | platform_device_add(pdev); | 1982 | platform_device_add(pdev); |
1963 | return pdev; | 1983 | return pdev; |
1964 | 1984 | ||
1965 | err_add_resources: | 1985 | fail: |
1966 | platform_device_put(pdev); | 1986 | platform_device_put(pdev); |
1967 | return NULL; | 1987 | return NULL; |
1968 | } | 1988 | } |