Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * arch/arm/mach-u300/mmc.c |
| 4 | * |
| 5 | * |
Linus Walleij | ec8f125 | 2010-08-13 11:31:59 +0200 | [diff] [blame] | 6 | * Copyright (C) 2009 ST-Ericsson SA |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 7 | * License terms: GNU General Public License (GPL) version 2 |
| 8 | * |
| 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> |
Linus Walleij | ec8f125 | 2010-08-13 11:31:59 +0200 | [diff] [blame] | 10 | * Author: Johan Lundin |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 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> |
Linus Walleij | ec8f125 | 2010-08-13 11:31:59 +0200 | [diff] [blame] | 16 | #include <linux/dmaengine.h> |
Linus Walleij | 6ef297f | 2009-09-22 14:29:36 +0100 | [diff] [blame] | 17 | #include <linux/amba/mmci.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 18 | #include <linux/slab.h> |
Linus Walleij | ec8f125 | 2010-08-13 11:31:59 +0200 | [diff] [blame] | 19 | #include <mach/coh901318.h> |
| 20 | #include <mach/dma_channels.h> |
Linus Walleij | eb3cf18 | 2011-08-22 08:34:26 +0100 | [diff] [blame] | 21 | #include <mach/gpio-u300.h> |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 22 | |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 23 | #include "mmc.h" |
| 24 | |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 25 | static struct mmci_platform_data mmc0_plat_data = { |
Linus Walleij | f9e8eef | 2009-09-24 21:42:44 +0100 | [diff] [blame] | 26 | /* |
| 27 | * Do not set ocr_mask or voltage translation function, |
| 28 | * we have a regulator we can control instead. |
| 29 | */ |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 30 | /* Nominally 2.85V on our platform */ |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 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, |
Linus Walleij | ec8f125 | 2010-08-13 11:31:59 +0200 | [diff] [blame] | 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 |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 42 | }; |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 43 | |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 44 | int __devinit mmc_init(struct amba_device *adev) |
| 45 | { |
| 46 | struct device *mmcsd_device = &adev->dev; |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 47 | int ret = 0; |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 48 | |
Linus Walleij | 1a72185 | 2011-02-02 14:41:19 +0100 | [diff] [blame] | 49 | mmcsd_device->platform_data = &mmc0_plat_data; |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 50 | |
Linus Walleij | bb3cee2 | 2009-04-23 10:22:13 +0100 | [diff] [blame] | 51 | return ret; |
| 52 | } |