Commit 3870ee8c authored by Richard Purdie's avatar Richard Purdie Committed by Linus Torvalds

[PATCH] Corgi: Add MMC/SD write protection switch handling

Add MMC/SD write protection switch handling for the Corgi platform
Signed-off-by: default avatarRichard Purdie <rpurdie@rpsys.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f7ceff34
...@@ -190,6 +190,11 @@ static void corgi_mci_setpower(struct device *dev, unsigned int vdd) ...@@ -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) static void corgi_mci_exit(struct device *dev, void *data)
{ {
free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data); free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
...@@ -199,6 +204,7 @@ static void corgi_mci_exit(struct device *dev, void *data) ...@@ -199,6 +204,7 @@ static void corgi_mci_exit(struct device *dev, void *data)
static struct pxamci_platform_data corgi_mci_platform_data = { static struct pxamci_platform_data corgi_mci_platform_data = {
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.init = corgi_mci_init, .init = corgi_mci_init,
.get_ro = corgi_mci_get_ro,
.setpower = corgi_mci_setpower, .setpower = corgi_mci_setpower,
.exit = corgi_mci_exit, .exit = corgi_mci_exit,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment