3 * arch/arm/mach-u300/mmc.c
6 * Copyright (C) 2009 ST-Ericsson SA
7 * License terms: GNU General Public License (GPL) version 2
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Johan Lundin
11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
13 #include <linux/device.h>
14 #include <linux/amba/bus.h>
15 #include <linux/mmc/host.h>
16 #include <linux/dmaengine.h>
17 #include <linux/amba/mmci.h>
18 #include <linux/slab.h>
19 #include <mach/coh901318.h>
20 #include <mach/dma_channels.h>
21 #include <mach/gpio-u300.h>
26 static struct mmci_platform_data mmc0_plat_data
= {
28 * Do not set ocr_mask or voltage translation function,
29 * we have a regulator we can control instead.
31 /* Nominally 2.85V on our platform */
34 .gpio_cd
= U300_GPIO_PIN_MMC_CD
,
36 .capabilities
= MMC_CAP_MMC_HIGHSPEED
|
37 MMC_CAP_SD_HIGHSPEED
| MMC_CAP_4_BIT_DATA
| MMC_CAP_8_BIT_DATA
,
38 #ifdef CONFIG_COH901318
39 .dma_filter
= coh901318_filter_id
,
40 .dma_rx_param
= (void *) U300_DMA_MMCSD_RX_TX
,
41 /* Don't specify a TX channel, this RX channel is bidirectional */
45 int __devinit
mmc_init(struct amba_device
*adev
)
47 struct device
*mmcsd_device
= &adev
->dev
;
51 mmcsd_device
->platform_data
= &mmc0_plat_data
;
54 * Setup padmuxing for MMC. Since this must always be
55 * compiled into the kernel, pmx is never released.
57 pmx
= pmx_get(mmcsd_device
, U300_APP_PMX_MMC_SETTING
);
60 pr_warning("Could not get padmux handle\n");
62 ret
= pmx_activate(mmcsd_device
, pmx
);
63 if (IS_ERR_VALUE(ret
))
64 pr_warning("Could not activate padmuxing\n");