Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312834
b: refs/heads/master
c: e480606
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jul 21, 2012
1 parent 352ff66 commit c1e4a2f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9adcc12860d76cf3401c6ab7c0406b15b356b7a
refs/heads/master: e480606ad43bb72fd82a9bd99cdcf21829a6e9c0
18 changes: 18 additions & 0 deletions trunk/drivers/mmc/host/sh_mmcif.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include <linux/mmc/mmc.h>
#include <linux/mmc/sdio.h>
#include <linux/mmc/sh_mmcif.h>
#include <linux/mmc/slot-gpio.h>
#include <linux/mod_devicetable.h>
#include <linux/pagemap.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -1000,6 +1001,10 @@ static int sh_mmcif_get_cd(struct mmc_host *mmc)
{
struct sh_mmcif_host *host = mmc_priv(mmc);
struct sh_mmcif_plat_data *p = host->pd->dev.platform_data;
int ret = mmc_gpio_get_cd(mmc);

if (ret >= 0)
return ret;

if (!p || !p->get_cd)
return -ENOSYS;
Expand Down Expand Up @@ -1372,6 +1377,12 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
goto ereqirq1;
}

if (pd && pd->use_cd_gpio) {
ret = mmc_gpio_request_cd(mmc, pd->cd_gpio);
if (ret < 0)
goto erqcd;
}

clk_disable(host->hclk);
ret = mmc_add_host(mmc);
if (ret < 0)
Expand All @@ -1385,6 +1396,9 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
return ret;

emmcaddh:
if (pd && pd->use_cd_gpio)
mmc_gpio_free_cd(mmc);
erqcd:
free_irq(irq[1], host);
ereqirq1:
free_irq(irq[0], host);
Expand All @@ -1405,6 +1419,7 @@ static int __devinit sh_mmcif_probe(struct platform_device *pdev)
static int __devexit sh_mmcif_remove(struct platform_device *pdev)
{
struct sh_mmcif_host *host = platform_get_drvdata(pdev);
struct sh_mmcif_plat_data *pd = pdev->dev.platform_data;
int irq[2];

host->dying = true;
Expand All @@ -1413,6 +1428,9 @@ static int __devexit sh_mmcif_remove(struct platform_device *pdev)

dev_pm_qos_hide_latency_limit(&pdev->dev);

if (pd && pd->use_cd_gpio)
mmc_gpio_free_cd(host->mmc);

mmc_remove_host(host->mmc);
sh_mmcif_writel(host->addr, MMCIF_CE_INT_MASK, MASK_ALL);

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mmc/sh_mmcif.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ struct sh_mmcif_plat_data {
struct sh_mmcif_dma *dma; /* Deprecated. Instead */
unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */
unsigned int slave_id_rx;
bool use_cd_gpio : 1;
unsigned int cd_gpio;
u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
unsigned long caps;
u32 ocr;
Expand Down

0 comments on commit c1e4a2f

Please sign in to comment.