From: Andreas Fenkart <afenkart@gmail.com>
To: linux-mmc@vger.kernel.org
Cc: linux-omap@vger.kernel.org, NeilBrown <neilb@suse.de>,
Tony Lindgren <tony@atomide.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Andreas Fenkart <afenkart@gmail.com>
Subject: [PATCH 5/6] mmc: omap_hsmmc: simplify card/cover detect isr
Date: Tue, 3 Mar 2015 13:28:17 +0100 [thread overview]
Message-ID: <1425385698-6588-6-git-send-email-afenkart@gmail.com> (raw)
In-Reply-To: <1425385698-6588-1-git-send-email-afenkart@gmail.com>
strip the card dectet logic from cover detect isr and vice versa
the generic mmc_gpio_cd_irqt isr, uses 200ms on removal/insertion,
hence that should be fine here as well
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
drivers/mmc/host/omap_hsmmc.c | 27 +++------------------------
1 file changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ed68e55..4f6fbe5 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1239,21 +1239,11 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
{
struct omap_hsmmc_host *host = dev_id;
- int carddetect;
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
- if (host->card_detect) {
- carddetect = host->card_detect(host->dev);
- } else {
- omap_hsmmc_protect_card(host);
- carddetect = -ENOSYS;
- }
-
- if (carddetect)
- mmc_detect_change(host->mmc, (HZ * 200) / 1000);
- else
- mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+ omap_hsmmc_protect_card(host);
+ mmc_detect_change(host->mmc, (HZ * 200) / 1000);
return IRQ_HANDLED;
}
@@ -1263,19 +1253,8 @@ static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
{
struct omap_hsmmc_host *host = dev_id;
- int carddetect;
-
- if (host->card_detect)
- carddetect = host->card_detect(host->dev);
- else {
- omap_hsmmc_protect_card(host);
- carddetect = -ENOSYS;
- }
- if (carddetect)
- mmc_detect_change(host->mmc, (HZ * 200) / 1000);
- else
- mmc_detect_change(host->mmc, (HZ * 50) / 1000);
+ mmc_detect_change(host->mmc, (HZ * 200) / 1000);
return IRQ_HANDLED;
}
--
2.1.4
next prev parent reply other threads:[~2015-03-03 12:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 12:28 [PATCH 0/6] mmc: omap_hsmmc: simplify cover/card detect logic Andreas Fenkart
2015-03-03 12:28 ` [PATCH 1/6] mmc: omap_hsmmc: remove unused fields from struct omap_hsmmc_host Andreas Fenkart
2015-03-03 12:28 ` [PATCH 2/6] mmc: omap_hsmmc: use slot-gpio functions to manage read-only pin directly Andreas Fenkart
2015-03-03 12:28 ` [PATCH 3/6] mmc: omap_hsmmc: use distinctive code paths for cover / card detect logic Andreas Fenkart
2015-03-03 12:28 ` [PATCH 4/6] ARM: OMAP2: HSMMC: platform_data: explicit gpio_cover / gpio_cd fields Andreas Fenkart
2015-03-03 12:28 ` Andreas Fenkart [this message]
2015-03-30 9:34 ` [PATCH 5/6] mmc: omap_hsmmc: simplify card/cover detect isr Ulf Hansson
2015-03-03 12:28 ` [PATCH 6/6] mmc: omap_hsmmc: use generic slot-gpio isr to manage card detect pin Andreas Fenkart
2015-03-30 9:34 ` Ulf Hansson
2015-03-04 5:31 ` [PATCH 0/6] mmc: omap_hsmmc: simplify cover/card detect logic NeilBrown
2015-03-04 8:06 ` Andreas Fenkart
2015-03-05 13:43 ` Ulf Hansson
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=1425385698-6588-6-git-send-email-afenkart@gmail.com \
--to=afenkart@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
/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