Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284522
b: refs/heads/master
c: 7efab4f
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Chris Ball committed Jan 12, 2012
1 parent a18fb93 commit 371ef10
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 93933508ce3753b9ef1fefb75531b5b1622de03f
refs/heads/master: 7efab4f35740c63502e438886cf1e4aa3f3b800f
36 changes: 9 additions & 27 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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>
Expand Down Expand Up @@ -162,7 +161,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 */
Expand Down Expand Up @@ -1279,17 +1277,16 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host)
}

/*
* Work Item to notify the core about card insertion/removal
* irq handler to notify the core about card insertion/removal
*/
static void omap_hsmmc_detect(struct work_struct *work)
static irqreturn_t omap_hsmmc_detect(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 = 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");

Expand All @@ -1304,19 +1301,6 @@ static void omap_hsmmc_detect(struct work_struct *work)
mmc_detect_change(host->mmc, (HZ * 200) / 1000);
else
mmc_detect_change(host->mmc, (HZ * 50) / 1000);
}

/*
* 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;
}

Expand Down Expand Up @@ -1918,7 +1902,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
host->next_data.cookie = 1;

platform_set_drvdata(pdev, host);
INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect);

mmc->ops = &omap_hsmmc_ops;

Expand Down Expand Up @@ -2046,10 +2029,11 @@ 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,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
mmc_hostname(mmc), host);
ret = request_threaded_irq(mmc_slot(host).card_detect_irq,
NULL,
omap_hsmmc_detect,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
mmc_hostname(mmc), host);
if (ret) {
dev_dbg(mmc_dev(host->mmc),
"Unable to grab MMC CD IRQ\n");
Expand Down Expand Up @@ -2128,7 +2112,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);

pm_runtime_put_sync(host->dev);
pm_runtime_disable(host->dev);
Expand Down Expand Up @@ -2175,7 +2158,6 @@ static int omap_hsmmc_suspend(struct device *dev)
return ret;
}
}
cancel_work_sync(&host->mmc_carddetect_work);
ret = mmc_suspend_host(host->mmc);

if (ret == 0) {
Expand Down

0 comments on commit 371ef10

Please sign in to comment.