aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-u300/mmc.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/mach-u300/mmc.c
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'arch/arm/mach-u300/mmc.c')
-rw-r--r--arch/arm/mach-u300/mmc.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/mach-u300/mmc.c b/arch/arm/mach-u300/mmc.c
new file mode 100644
index 00000000000..677ccef5cd3
--- /dev/null
+++ b/arch/arm/mach-u300/mmc.c
@@ -0,0 +1,68 @@
1/*
2 *
3 * arch/arm/mach-u300/mmc.c
4 *
5 *
6 * Copyright (C) 2009 ST-Ericsson SA
7 * License terms: GNU General Public License (GPL) version 2
8 *
9 * Author: Linus Walleij <linus.walleij@stericsson.com>
10 * Author: Johan Lundin
11 * Author: Jonas Aaberg <jonas.aberg@stericsson.com>
12 */
13#include <linux/device.h>
14#include <linux/amba/bus.h>
15#include <linux/mmc/host.h>
16#include <linux/gpio.h>
17#include <linux/dmaengine.h>
18#include <linux/amba/mmci.h>
19#include <linux/slab.h>
20#include <mach/coh901318.h>
21#include <mach/dma_channels.h>
22
23#include "mmc.h"
24#include "padmux.h"
25
26static struct mmci_platform_data mmc0_plat_data = {
27 /*
28 * Do not set ocr_mask or voltage translation function,
29 * we have a regulator we can control instead.
30 */
31 /* Nominally 2.85V on our platform */
32 .f_max = 24000000,
33 .gpio_wp = -1,
34 .gpio_cd = U300_GPIO_PIN_MMC_CD,
35 .cd_invert = true,
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 */
42#endif
43};
44
45int __devinit mmc_init(struct amba_device *adev)
46{
47 struct device *mmcsd_device = &adev->dev;
48 struct pmx *pmx;
49 int ret = 0;
50
51 mmcsd_device->platform_data = &mmc0_plat_data;
52
53 /*
54 * Setup padmuxing for MMC. Since this must always be
55 * compiled into the kernel, pmx is never released.
56 */
57 pmx = pmx_get(mmcsd_device, U300_APP_PMX_MMC_SETTING);
58
59 if (IS_ERR(pmx))
60 pr_warning("Could not get padmux handle\n");
61 else {
62 ret = pmx_activate(mmcsd_device, pmx);
63 if (IS_ERR_VALUE(ret))
64 pr_warning("Could not activate padmuxing\n");
65 }
66
67 return ret;
68}