From: Viswanath Puttagunta <vishp@ti.com>
To: Linux-mmc <linux-mmc@vger.kernel.org>
Cc: T Krishnamoorthy Balaji <balajitk@ti.com>,
Venkatraman S <svenkatr@ti.com>,
Semen Protsenko <semen.protsenko@ti.com>,
Volodymyr Riazantsev <v.riazantsev@ti.com>,
Viswanath Puttagunta <vishp@ti.com>
Subject: [PATCH 3/3] mfd: Enable Debounce logic for SD hotplug detection
Date: Thu, 24 May 2012 15:14:27 -0500 [thread overview]
Message-ID: <1337890467-32573-4-git-send-email-vishp@ti.com> (raw)
In-Reply-To: <1337890467-32573-1-git-send-email-vishp@ti.com>
Enable debounce logic in TWL6030 so that erroneous
disconnect/connect interrupts will be suppressed.
This will fix issue where SD card is either plugged
or unplugged very slowly.
Change-Id: Icc3afa4c66b3bc7920f27ff9c9a3f32e67d5833c
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
---
drivers/mfd/twl6030-irq.c | 8 ++++++++
include/linux/i2c/twl.h | 5 +++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
index b76902f..05bb6e1 100644
--- a/drivers/mfd/twl6030-irq.c
+++ b/drivers/mfd/twl6030-irq.c
@@ -317,6 +317,14 @@ int twl6030_mmc_card_detect_config(void)
ret);
return ret;
}
+ ret = twl_i2c_write_u8(TWL6030_MODULE_ID0,
+ (MMC_MINS_DEB_MASK | 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 twl6030_irq_base + MMCDETECT_INTR_OFFSET;
}
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 1f90de0..672dcfb 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -147,6 +147,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)
--
1.7.4.1
next prev parent reply other threads:[~2012-05-24 20:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 20:14 [PATCH 0/3] mmc:sd hotplug fixes for omap Viswanath Puttagunta
2012-05-24 20:14 ` [PATCH 1/3] mmc: omap_hsmmc: Errata i705: SD hot unplug Viswanath Puttagunta
2012-05-25 8:37 ` S, Venkatraman
2012-05-31 16:39 ` Puttagunta, Viswanath
2012-05-24 20:14 ` [PATCH 2/3] mmc: omap_hsmmc: Errata: Fix SD card removal detection Viswanath Puttagunta
2012-05-24 20:14 ` Viswanath Puttagunta [this message]
2012-05-25 8:22 ` [PATCH 3/3] mfd: Enable Debounce logic for SD hotplug detection S, Venkatraman
2012-05-25 7:20 ` [PATCH 0/3] mmc:sd hotplug fixes for omap S, Venkatraman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337890467-32573-4-git-send-email-vishp@ti.com \
--to=vishp@ti.com \
--cc=balajitk@ti.com \
--cc=linux-mmc@vger.kernel.org \
--cc=semen.protsenko@ti.com \
--cc=svenkatr@ti.com \
--cc=v.riazantsev@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).