aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-12-05 22:55:06 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-05 22:55:06 +0000
commit46375b1d935b1b97f06df2426632ba9b58861f0e (patch)
tree7454affb4b10b484056745d68f881052ff65541f /drivers/mmc
parent75e0b08ee55b32b996d491809ce60b63287dadf5 (diff)
add-force-sdhci-rescan.patch
This provides a way for code to force a mmc rescan by using the s3c hsmmc platform device as a handle. It solves the issue of 6410 having two card detect signals mutually exclusive on one physical ball. Ben Dooks told he might implement this another way but we need this on GTA03 right now and can migrate it to any official way that turns up. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-s3c.c17
-rw-r--r--drivers/mmc/host/sdhci.c7
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index b8f2044e451..b9c9fd73d6a 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -197,6 +197,21 @@ static struct sdhci_ops sdhci_s3c_ops = {
.set_ios = sdhci_s3c_set_ios,
};
+/*
+ * call this when you need sd stack to recognize insertion or removal of card
+ * that can't be told by SDHCI regs
+ */
+
+void sdhci_s3c_force_presence_change(struct platform_device *pdev)
+{
+ struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data;
+
+ dev_info(&pdev->dev, "sdhci_s3c_force_presence_change called\n");
+ mmc_detect_change(pdata->sdhci_host->mmc, msecs_to_jiffies(200));
+}
+EXPORT_SYMBOL_GPL(sdhci_s3c_force_presence_change);
+
+
static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
{
struct s3c_sdhci_platdata *pdata = pdev->dev.platform_data;
@@ -229,6 +244,8 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
return PTR_ERR(host);
}
+ pdata->sdhci_host = host;
+
sc = sdhci_priv(host);
sc->host = host;
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ed2c89254df..c769ae520ca 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1030,12 +1030,13 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
#endif
host->mrq = mrq;
-
+/*
if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)
|| (host->flags & SDHCI_DEVICE_DEAD)) {
host->mrq->cmd->error = -ENOMEDIUM;
tasklet_schedule(&host->finish_tasklet);
} else
+*/
sdhci_send_command(host, mrq->cmd);
mmiowb();
@@ -1170,7 +1171,7 @@ static void sdhci_tasklet_card(unsigned long param)
host = (struct sdhci_host*)param;
spin_lock_irqsave(&host->lock, flags);
-
+/*
if (!(readl(host->ioaddr + SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) {
if (host->mrq) {
printk(KERN_ERR "%s: Card removed during transfer!\n",
@@ -1185,7 +1186,7 @@ static void sdhci_tasklet_card(unsigned long param)
tasklet_schedule(&host->finish_tasklet);
}
}
-
+*/
spin_unlock_irqrestore(&host->lock, flags);
mmc_detect_change(host->mmc, msecs_to_jiffies(200));