1 --- a/arch/arm/mach-pxa/gumstix.c
2 +++ b/arch/arm/mach-pxa/gumstix.c
7 -static int gumstix_mci_init(struct device *dev, irqreturn_t (*lubbock_detect_int)(int, void *, struct pt_regs *), void *data)
8 +static struct pxamci_platform_data gumstix_mci_platform_data;
10 +static int gumstix_mci_init(struct device *dev, irqreturn_t (*gumstix_detect_int)(int, void *, struct pt_regs *), void *data)
12 - // Set up MMC controller
15 pxa_gpio_mode(GPIO6_MMCCLK_MD);
16 pxa_gpio_mode(GPIO53_MMCCLK_MD);
17 pxa_gpio_mode(GPIO8_MMCCS0_MD);
19 + pxa_gpio_mode(GUMSTIX_GPIO_nSD_DETECT | GPIO_IN);
20 + set_irq_type(GUMSTIX_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
21 + pxa_gpio_mode(GUMSTIX_GPIO_nSD_WP | GPIO_IN);
23 + gumstix_mci_platform_data.detect_delay = msecs_to_jiffies(250);
25 + err = request_irq(GUMSTIX_IRQ_GPIO_nSD_DETECT, gumstix_detect_int, SA_INTERRUPT,
26 + "MMC card detect", data);
28 + printk(KERN_ERR "gumstix_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
32 + err = set_irq_type(GUMSTIX_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
37 +static int gumstix_mci_get_ro(struct device *dev)
39 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
40 + return 0; // microSD is always writable on verdex
43 + ro = GPLR(GUMSTIX_GPIO_nSD_WP) & GPIO_bit(GUMSTIX_GPIO_nSD_WP);
48 +static void gumstix_mci_exit(struct device *dev, void *data)
50 + free_irq(GUMSTIX_IRQ_GPIO_nSD_DETECT, data);
53 static struct pxamci_platform_data gumstix_mci_platform_data = {
54 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
55 - .init = &gumstix_mci_init,
56 + .init = gumstix_mci_init,
57 + .get_ro = gumstix_mci_get_ro,
58 + .exit = gumstix_mci_exit,
61 static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
62 --- a/include/asm-arm/arch-pxa/gumstix.h
63 +++ b/include/asm-arm/arch-pxa/gumstix.h
65 #define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
66 #define GPIO_GUMSTIX_USB_GPIOx_DIS_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
69 + * SD/MMC definitions
71 +#define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */
72 +#define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */
73 +#define GUMSTIX_IRQ_GPIO_nSD_DETECT IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
76 * SMC Ethernet definitions