From: Richard Purdie Date: Tue, 6 Sep 2005 22:19:07 +0000 (-0700) Subject: [PATCH] Corgi: Add MMC/SD write protection switch handling X-Git-Tag: v2.6.14-rc1~577 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3870ee8c63d5e55aea990654dfeb231264e13134;p=linux-2.6-omap-h63xx.git [PATCH] Corgi: Add MMC/SD write protection switch handling Add MMC/SD write protection switch handling for the Corgi platform Signed-off-by: Richard Purdie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 47da9fe57aa..29185acdd9e 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -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, };