aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaga Venkata Srikanth V <vnv.srikanth@samsung.com>2012-11-01 14:11:42 +0200
committerZiyan <jaraidaniel@gmail.com>2016-01-13 21:48:41 +0100
commit7c64b00a08ab2b4fd423243645feb5d9ea6626d9 (patch)
tree7945448831477597f944a5525f29165e393bf5c0
parent4a094a1bc202cd73bc3a059528cd14ea0bf03816 (diff)
downloadkernel_samsung_tuna-7c64b00a08ab2b4fd423243645feb5d9ea6626d9.zip
kernel_samsung_tuna-7c64b00a08ab2b4fd423243645feb5d9ea6626d9.tar.gz
kernel_samsung_tuna-7c64b00a08ab2b4fd423243645feb5d9ea6626d9.tar.bz2
OMAP_HSMMC: Migration to IRQ threaded handler
Changed the mmc card detect request_irq() to request_threaded_irq(). Removed sceduled work in the ISR and replaced with thread. Change-Id: I02c1fb0353bd3a7ce939a80e0f8cd57c4aafec8c Signed-off-by: Naga Venkata Srikanth V <vnv.srikanth@samsung.com> Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
-rwxr-xr-xdrivers/mmc/host/omap_hsmmc.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 89909a4..444c553 100755
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -23,7 +23,6 @@
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
-#include <linux/workqueue.h>
#include <linux/timer.h>
#include <linux/clk.h>
#include <linux/mmc/host.h>
@@ -221,7 +220,6 @@ struct omap_hsmmc_host {
*/
struct regulator *vcc;
struct regulator *vcc_aux;
- struct work_struct mmc_carddetect_work;
void __iomem *base;
resource_size_t mapbase;
spinlock_t irq_lock; /* Prevent races with irq handler */
@@ -1394,17 +1392,16 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
}
/*
- * Work Item to notify the core about card insertion/removal
+ * IRQ Tread for handling card insertion and removal
*/
-static void omap_hsmmc_detect(struct work_struct *work)
+static irqreturn_t omap_hsmmc_cd_thread_handler(int irq, void *dev_id)
{
- struct omap_hsmmc_host *host =
- container_of(work, struct omap_hsmmc_host, mmc_carddetect_work);
+ struct omap_hsmmc_host *host = (struct omap_hsmmc_host *)dev_id;
struct omap_mmc_slot_data *slot = &mmc_slot(host);
int carddetect;
if (host->suspended)
- return;
+ return IRQ_HANDLED;
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
@@ -1434,19 +1431,6 @@ static void omap_hsmmc_detect(struct work_struct *work)
mmc_release_host(host->mmc);
mmc_detect_change(host->mmc, 0);
}
-}
-
-/*
- * ISR for handling card insertion and removal
- */
-static irqreturn_t omap_hsmmc_cd_handler(int irq, void *dev_id)
-{
- struct omap_hsmmc_host *host = (struct omap_hsmmc_host *)dev_id;
-
- if (host->suspended)
- return IRQ_HANDLED;
- schedule_work(&host->mmc_carddetect_work);
-
return IRQ_HANDLED;
}
@@ -2432,7 +2416,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
host->master_clock = OMAP_MMC_MASTER_CLOCK / 2;
platform_set_drvdata(pdev, host);
- INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect);
if (mmc_slot(host).power_saving)
mmc->ops = &omap_hsmmc_ps_ops;
@@ -2604,10 +2587,10 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
/* Request IRQ for card detect */
if ((mmc_slot(host).card_detect_irq)) {
- ret = request_irq(mmc_slot(host).card_detect_irq,
- omap_hsmmc_cd_handler,
+ ret = request_threaded_irq(mmc_slot(host).card_detect_irq, NULL,
+ omap_hsmmc_cd_thread_handler,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
- | IRQF_DISABLED,
+ | IRQF_ONESHOT,
mmc_hostname(mmc), host);
if (ret) {
dev_dbg(mmc_dev(host->mmc),
@@ -2697,7 +2680,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
free_irq(host->irq, host);
if (mmc_slot(host).card_detect_irq)
free_irq(mmc_slot(host).card_detect_irq, host);
- flush_work_sync(&host->mmc_carddetect_work);
if (host->adma_table != NULL)
dma_free_coherent(NULL, ADMA_TABLE_SZ,
@@ -2752,7 +2734,6 @@ static int omap_hsmmc_suspend(struct device *dev)
return ret;
}
}
- cancel_work_sync(&host->mmc_carddetect_work);
if (mmc_slot(host).mmc_data.built_in)
host->mmc->pm_flags |= MMC_PM_KEEP_POWER;
ret = mmc_suspend_host(host->mmc);