From 184d43c16080234353ea2036bb4e0b06ffb73afa Mon Sep 17 00:00:00 2001 From: Sonic Zhang Date: Wed, 8 Aug 2012 00:15:20 -0400 Subject: [PATCH] --- yaml --- r: 332801 b: refs/heads/master c: 7a8a43c46a4c91475ff93eb00897cbbc5ec98874 h: refs/heads/master i: 332799: 839ad0a459b6a3eb8cdbc0b24777253b75715720 v: v3 --- [refs] | 2 +- trunk/drivers/mmc/host/bfin_sdh.c | 35 +++++++++++++++++-------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 6b49953ac80d..989d69a18401 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c5e4a2e4c6fe47d88a1b172e54ed47a463f0ce45 +refs/heads/master: 7a8a43c46a4c91475ff93eb00897cbbc5ec98874 diff --git a/trunk/drivers/mmc/host/bfin_sdh.c b/trunk/drivers/mmc/host/bfin_sdh.c index 7776614fb2a5..b9b463eca1ec 100644 --- a/trunk/drivers/mmc/host/bfin_sdh.c +++ b/trunk/drivers/mmc/host/bfin_sdh.c @@ -505,6 +505,23 @@ static irqreturn_t sdh_stat_irq(int irq, void *devid) return IRQ_RETVAL(handled); } +static void sdh_reset(void) +{ +#if defined(CONFIG_BF54x) + /* Secure Digital Host shares DMA with Nand controller */ + bfin_write_DMAC1_PERIMUX(bfin_read_DMAC1_PERIMUX() | 0x1); +#endif + + bfin_write_SDH_CFG(bfin_read_SDH_CFG() | CLKS_EN); + SSYNC(); + + /* Disable card inserting detection pin. set MMC_CAP_NEEDS_POLL, and + * mmc stack will do the detection. + */ + bfin_write_SDH_CFG((bfin_read_SDH_CFG() & 0x1F) | (PUP_SDDAT | PUP_SDDAT3)); + SSYNC(); +} + static int __devinit sdh_probe(struct platform_device *pdev) { struct mmc_host *mmc; @@ -581,19 +598,8 @@ static int __devinit sdh_probe(struct platform_device *pdev) dev_err(&pdev->dev, "unable to request peripheral pins\n"); goto out4; } -#if defined(CONFIG_BF54x) - /* Secure Digital Host shares DMA with Nand controller */ - bfin_write_DMAC1_PERIMUX(bfin_read_DMAC1_PERIMUX() | 0x1); -#endif - bfin_write_SDH_CFG(bfin_read_SDH_CFG() | CLKS_EN); - SSYNC(); - - /* Disable card inserting detection pin. set MMC_CAP_NEEDS_POLL, and - * mmc stack will do the detection. - */ - bfin_write_SDH_CFG((bfin_read_SDH_CFG() & 0x1F) | (PUP_SDDAT | PUP_SDDAT3)); - SSYNC(); + sdh_reset(); mmc_add_host(mmc); return 0; @@ -660,10 +666,7 @@ static int sdh_resume(struct platform_device *dev) return ret; } -#if defined(CONFIG_BF54x) - /* Secure Digital Host shares DMA with Nand controller */ - bfin_write_DMAC1_PERIMUX(bfin_read_DMAC1_PERIMUX() | 0x1); -#endif + sdh_reset(); if (mmc) ret = mmc_resume_host(mmc);