mmc: omap_hsmmc: simplify card/cover detect isr
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> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:

committed by
Ulf Hansson

parent
b793f658b1
commit
11227d1239
@@ -1241,21 +1241,11 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
|
|||||||
static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
|
static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
struct omap_hsmmc_host *host = dev_id;
|
struct omap_hsmmc_host *host = dev_id;
|
||||||
int carddetect;
|
|
||||||
|
|
||||||
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
|
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
|
||||||
|
|
||||||
if (host->card_detect) {
|
omap_hsmmc_protect_card(host);
|
||||||
carddetect = host->card_detect(host->dev);
|
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
|
||||||
} 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);
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1265,19 +1255,8 @@ static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id)
|
|||||||
static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
|
static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id)
|
||||||
{
|
{
|
||||||
struct omap_hsmmc_host *host = dev_id;
|
struct omap_hsmmc_host *host = dev_id;
|
||||||
int carddetect;
|
|
||||||
|
|
||||||
if (host->card_detect)
|
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
|
||||||
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);
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user