diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 11:06:24 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 11:06:24 -0500 |
commit | 9265c6a186ca19a57ab6ddd0b0f3644f85c6f2f1 (patch) | |
tree | d8c434ea98ee541ee17f4df87bb8e9020ce29b98 /drivers/mmc/host | |
parent | 49ea7fc094162fcaa83f5876b2090c816cc4498c (diff) | |
parent | 6ba54ab4a49bbad736b0254aa6bdf0cb83013815 (diff) |
Merge branch 'omap/headers4' into next/cleanup
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/omap.c | 35 | ||||
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 4 |
2 files changed, 27 insertions, 12 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 48ad361613ef..ae115c01283b 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -28,9 +28,8 @@ | |||
28 | #include <linux/clk.h> | 28 | #include <linux/clk.h> |
29 | #include <linux/scatterlist.h> | 29 | #include <linux/scatterlist.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/platform_data/mmc-omap.h> | ||
31 | 32 | ||
32 | #include <plat/mmc.h> | ||
33 | #include <plat/dma.h> | ||
34 | 33 | ||
35 | #define OMAP_MMC_REG_CMD 0x00 | 34 | #define OMAP_MMC_REG_CMD 0x00 |
36 | #define OMAP_MMC_REG_ARGL 0x01 | 35 | #define OMAP_MMC_REG_ARGL 0x01 |
@@ -72,6 +71,13 @@ | |||
72 | #define OMAP_MMC_STAT_CARD_BUSY (1 << 2) | 71 | #define OMAP_MMC_STAT_CARD_BUSY (1 << 2) |
73 | #define OMAP_MMC_STAT_END_OF_CMD (1 << 0) | 72 | #define OMAP_MMC_STAT_END_OF_CMD (1 << 0) |
74 | 73 | ||
74 | #define mmc_omap7xx() (host->features & MMC_OMAP7XX) | ||
75 | #define mmc_omap15xx() (host->features & MMC_OMAP15XX) | ||
76 | #define mmc_omap16xx() (host->features & MMC_OMAP16XX) | ||
77 | #define MMC_OMAP1_MASK (MMC_OMAP7XX | MMC_OMAP15XX | MMC_OMAP16XX) | ||
78 | #define mmc_omap1() (host->features & MMC_OMAP1_MASK) | ||
79 | #define mmc_omap2() (!mmc_omap1()) | ||
80 | |||
75 | #define OMAP_MMC_REG(host, reg) (OMAP_MMC_REG_##reg << (host)->reg_shift) | 81 | #define OMAP_MMC_REG(host, reg) (OMAP_MMC_REG_##reg << (host)->reg_shift) |
76 | #define OMAP_MMC_READ(host, reg) __raw_readw((host)->virt_base + OMAP_MMC_REG(host, reg)) | 82 | #define OMAP_MMC_READ(host, reg) __raw_readw((host)->virt_base + OMAP_MMC_REG(host, reg)) |
77 | #define OMAP_MMC_WRITE(host, reg, val) __raw_writew((val), (host)->virt_base + OMAP_MMC_REG(host, reg)) | 83 | #define OMAP_MMC_WRITE(host, reg, val) __raw_writew((val), (host)->virt_base + OMAP_MMC_REG(host, reg)) |
@@ -84,6 +90,16 @@ | |||
84 | #define OMAP_MMC_CMDTYPE_AC 2 | 90 | #define OMAP_MMC_CMDTYPE_AC 2 |
85 | #define OMAP_MMC_CMDTYPE_ADTC 3 | 91 | #define OMAP_MMC_CMDTYPE_ADTC 3 |
86 | 92 | ||
93 | #define OMAP_DMA_MMC_TX 21 | ||
94 | #define OMAP_DMA_MMC_RX 22 | ||
95 | #define OMAP_DMA_MMC2_TX 54 | ||
96 | #define OMAP_DMA_MMC2_RX 55 | ||
97 | |||
98 | #define OMAP24XX_DMA_MMC2_TX 47 | ||
99 | #define OMAP24XX_DMA_MMC2_RX 48 | ||
100 | #define OMAP24XX_DMA_MMC1_TX 61 | ||
101 | #define OMAP24XX_DMA_MMC1_RX 62 | ||
102 | |||
87 | 103 | ||
88 | #define DRIVER_NAME "mmci-omap" | 104 | #define DRIVER_NAME "mmci-omap" |
89 | 105 | ||
@@ -147,6 +163,7 @@ struct mmc_omap_host { | |||
147 | u32 buffer_bytes_left; | 163 | u32 buffer_bytes_left; |
148 | u32 total_bytes_left; | 164 | u32 total_bytes_left; |
149 | 165 | ||
166 | unsigned features; | ||
150 | unsigned use_dma:1; | 167 | unsigned use_dma:1; |
151 | unsigned brs_received:1, dma_done:1; | 168 | unsigned brs_received:1, dma_done:1; |
152 | unsigned dma_in_use:1; | 169 | unsigned dma_in_use:1; |
@@ -988,7 +1005,7 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req) | |||
988 | * blocksize is at least that large. Blocksize is | 1005 | * blocksize is at least that large. Blocksize is |
989 | * usually 512 bytes; but not for some SD reads. | 1006 | * usually 512 bytes; but not for some SD reads. |
990 | */ | 1007 | */ |
991 | burst = cpu_is_omap15xx() ? 32 : 64; | 1008 | burst = mmc_omap15xx() ? 32 : 64; |
992 | if (burst > data->blksz) | 1009 | if (burst > data->blksz) |
993 | burst = data->blksz; | 1010 | burst = data->blksz; |
994 | 1011 | ||
@@ -1104,8 +1121,7 @@ static void mmc_omap_set_power(struct mmc_omap_slot *slot, int power_on, | |||
1104 | if (slot->pdata->set_power != NULL) | 1121 | if (slot->pdata->set_power != NULL) |
1105 | slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on, | 1122 | slot->pdata->set_power(mmc_dev(slot->mmc), slot->id, power_on, |
1106 | vdd); | 1123 | vdd); |
1107 | 1124 | if (mmc_omap2()) { | |
1108 | if (cpu_is_omap24xx()) { | ||
1109 | u16 w; | 1125 | u16 w; |
1110 | 1126 | ||
1111 | if (power_on) { | 1127 | if (power_on) { |
@@ -1239,7 +1255,7 @@ static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id) | |||
1239 | mmc->ops = &mmc_omap_ops; | 1255 | mmc->ops = &mmc_omap_ops; |
1240 | mmc->f_min = 400000; | 1256 | mmc->f_min = 400000; |
1241 | 1257 | ||
1242 | if (cpu_class_is_omap2()) | 1258 | if (mmc_omap2()) |
1243 | mmc->f_max = 48000000; | 1259 | mmc->f_max = 48000000; |
1244 | else | 1260 | else |
1245 | mmc->f_max = 24000000; | 1261 | mmc->f_max = 24000000; |
@@ -1359,6 +1375,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) | |||
1359 | init_waitqueue_head(&host->slot_wq); | 1375 | init_waitqueue_head(&host->slot_wq); |
1360 | 1376 | ||
1361 | host->pdata = pdata; | 1377 | host->pdata = pdata; |
1378 | host->features = host->pdata->slots[0].features; | ||
1362 | host->dev = &pdev->dev; | 1379 | host->dev = &pdev->dev; |
1363 | platform_set_drvdata(pdev, host); | 1380 | platform_set_drvdata(pdev, host); |
1364 | 1381 | ||
@@ -1391,7 +1408,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) | |||
1391 | host->dma_tx_burst = -1; | 1408 | host->dma_tx_burst = -1; |
1392 | host->dma_rx_burst = -1; | 1409 | host->dma_rx_burst = -1; |
1393 | 1410 | ||
1394 | if (cpu_is_omap24xx()) | 1411 | if (mmc_omap2()) |
1395 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; | 1412 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_TX : OMAP24XX_DMA_MMC2_TX; |
1396 | else | 1413 | else |
1397 | sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; | 1414 | sig = host->id == 0 ? OMAP_DMA_MMC_TX : OMAP_DMA_MMC2_TX; |
@@ -1407,7 +1424,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) | |||
1407 | dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", | 1424 | dev_warn(host->dev, "unable to obtain TX DMA engine channel %u\n", |
1408 | sig); | 1425 | sig); |
1409 | #endif | 1426 | #endif |
1410 | if (cpu_is_omap24xx()) | 1427 | if (mmc_omap2()) |
1411 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; | 1428 | sig = host->id == 0 ? OMAP24XX_DMA_MMC1_RX : OMAP24XX_DMA_MMC2_RX; |
1412 | else | 1429 | else |
1413 | sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; | 1430 | sig = host->id == 0 ? OMAP_DMA_MMC_RX : OMAP_DMA_MMC2_RX; |
@@ -1435,7 +1452,7 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) | |||
1435 | } | 1452 | } |
1436 | 1453 | ||
1437 | host->nr_slots = pdata->nr_slots; | 1454 | host->nr_slots = pdata->nr_slots; |
1438 | host->reg_shift = (cpu_is_omap7xx() ? 1 : 2); | 1455 | host->reg_shift = (mmc_omap7xx() ? 1 : 2); |
1439 | 1456 | ||
1440 | host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); | 1457 | host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); |
1441 | if (!host->mmc_omap_wq) | 1458 | if (!host->mmc_omap_wq) |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fedd258cc4ea..e7c185233b18 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -38,9 +38,7 @@ | |||
38 | #include <linux/gpio.h> | 38 | #include <linux/gpio.h> |
39 | #include <linux/regulator/consumer.h> | 39 | #include <linux/regulator/consumer.h> |
40 | #include <linux/pm_runtime.h> | 40 | #include <linux/pm_runtime.h> |
41 | #include <mach/hardware.h> | 41 | #include <linux/platform_data/mmc-omap.h> |
42 | #include <plat/mmc.h> | ||
43 | #include <plat/cpu.h> | ||
44 | 42 | ||
45 | /* OMAP HSMMC Host Controller Registers */ | 43 | /* OMAP HSMMC Host Controller Registers */ |
46 | #define OMAP_HSMMC_SYSSTATUS 0x0014 | 44 | #define OMAP_HSMMC_SYSSTATUS 0x0014 |