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/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 22 #include "u300-gpio.h" 23 #include "mmc.h" 24 25 static struct mmci_platform_data mmc0_plat_data = { 26 /* 27 * Do not set ocr_mask or voltage translation function, 28 * we have a regulator we can control instead. 29 */ 30 /* Nominally 2.85V on our platform */ 31 .f_max = 24000000, 32 .gpio_wp = -1, 33 .gpio_cd = U300_GPIO_PIN_MMC_CD, 34 .cd_invert = true, 35 .capabilities = MMC_CAP_MMC_HIGHSPEED | 36 MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 37 #ifdef CONFIG_COH901318 38 .dma_filter = coh901318_filter_id, 39 .dma_rx_param = (void *) U300_DMA_MMCSD_RX_TX, 40 /* Don't specify a TX channel, this RX channel is bidirectional */ 41 #endif 42 }; 43 mmc_init(struct amba_device * adev)44int __devinit mmc_init(struct amba_device *adev) 45 { 46 struct device *mmcsd_device = &adev->dev; 47 int ret = 0; 48 49 mmcsd_device->platform_data = &mmc0_plat_data; 50 51 return ret; 52 } 53