aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap700x.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-07-27 05:34:45 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-27 07:57:36 -0400
commit3c26e17032e42cfbe606882288223ad6146e4c38 (patch)
tree1c537eb20767ccbf4a7ab85063d2dca8ec03956c /arch/avr32/mach-at32ap/at32ap700x.c
parenteda3d8f5604860aae1bb9996bb5efc4213778369 (diff)
avr32: some mmc/sd cleanups
Minor cleanups for the MMC/SD support on avr32: - Make at32_add_device_mci() properly initialize "missing" platform data ... so boards like STK1002 won't try GPIO 0. - Switch over to gpio_is_valid() instead of testing for only one designated value. - Provide STK1002 platform data for the unlikely case that switches are set so first Ethernet controller isn't in use. (That's the only way to get card detect and writeprotect switch sensing on the STK1000.) And get rid of one "unused variable" warning. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 5f30b353a27f..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
@@ -1299,7 +1300,7 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1299 1300
1300 if (!data) { 1301 if (!data) {
1301 data = &_data; 1302 data = &_data;
1302 memset(data, 0, sizeof(struct mci_platform_data)); 1303 memset(data, -1, sizeof(struct mci_platform_data));
1303 data->detect_pin = GPIO_PIN_NONE; 1304 data->detect_pin = GPIO_PIN_NONE;
1304 data->wp_pin = GPIO_PIN_NONE; 1305 data->wp_pin = GPIO_PIN_NONE;
1305 } 1306 }
@@ -1315,9 +1316,9 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1315 select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */ 1316 select_peripheral(PA(14), PERIPH_A, 0); /* DATA2 */
1316 select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */ 1317 select_peripheral(PA(15), PERIPH_A, 0); /* DATA3 */
1317 1318
1318 if (data->detect_pin != GPIO_PIN_NONE) 1319 if (gpio_is_valid(data->detect_pin))
1319 at32_select_gpio(data->detect_pin, 0); 1320 at32_select_gpio(data->detect_pin, 0);
1320 if (data->wp_pin != GPIO_PIN_NONE) 1321 if (gpio_is_valid(data->wp_pin))
1321 at32_select_gpio(data->wp_pin, 0); 1322 at32_select_gpio(data->wp_pin, 0);
1322 1323
1323 atmel_mci0_pclk.dev = &pdev->dev; 1324 atmel_mci0_pclk.dev = &pdev->dev;
@@ -1852,11 +1853,11 @@ at32_add_device_cf(unsigned int id, unsigned int extint,
1852 if (at32_init_ide_or_cf(pdev, data->cs, extint)) 1853 if (at32_init_ide_or_cf(pdev, data->cs, extint))
1853 goto fail; 1854 goto fail;
1854 1855
1855 if (data->detect_pin != GPIO_PIN_NONE) 1856 if (gpio_is_valid(data->detect_pin))
1856 at32_select_gpio(data->detect_pin, AT32_GPIOF_DEGLITCH); 1857 at32_select_gpio(data->detect_pin, AT32_GPIOF_DEGLITCH);
1857 if (data->reset_pin != GPIO_PIN_NONE) 1858 if (gpio_is_valid(data->reset_pin))
1858 at32_select_gpio(data->reset_pin, 0); 1859 at32_select_gpio(data->reset_pin, 0);
1859 if (data->vcc_pin != GPIO_PIN_NONE) 1860 if (gpio_is_valid(data->vcc_pin))
1860 at32_select_gpio(data->vcc_pin, 0); 1861 at32_select_gpio(data->vcc_pin, 0);
1861 /* 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 */
1862 1863