diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-02 18:04:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-02 18:04:12 -0400 |
commit | a8c4c20dfa8b28a3c99e33c639d9c2ea5657741e (patch) | |
tree | 887b64d29b5a46d9ab2ca1267d8a2f05b5845561 /drivers/mmc | |
parent | 168d04b3b4de7723eb73b3cffc9cb75224e0f393 (diff) | |
parent | 2dc7667b9d0674db6572723356fe3857031101a4 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (44 commits)
[ARM] 3541/2: workaround for PXA27x erratum E7
[ARM] nommu: provide a way for correct control register value selection
[ARM] 3705/1: add supersection support to ioremap()
[ARM] 3707/1: iwmmxt: use the generic thread notifier infrastructure
[ARM] 3706/2: ep93xx: add cirrus logic edb9315a support
[ARM] 3704/1: format IOP Kconfig with tabs, create more consistency
[ARM] 3703/1: Add help description for ARCH_EP80219
[ARM] 3678/1: MMC: Make OMAP MMC work
[ARM] 3677/1: OMAP: Update H2 defconfig
[ARM] 3676/1: ARM: OMAP: Fix dmtimers and timer32k to compile on OMAP1
[ARM] Add section support to ioremap
[ARM] Fix sa11x0 SDRAM selection
[ARM] Set bit 4 on section mappings correctly depending on CPU
[ARM] 3666/1: TRIZEPS4 [1/5] core
ARM: OMAP: Multiplexing for 24xx GPMC wait pin monitoring
ARM: OMAP: Fix SRAM to use MT_MEMORY instead of MT_DEVICE
ARM: OMAP: Update dmtimers
ARM: OMAP: Make clock variables static
ARM: OMAP: Fix GPMC compilation when DEBUG is defined
ARM: OMAP: Mux updates for external DMA and GPIO
...
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/omap.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index e0e14b3423c6..ddf06b32c159 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c | |||
@@ -60,6 +60,7 @@ struct mmc_omap_host { | |||
60 | unsigned char id; /* 16xx chips have 2 MMC blocks */ | 60 | unsigned char id; /* 16xx chips have 2 MMC blocks */ |
61 | struct clk * iclk; | 61 | struct clk * iclk; |
62 | struct clk * fclk; | 62 | struct clk * fclk; |
63 | struct resource *res; | ||
63 | void __iomem *base; | 64 | void __iomem *base; |
64 | int irq; | 65 | int irq; |
65 | unsigned char bus_mode; | 66 | unsigned char bus_mode; |
@@ -339,8 +340,6 @@ static void | |||
339 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) | 340 | mmc_omap_xfer_data(struct mmc_omap_host *host, int write) |
340 | { | 341 | { |
341 | int n; | 342 | int n; |
342 | void __iomem *reg; | ||
343 | u16 *p; | ||
344 | 343 | ||
345 | if (host->buffer_bytes_left == 0) { | 344 | if (host->buffer_bytes_left == 0) { |
346 | host->sg_idx++; | 345 | host->sg_idx++; |
@@ -657,12 +656,12 @@ static void mmc_omap_dma_cb(int lch, u16 ch_status, void *data) | |||
657 | struct mmc_data *mmcdat = host->data; | 656 | struct mmc_data *mmcdat = host->data; |
658 | 657 | ||
659 | if (unlikely(host->dma_ch < 0)) { | 658 | if (unlikely(host->dma_ch < 0)) { |
660 | dev_err(mmc_dev(host->mmc), "DMA callback while DMA not | 659 | dev_err(mmc_dev(host->mmc), |
661 | enabled\n"); | 660 | "DMA callback while DMA not enabled\n"); |
662 | return; | 661 | return; |
663 | } | 662 | } |
664 | /* FIXME: We really should do something to _handle_ the errors */ | 663 | /* FIXME: We really should do something to _handle_ the errors */ |
665 | if (ch_status & OMAP_DMA_TOUT_IRQ) { | 664 | if (ch_status & OMAP1_DMA_TOUT_IRQ) { |
666 | dev_err(mmc_dev(host->mmc),"DMA timeout\n"); | 665 | dev_err(mmc_dev(host->mmc),"DMA timeout\n"); |
667 | return; | 666 | return; |
668 | } | 667 | } |
@@ -972,20 +971,20 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
972 | struct omap_mmc_conf *minfo = pdev->dev.platform_data; | 971 | struct omap_mmc_conf *minfo = pdev->dev.platform_data; |
973 | struct mmc_host *mmc; | 972 | struct mmc_host *mmc; |
974 | struct mmc_omap_host *host = NULL; | 973 | struct mmc_omap_host *host = NULL; |
974 | struct resource *r; | ||
975 | int ret = 0; | 975 | int ret = 0; |
976 | int irq; | ||
976 | 977 | ||
977 | if (platform_get_resource(pdev, IORESOURCE_MEM, 0) || | 978 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
978 | platform_get_irq(pdev, IORESOURCE_IRQ, 0)) { | 979 | irq = platform_get_irq(pdev, 0); |
979 | dev_err(&pdev->dev, "mmc_omap_probe: invalid resource type\n"); | 980 | if (!r || irq < 0) |
980 | return -ENODEV; | 981 | return -ENXIO; |
981 | } | ||
982 | 982 | ||
983 | if (!request_mem_region(pdev->resource[0].start, | 983 | r = request_mem_region(pdev->resource[0].start, |
984 | pdev->resource[0].end - pdev->resource[0].start + 1, | 984 | pdev->resource[0].end - pdev->resource[0].start + 1, |
985 | pdev->name)) { | 985 | pdev->name); |
986 | dev_dbg(&pdev->dev, "request_mem_region failed\n"); | 986 | if (!r) |
987 | return -EBUSY; | 987 | return -EBUSY; |
988 | } | ||
989 | 988 | ||
990 | mmc = mmc_alloc_host(sizeof(struct mmc_omap_host), &pdev->dev); | 989 | mmc = mmc_alloc_host(sizeof(struct mmc_omap_host), &pdev->dev); |
991 | if (!mmc) { | 990 | if (!mmc) { |
@@ -1002,6 +1001,8 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
1002 | host->dma_timer.data = (unsigned long) host; | 1001 | host->dma_timer.data = (unsigned long) host; |
1003 | 1002 | ||
1004 | host->id = pdev->id; | 1003 | host->id = pdev->id; |
1004 | host->res = r; | ||
1005 | host->irq = irq; | ||
1005 | 1006 | ||
1006 | if (cpu_is_omap24xx()) { | 1007 | if (cpu_is_omap24xx()) { |
1007 | host->iclk = clk_get(&pdev->dev, "mmc_ick"); | 1008 | host->iclk = clk_get(&pdev->dev, "mmc_ick"); |
@@ -1031,13 +1032,9 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
1031 | host->dma_ch = -1; | 1032 | host->dma_ch = -1; |
1032 | 1033 | ||
1033 | host->irq = pdev->resource[1].start; | 1034 | host->irq = pdev->resource[1].start; |
1034 | host->base = ioremap(pdev->res.start, SZ_4K); | 1035 | host->base = (void __iomem*)IO_ADDRESS(r->start); |
1035 | if (!host->base) { | ||
1036 | ret = -ENOMEM; | ||
1037 | goto out; | ||
1038 | } | ||
1039 | 1036 | ||
1040 | if (minfo->wire4) | 1037 | if (minfo->wire4) |
1041 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 1038 | mmc->caps |= MMC_CAP_4_BIT_DATA; |
1042 | 1039 | ||
1043 | mmc->ops = &mmc_omap_ops; | 1040 | mmc->ops = &mmc_omap_ops; |
@@ -1056,8 +1053,8 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
1056 | 1053 | ||
1057 | if (host->power_pin >= 0) { | 1054 | if (host->power_pin >= 0) { |
1058 | if ((ret = omap_request_gpio(host->power_pin)) != 0) { | 1055 | if ((ret = omap_request_gpio(host->power_pin)) != 0) { |
1059 | dev_err(mmc_dev(host->mmc), "Unable to get GPIO | 1056 | dev_err(mmc_dev(host->mmc), |
1060 | pin for MMC power\n"); | 1057 | "Unable to get GPIO pin for MMC power\n"); |
1061 | goto out; | 1058 | goto out; |
1062 | } | 1059 | } |
1063 | omap_set_gpio_direction(host->power_pin, 0); | 1060 | omap_set_gpio_direction(host->power_pin, 0); |
@@ -1099,7 +1096,7 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
1099 | device_remove_file(&pdev->dev, &dev_attr_cover_switch); | 1096 | device_remove_file(&pdev->dev, &dev_attr_cover_switch); |
1100 | } | 1097 | } |
1101 | if (ret) { | 1098 | if (ret) { |
1102 | dev_wan(mmc_dev(host->mmc), "Unable to create sysfs attributes\n"); | 1099 | dev_warn(mmc_dev(host->mmc), "Unable to create sysfs attributes\n"); |
1103 | free_irq(OMAP_GPIO_IRQ(host->switch_pin), host); | 1100 | free_irq(OMAP_GPIO_IRQ(host->switch_pin), host); |
1104 | omap_free_gpio(host->switch_pin); | 1101 | omap_free_gpio(host->switch_pin); |
1105 | host->switch_pin = -1; | 1102 | host->switch_pin = -1; |