From 00b34deba4c57b7754d9c058a483898c35d76212 Mon Sep 17 00:00:00 2001 From: lintao Date: Mon, 7 Jul 2014 16:41:49 +0800 Subject: [PATCH] mmc: host: rk_sdmmc: prepare for next Soc(s) fix edma slave config phy regs --- drivers/mmc/host/dw_mmc-pltfm.c | 3 +++ drivers/mmc/host/rk_sdmmc.c | 4 ++-- include/linux/mmc/rk_mmc.h | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c index 93fc6a725dba..527b2c8d86fd 100755 --- a/drivers/mmc/host/dw_mmc-pltfm.c +++ b/drivers/mmc/host/dw_mmc-pltfm.c @@ -49,6 +49,9 @@ int dw_mci_pltfm_register(struct platform_device *pdev, host->irq_flags = 0; host->pdata = pdev->dev.platform_data; host->regs = devm_ioremap_resource(&pdev->dev, regs); + #ifdef CONFIG_MMC_DW_EDMAC + host->phy_regs = (void *)(regs->start); + #endif if (IS_ERR(host->regs)) return PTR_ERR(host->regs); diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 634e88644f5c..1bba0bfd8377 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -618,7 +618,7 @@ static void dw_mci_edmac_start_dma(struct dw_mci *host, unsigned int sg_len) int ret = 0; /* Set external dma config: burst size, burst width*/ - slave_config.dst_addr = (dma_addr_t)(host->regs + host->data_offset); + slave_config.dst_addr = (dma_addr_t)(host->phy_regs + host->data_offset); slave_config.src_addr = slave_config.dst_addr; slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; slave_config.src_addr_width = slave_config.dst_addr_width; @@ -678,6 +678,7 @@ static int dw_mci_edmac_init(struct dw_mci *host) (unsigned int)(rockchip_soc_id & ROCKCHIP_CPU_MASK), mmc_hostname(host->mmc)); /* 1) request external dma channel, SHOULD decide chn in dts */ + host->dms = (struct dw_mci_dma_slave *)kmalloc(sizeof(struct dw_mci_dma_slave),GFP_KERNEL); host->dms->ch = dma_request_slave_channel(host->dev, "dw_mci"); if (!host->dms->ch){ dev_err(host->dev, "Failed to get external DMA channel: channel id = %d\n", @@ -1493,7 +1494,6 @@ static int dw_mci_get_cd(struct mmc_host *mmc) else present = (mci_readl(slot->host, CDETECT) & (1 << slot->id)) == 0 ? 1 : 0; - spin_lock_bh(&host->lock); if (present) { set_bit(DW_MMC_CARD_PRESENT, &slot->flags); diff --git a/include/linux/mmc/rk_mmc.h b/include/linux/mmc/rk_mmc.h index abf91d0e9d86..a54c31dab5d0 100755 --- a/include/linux/mmc/rk_mmc.h +++ b/include/linux/mmc/rk_mmc.h @@ -157,6 +157,7 @@ struct dw_mci { #ifdef CONFIG_MMC_DW_EDMAC struct dw_mci_dma_slave *dms; + void *phy_regs; #endif u32 cmd_status; u32 data_status; -- 2.34.1