]> err.no Git - linux-2.6/commitdiff
[PATCH] Corgi: Add MMC/SD write protection switch handling
authorRichard Purdie <rpurdie@rpsys.net>
Tue, 6 Sep 2005 22:19:07 +0000 (15:19 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 7 Sep 2005 23:57:54 +0000 (16:57 -0700)
Add MMC/SD write protection switch handling for the Corgi platform

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/arm/mach-pxa/corgi.c

index 47da9fe57aa651bb4e1cd7788ab48406d8766f5a..29185acdd9e1ea7e6eb7a8f9182e18bac37f35b1 100644 (file)
@@ -190,6 +190,11 @@ static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
        }
 }
 
+static int corgi_mci_get_ro(struct device *dev)
+{
+       return GPLR(CORGI_GPIO_nSD_WP) & GPIO_bit(CORGI_GPIO_nSD_WP);
+}
+
 static void corgi_mci_exit(struct device *dev, void *data)
 {
        free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
@@ -199,6 +204,7 @@ static void corgi_mci_exit(struct device *dev, void *data)
 static struct pxamci_platform_data corgi_mci_platform_data = {
        .ocr_mask       = MMC_VDD_32_33|MMC_VDD_33_34,
        .init           = corgi_mci_init,
+       .get_ro         = corgi_mci_get_ro,
        .setpower       = corgi_mci_setpower,
        .exit           = corgi_mci_exit,
 };