Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
avr32: some mmc/sd cleanups
include/video/atmel_lcdc.h must #include <linux/workqueue.h>
avr32: allow system timer to share interrupt to make OProfile work
drivers/misc/atmel-ssc.c: Removed duplicated include
avr32: Add platform data for AC97C platform device
avr32: clean up mci platform code
fix avr32 build errors

+81 -32
+18 -1
arch/avr32/boards/atstk1000/atstk1002.c
··· 21 21 22 22 #include <asm/io.h> 23 23 #include <asm/setup.h> 24 + #include <asm/atmel-mci.h> 25 + 24 26 #include <asm/arch/at32ap700x.h> 25 27 #include <asm/arch/board.h> 26 28 #include <asm/arch/init.h> ··· 262 260 at32_setup_serial_console(0); 263 261 } 264 262 263 + #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 264 + 265 + /* MMC card detect requires MACB0 *NOT* be used */ 266 + #ifdef CONFIG_BOARD_ATSTK1002_SW6_CUSTOM 267 + static struct mci_platform_data __initdata mci0_data = { 268 + .detect_pin = GPIO_PIN_PC(14), /* gpio30/sdcd */ 269 + .wp_pin = GPIO_PIN_PC(15), /* gpio31/sdwp */ 270 + }; 271 + #define MCI_PDATA &mci0_data 272 + #else 273 + #define MCI_PDATA NULL 274 + #endif /* SW6 for sd{cd,wp} routing */ 275 + 276 + #endif /* SW2 for MMC signal routing */ 277 + 265 278 static int __init atstk1002_init(void) 266 279 { 267 280 /* ··· 326 309 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); 327 310 #endif 328 311 #ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM 329 - at32_add_device_mci(0, NULL); 312 + at32_add_device_mci(0, MCI_PDATA); 330 313 #endif 331 314 #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM 332 315 set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
+1 -1
arch/avr32/boards/atstk1000/atstk1003.c
··· 154 154 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); 155 155 #endif 156 156 #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 157 - at32_add_device_mci(0); 157 + at32_add_device_mci(0, NULL); 158 158 #endif 159 159 at32_add_device_usba(0, NULL); 160 160 #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM
+1 -1
arch/avr32/boards/atstk1000/atstk1004.c
··· 137 137 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); 138 138 #endif 139 139 #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 140 - at32_add_device_mci(0); 140 + at32_add_device_mci(0, NULL); 141 141 #endif 142 142 at32_add_device_lcdc(0, &atstk1000_lcdc_data, 143 143 fbmem_start, fbmem_size, 0);
+5 -1
arch/avr32/kernel/time.c
··· 43 43 { 44 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 50 * Disable the interrupt until the clockevent subsystem 48 51 * reprograms it. ··· 58 55 59 56 static struct irqaction timer_irqaction = { 60 57 .handler = timer_interrupt, 61 - .flags = IRQF_TIMER | IRQF_DISABLED, 58 + /* Oprofile uses the same irq as the timer, so allow it to be shared */ 59 + .flags = IRQF_TIMER | IRQF_DISABLED | IRQF_SHARED, 62 60 .name = "avr32_comparator", 63 61 }; 64 62
+38 -18
arch/avr32/mach-at32ap/at32ap700x.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 14 #include <linux/dma-mapping.h> 15 + #include <linux/gpio.h> 15 16 #include <linux/spi/spi.h> 16 17 #include <linux/usb/atmel_usba_udc.h> 17 18 ··· 1286 1285 { 1287 1286 struct mci_platform_data _data; 1288 1287 struct platform_device *pdev; 1289 - struct dw_dma_slave *dws; 1290 1288 1291 1289 if (id != 0) 1292 1290 return NULL; ··· 1300 1300 1301 1301 if (!data) { 1302 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 1308 if (platform_device_add_data(pdev, data, ··· 1316 1314 select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */ 1317 1315 select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */ 1318 1316 1319 - if (data) { 1320 - if (data->detect_pin != GPIO_PIN_NONE) 1321 - at32_select_gpio(data->detect_pin, 0); 1322 - if (data->wp_pin != GPIO_PIN_NONE) 1323 - at32_select_gpio(data->wp_pin, 0); 1324 - } 1317 + if (gpio_is_valid(data->detect_pin)) 1318 + at32_select_gpio(data->detect_pin, 0); 1319 + if (gpio_is_valid(data->wp_pin)) 1320 + at32_select_gpio(data->wp_pin, 0); 1325 1321 1326 1322 atmel_mci0_pclk.dev = &pdev->dev; 1327 1323 ··· 1853 1853 if (at32_init_ide_or_cf(pdev, data->cs, extint)) 1854 1854 goto fail; 1855 1855 1856 - if (data->detect_pin != GPIO_PIN_NONE) 1856 + if (gpio_is_valid(data->detect_pin)) 1857 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 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 1861 at32_select_gpio(data->vcc_pin, 0); 1862 1862 /* READY is used as extint, so we can't select it as gpio */ 1863 1863 ··· 1937 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 1943 struct platform_device *pdev; 1944 + struct ac97c_platform_data _data; 1943 1945 1944 1946 if (id != 0) 1945 1947 return NULL; ··· 1952 1950 1953 1951 if (platform_device_add_resources(pdev, atmel_ac97c0_resource, 1954 1952 ARRAY_SIZE(atmel_ac97c0_resource))) 1955 - goto err_add_resources; 1953 + goto fail; 1956 1954 1957 - select_peripheral(PB(20), PERIPH_B, 0); /* SYNC */ 1958 - select_peripheral(PB(21), PERIPH_B, 0); /* SDO */ 1959 - select_peripheral(PB(22), PERIPH_B, 0); /* SDI */ 1960 - select_peripheral(PB(23), PERIPH_B, 0); /* SCLK */ 1955 + if (!data) { 1956 + data = &_data; 1957 + memset(data, 0, sizeof(struct ac97c_platform_data)); 1958 + data->reset_pin = GPIO_PIN_NONE; 1959 + } 1960 + 1961 + data->dma_rx_periph_id = 3; 1962 + data->dma_tx_periph_id = 4; 1963 + data->dma_controller_id = 0; 1964 + 1965 + if (platform_device_add_data(pdev, data, 1966 + sizeof(struct ac97c_platform_data))) 1967 + goto fail; 1968 + 1969 + select_peripheral(PB(20), PERIPH_B, 0); /* SDO */ 1970 + select_peripheral(PB(21), PERIPH_B, 0); /* SYNC */ 1971 + select_peripheral(PB(22), PERIPH_B, 0); /* SCLK */ 1972 + select_peripheral(PB(23), PERIPH_B, 0); /* SDI */ 1973 + 1974 + /* TODO: gpio_is_valid(data->reset_pin) with kernel 2.6.26. */ 1975 + if (data->reset_pin != GPIO_PIN_NONE) 1976 + at32_select_gpio(data->reset_pin, 0); 1961 1977 1962 1978 atmel_ac97c0_pclk.dev = &pdev->dev; 1963 1979 1964 1980 platform_device_add(pdev); 1965 1981 return pdev; 1966 1982 1967 - err_add_resources: 1983 + fail: 1968 1984 platform_device_put(pdev); 1969 1985 return NULL; 1970 1986 }
-1
drivers/misc/atmel-ssc.c
··· 13 13 #include <linux/clk.h> 14 14 #include <linux/err.h> 15 15 #include <linux/io.h> 16 - #include <linux/list.h> 17 16 #include <linux/spinlock.h> 18 17 #include <linux/atmel-ssc.h> 19 18
+9 -8
drivers/mmc/host/atmel-mci.c
··· 11 11 #include <linux/clk.h> 12 12 #include <linux/debugfs.h> 13 13 #include <linux/device.h> 14 + #include <linux/err.h> 15 + #include <linux/gpio.h> 14 16 #include <linux/init.h> 15 17 #include <linux/interrupt.h> 16 18 #include <linux/ioport.h> ··· 29 27 #include <asm/unaligned.h> 30 28 31 29 #include <asm/arch/board.h> 32 - #include <asm/arch/gpio.h> 33 30 34 31 #include "atmel-mci-regs.h" 35 32 ··· 574 573 int read_only = 0; 575 574 struct atmel_mci *host = mmc_priv(mmc); 576 575 577 - if (host->wp_pin >= 0) { 576 + if (gpio_is_valid(host->wp_pin)) { 578 577 read_only = gpio_get_value(host->wp_pin); 579 578 dev_dbg(&mmc->class_dev, "card is %s\n", 580 579 read_only ? "read-only" : "read-write"); ··· 636 635 * been freed. 637 636 */ 638 637 smp_rmb(); 639 - if (host->detect_pin < 0) 638 + if (!gpio_is_valid(host->detect_pin)) 640 639 return; 641 640 642 641 enable_irq(gpio_to_irq(host->detect_pin)); ··· 1051 1050 1052 1051 /* Assume card is present if we don't have a detect pin */ 1053 1052 host->present = 1; 1054 - if (host->detect_pin >= 0) { 1053 + if (gpio_is_valid(host->detect_pin)) { 1055 1054 if (gpio_request(host->detect_pin, "mmc_detect")) { 1056 1055 dev_dbg(&mmc->class_dev, "no detect pin available\n"); 1057 1056 host->detect_pin = -1; ··· 1059 1058 host->present = !gpio_get_value(host->detect_pin); 1060 1059 } 1061 1060 } 1062 - if (host->wp_pin >= 0) { 1061 + if (gpio_is_valid(host->wp_pin)) { 1063 1062 if (gpio_request(host->wp_pin, "mmc_wp")) { 1064 1063 dev_dbg(&mmc->class_dev, "no WP pin available\n"); 1065 1064 host->wp_pin = -1; ··· 1070 1069 1071 1070 mmc_add_host(mmc); 1072 1071 1073 - if (host->detect_pin >= 0) { 1072 + if (gpio_is_valid(host->detect_pin)) { 1074 1073 setup_timer(&host->detect_timer, atmci_detect_change, 1075 1074 (unsigned long)host); 1076 1075 ··· 1113 1112 if (host) { 1114 1113 /* Debugfs stuff is cleaned up by mmc core */ 1115 1114 1116 - if (host->detect_pin >= 0) { 1115 + if (gpio_is_valid(host->detect_pin)) { 1117 1116 int pin = host->detect_pin; 1118 1117 1119 1118 /* Make sure the timer doesn't enable the interrupt */ ··· 1133 1132 mci_readl(host, SR); 1134 1133 clk_disable(host->mck); 1135 1134 1136 - if (host->wp_pin >= 0) 1135 + if (gpio_is_valid(host->wp_pin)) 1137 1136 gpio_free(host->wp_pin); 1138 1137 1139 1138 free_irq(platform_get_irq(pdev, 0), host->mmc);
+9 -1
include/asm-avr32/arch-at32ap/board.h
··· 82 82 struct platform_device * 83 83 at32_add_device_mci(unsigned int id, struct mci_platform_data *data); 84 84 85 - struct platform_device *at32_add_device_ac97c(unsigned int id); 85 + struct ac97c_platform_data { 86 + unsigned short dma_rx_periph_id; 87 + unsigned short dma_tx_periph_id; 88 + unsigned short dma_controller_id; 89 + int reset_pin; 90 + }; 91 + struct platform_device * 92 + at32_add_device_ac97c(unsigned int id, struct ac97c_platform_data *data); 93 + 86 94 struct platform_device *at32_add_device_abdac(unsigned int id); 87 95 struct platform_device *at32_add_device_psif(unsigned int id); 88 96