1 Index: linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/arch/arm/mach-pxa/gumstix.c
4 +++ linux-2.6.21.7/arch/arm/mach-pxa/gumstix.c
9 -static int gumstix_mci_init(struct device *dev, irqreturn_t (*lubbock_detect_int)(int, void *, struct pt_regs *), void *data)
10 +static struct pxamci_platform_data gumstix_mci_platform_data;
12 +static int gumstix_mci_init(struct device *dev, irqreturn_t (*gumstix_detect_int)(int, void *, struct pt_regs *), void *data)
14 - // Set up MMC controller
17 pxa_gpio_mode(GPIO6_MMCCLK_MD);
18 pxa_gpio_mode(GPIO53_MMCCLK_MD);
19 pxa_gpio_mode(GPIO8_MMCCS0_MD);
21 + pxa_gpio_mode(GUMSTIX_GPIO_nSD_DETECT | GPIO_IN);
22 + set_irq_type(GUMSTIX_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
23 + pxa_gpio_mode(GUMSTIX_GPIO_nSD_WP | GPIO_IN);
25 + gumstix_mci_platform_data.detect_delay = msecs_to_jiffies(250);
27 + err = request_irq(GUMSTIX_IRQ_GPIO_nSD_DETECT, gumstix_detect_int, SA_INTERRUPT,
28 + "MMC card detect", data);
30 + printk(KERN_ERR "gumstix_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
34 + err = set_irq_type(GUMSTIX_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);
39 +static int gumstix_mci_get_ro(struct device *dev)
41 +#ifdef CONFIG_ARCH_GUMSTIX_VERDEX
42 + return 0; // microSD is always writable on verdex
45 + ro = GPLR(GUMSTIX_GPIO_nSD_WP) & GPIO_bit(GUMSTIX_GPIO_nSD_WP);
50 +static void gumstix_mci_exit(struct device *dev, void *data)
52 + free_irq(GUMSTIX_IRQ_GPIO_nSD_DETECT, data);
55 static struct pxamci_platform_data gumstix_mci_platform_data = {
56 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
57 - .init = &gumstix_mci_init,
58 + .init = gumstix_mci_init,
59 + .get_ro = gumstix_mci_get_ro,
60 + .exit = gumstix_mci_exit,
63 static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
64 Index: linux-2.6.21.7/include/asm-arm/arch-pxa/gumstix.h
65 ===================================================================
66 --- linux-2.6.21.7.orig/include/asm-arm/arch-pxa/gumstix.h
67 +++ linux-2.6.21.7/include/asm-arm/arch-pxa/gumstix.h
69 #define GPIO_GUMSTIX_USB_GPIOx_CON_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_OUT)
70 #define GPIO_GUMSTIX_USB_GPIOx_DIS_MD (GPIO_GUMSTIX_USB_GPIOx | GPIO_IN)
73 + * SD/MMC definitions
75 +#define GUMSTIX_GPIO_nSD_WP 22 /* SD Write Protect */
76 +#define GUMSTIX_GPIO_nSD_DETECT 11 /* MMC/SD Card Detect */
77 +#define GUMSTIX_IRQ_GPIO_nSD_DETECT IRQ_GPIO(GUMSTIX_GPIO_nSD_DETECT)
80 * SMC Ethernet definitions