aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/twl6030-irq.c9
-rw-r--r--drivers/mmc/host/omap_hsmmc.c13
-rw-r--r--include/linux/i2c/twl.h5
3 files changed, 24 insertions, 3 deletions
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index 4466fad..812a6c2 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -345,6 +345,15 @@ int twl6030_mmc_card_detect_config(void)
ret);
return ret;
}
+
+ ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, MMC_MEXT_DEB_MASK,
+ TWL6030_MMCDEBOUNCING);
+ if (ret < 0){
+ pr_err("twl6030: Failed to write MMC_MEXT_DEB_MASK %d\n",
+ ret);
+ return ret;
+ }
+
return 0;
}
EXPORT_SYMBOL(twl6030_mmc_card_detect_config);
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index f6e47a0..b973676 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1368,10 +1368,17 @@ static void omap_hsmmc_detect(struct work_struct *work)
carddetect = -ENOSYS;
}
- if (carddetect)
+ if (carddetect){
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
- else
- mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+ }
+ else{
+ if ((MMC_POWER_OFF != host->power_mode) &&
+ (mmc_slot(host).set_power != NULL)){
+ mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
+ host->power_mode = MMC_POWER_OFF;
+ }
+ mmc_detect_change(host->mmc, 0);
+ }
}
/*
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 0ce0057..eae3f01 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -151,6 +151,11 @@
#define SW_FC (0x1 << 2)
#define STS_MMC 0x1
+#define TWL6030_MMCDEBOUNCING 0xED
+#define MMC_DEB_BYPASS (0x1 << 7)
+#define MMC_MINS_DEB_MASK (0xF << 3)
+#define MMC_MEXT_DEB_MASK (0x7 << 0)
+
#define TWL6030_CFG_INPUT_PUPD3 0xF2
#define MMC_PU (0x1 << 3)
#define MMC_PD (0x1 << 2)