Commit e1a55f5e authored by Adrian Hunter's avatar Adrian Hunter Committed by Pierre Ossman

omap_hsmmc: Allow cover switch to cause rescan

Allow a cover switch to be used to cause a rescan of the
MMC slot.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 73153010
...@@ -571,7 +571,10 @@ static void mmc_omap_detect(struct work_struct *work) ...@@ -571,7 +571,10 @@ static void mmc_omap_detect(struct work_struct *work)
mmc_carddetect_work); mmc_carddetect_work);
struct omap_mmc_slot_data *slot = &mmc_slot(host); struct omap_mmc_slot_data *slot = &mmc_slot(host);
if (mmc_slot(host).card_detect)
host->carddetect = slot->card_detect(slot->card_detect_irq); host->carddetect = slot->card_detect(slot->card_detect_irq);
else
host->carddetect = -ENOSYS;
sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
if (host->carddetect) { if (host->carddetect) {
...@@ -1089,7 +1092,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) ...@@ -1089,7 +1092,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
} }
/* Request IRQ for card detect */ /* Request IRQ for card detect */
if ((mmc_slot(host).card_detect_irq) && (mmc_slot(host).card_detect)) { if ((mmc_slot(host).card_detect_irq)) {
ret = request_irq(mmc_slot(host).card_detect_irq, ret = request_irq(mmc_slot(host).card_detect_irq,
omap_mmc_cd_handler, omap_mmc_cd_handler,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
...@@ -1112,7 +1115,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) ...@@ -1112,7 +1115,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_slot_name; goto err_slot_name;
} }
if (mmc_slot(host).card_detect_irq && mmc_slot(host).card_detect && if (mmc_slot(host).card_detect_irq &&
host->pdata->slots[host->slot_id].get_cover_state) { host->pdata->slots[host->slot_id].get_cover_state) {
ret = device_create_file(&mmc->class_dev, ret = device_create_file(&mmc->class_dev,
&dev_attr_cover_switch); &dev_attr_cover_switch);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment