Skip to content

Commit

Permalink
[ARM] 4950/1: magician: enable MMC support
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Philipp Zabel authored and Russell King committed Apr 19, 2008
1 parent aa79759 commit bdb0c16
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
16 changes: 15 additions & 1 deletion arch/arm/configs/magician_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,21 @@ CONFIG_SND_PXA2XX_SOC=m
# CONFIG_HID_SUPPORT is not set
CONFIG_HID=m
# CONFIG_USB_SUPPORT is not set
# CONFIG_MMC is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
# CONFIG_MMC_UNSAFE_RESUME is not set

#
# MMC/SD Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_SDIO_UART=m

#
# MMC/SD Host Controller Drivers
#
CONFIG_MMC_PXA=y
# CONFIG_NEW_LEDS is not set
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
Expand Down
40 changes: 40 additions & 0 deletions arch/arm/mach-pxa/magician.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxafb.h>
#include <asm/arch/i2c.h>
#include <asm/arch/mmc.h>
#include <asm/arch/irda.h>
#include <asm/arch/ohci.h>

Expand Down Expand Up @@ -201,6 +202,44 @@ static struct platform_device backlight = {
};


/*
* MMC/SD
*/

static int magician_mci_init(struct device *dev,
irq_handler_t detect_irq, void *data)
{
return request_irq(IRQ_MAGICIAN_SD, detect_irq,
IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
"MMC card detect", data);
}

static void magician_mci_setpower(struct device *dev, unsigned int vdd)
{
struct pxamci_platform_data *pdata = dev->platform_data;

gpio_set_value(EGPIO_MAGICIAN_SD_POWER, (1 << vdd) & pdata->ocr_mask);
}

static int magician_mci_get_ro(struct device *dev)
{
return (!gpio_get_value(EGPIO_MAGICIAN_nSD_READONLY));
}

static void magician_mci_exit(struct device *dev, void *data)
{
free_irq(IRQ_MAGICIAN_SD, data);
}

static struct pxamci_platform_data magician_mci_info = {
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
.init = magician_mci_init,
.get_ro = magician_mci_get_ro,
.setpower = magician_mci_setpower,
.exit = magician_mci_exit,
};


/*
* USB OHCI
*/
Expand Down Expand Up @@ -267,6 +306,7 @@ static void __init magician_init(void)
{
platform_add_devices(devices, ARRAY_SIZE(devices));
pxa_set_i2c_info(NULL);
pxa_set_mci_info(&magician_mci_info);
pxa_set_ohci_info(&magician_ohci_info);
pxa_set_ficp_info(&magician_ficp_info);
set_pxa_fb_info(&toppoly_info);
Expand Down

0 comments on commit bdb0c16

Please sign in to comment.