diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 14:45:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 14:45:16 -0500 |
commit | 8287361abca36504da813638310d2547469283eb (patch) | |
tree | 8d98e9a910885efdb09ae5390a3ae44040557e2f /drivers/mmc/host/omap.c | |
parent | 2989950cea13711f0cc573c26cde8fe08a36be03 (diff) | |
parent | 8556650dd3370a927217f16444aac5cc0c71e61b (diff) |
Merge tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC Header cleanups from Olof Johansson:
"This is a collection of header file cleanups, mostly for OMAP and
AT91, that keeps moving the platforms in the direction of
multiplatform by removing the need for mach-dependent header files
used in drivers and other places."
Fix up mostly trivial conflicts as per Olof.
* tag 'headers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (106 commits)
ARM: OMAP2+: Move iommu/iovmm headers to platform_data
ARM: OMAP2+: Make some definitions local
ARM: OMAP2+: Move iommu2 to drivers/iommu/omap-iommu2.c
ARM: OMAP2+: Move plat/iovmm.h to include/linux/omap-iommu.h
ARM: OMAP2+: Move iopgtable header to drivers/iommu/
ARM: OMAP: Merge iommu2.h into iommu.h
atmel: move ATMEL_MAX_UART to platform_data/atmel.h
ARM: OMAP: Remove omap_init_consistent_dma_size()
arm: at91: move at91rm9200 rtc header in drivers/rtc
arm: at91: move reset controller header to arm/arm/mach-at91
arm: at91: move pit define to the driver
arm: at91: move at91_shdwc.h to arch/arm/mach-at91
arm: at91: move board header to arch/arm/mach-at91
arn: at91: move at91_tc.h to arch/arm/mach-at91
arm: at91 move at91_aic.h to arch/arm/mach-at91
arm: at91 move board.h to arch/arm/mach-at91
arm: at91: move platfarm_data to include/linux/platform_data/atmel.h
arm: at91: drop machine defconfig
ARM: OMAP: Remove NEED_MACH_GPIO_H
ARM: OMAP: Remove unnecessary mach and plat includes
...
Diffstat (limited to 'drivers/mmc/host/omap.c')
-rw-r--r-- | drivers/mmc/host/omap.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 4e749ab690c8..4254975f931d 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 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 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 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 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 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) |