diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2009-01-26 06:17:25 -0500 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2009-03-24 16:30:05 -0400 |
commit | e1a55f5eeae90de3f1113dea8cd40d54e1562abf (patch) | |
tree | d46021a78d7a735a8e88512e6945371b769efe08 /drivers/mmc/host | |
parent | 731530104afa6310660455ad86353dbe9e226740 (diff) |
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: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fd1657ad2a74..f3e4e0fd6655 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -571,7 +571,10 @@ static void mmc_omap_detect(struct work_struct *work) | |||
571 | mmc_carddetect_work); | 571 | mmc_carddetect_work); |
572 | struct omap_mmc_slot_data *slot = &mmc_slot(host); | 572 | struct omap_mmc_slot_data *slot = &mmc_slot(host); |
573 | 573 | ||
574 | host->carddetect = slot->card_detect(slot->card_detect_irq); | 574 | if (mmc_slot(host).card_detect) |
575 | host->carddetect = slot->card_detect(slot->card_detect_irq); | ||
576 | else | ||
577 | host->carddetect = -ENOSYS; | ||
575 | 578 | ||
576 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); | 579 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); |
577 | if (host->carddetect) { | 580 | if (host->carddetect) { |
@@ -1089,7 +1092,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1089 | } | 1092 | } |
1090 | 1093 | ||
1091 | /* Request IRQ for card detect */ | 1094 | /* Request IRQ for card detect */ |
1092 | if ((mmc_slot(host).card_detect_irq) && (mmc_slot(host).card_detect)) { | 1095 | if ((mmc_slot(host).card_detect_irq)) { |
1093 | ret = request_irq(mmc_slot(host).card_detect_irq, | 1096 | ret = request_irq(mmc_slot(host).card_detect_irq, |
1094 | omap_mmc_cd_handler, | 1097 | omap_mmc_cd_handler, |
1095 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | 1098 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
@@ -1112,8 +1115,8 @@ static int __init omap_mmc_probe(struct platform_device *pdev) | |||
1112 | if (ret < 0) | 1115 | if (ret < 0) |
1113 | goto err_slot_name; | 1116 | goto err_slot_name; |
1114 | } | 1117 | } |
1115 | if (mmc_slot(host).card_detect_irq && mmc_slot(host).card_detect && | 1118 | if (mmc_slot(host).card_detect_irq && |
1116 | host->pdata->slots[host->slot_id].get_cover_state) { | 1119 | host->pdata->slots[host->slot_id].get_cover_state) { |
1117 | ret = device_create_file(&mmc->class_dev, | 1120 | ret = device_create_file(&mmc->class_dev, |
1118 | &dev_attr_cover_switch); | 1121 | &dev_attr_cover_switch); |
1119 | if (ret < 0) | 1122 | if (ret < 0) |