diff options
| author | Andreas Fenkart <afenkart@gmail.com> | 2015-03-03 07:28:17 -0500 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-03-31 10:50:44 -0400 |
| commit | 11227d12397c6dd5c578e27210aa14e3fa44f11c (patch) | |
| tree | f3cfa6204d26b0b1285169e9c331e57df69fa494 /drivers/mmc/host | |
| parent | b793f658b194edfe5e1d86aaeace01a7b03c68f9 (diff) | |
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>
Diffstat (limited to 'drivers/mmc/host')
| -rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 08d537797b13..ea7028517124 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
| @@ -1241,21 +1241,11 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host) | |||
| 1241 | static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id) | 1241 | static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id) |
| 1242 | { | 1242 | { |
| 1243 | struct omap_hsmmc_host *host = dev_id; | 1243 | struct omap_hsmmc_host *host = dev_id; |
| 1244 | int carddetect; | ||
| 1245 | 1244 | ||
| 1246 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); | 1245 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); |
| 1247 | 1246 | ||
| 1248 | if (host->card_detect) { | 1247 | omap_hsmmc_protect_card(host); |
| 1249 | carddetect = host->card_detect(host->dev); | 1248 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); |
| 1250 | } else { | ||
| 1251 | omap_hsmmc_protect_card(host); | ||
| 1252 | carddetect = -ENOSYS; | ||
| 1253 | } | ||
| 1254 | |||
| 1255 | if (carddetect) | ||
| 1256 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); | ||
| 1257 | else | ||
| 1258 | mmc_detect_change(host->mmc, (HZ * 50) / 1000); | ||
| 1259 | return IRQ_HANDLED; | 1249 | return IRQ_HANDLED; |
| 1260 | } | 1250 | } |
| 1261 | 1251 | ||
| @@ -1265,19 +1255,8 @@ static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id) | |||
| 1265 | static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id) | 1255 | static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id) |
| 1266 | { | 1256 | { |
| 1267 | struct omap_hsmmc_host *host = dev_id; | 1257 | struct omap_hsmmc_host *host = dev_id; |
| 1268 | int carddetect; | ||
| 1269 | |||
| 1270 | if (host->card_detect) | ||
| 1271 | carddetect = host->card_detect(host->dev); | ||
| 1272 | else { | ||
| 1273 | omap_hsmmc_protect_card(host); | ||
| 1274 | carddetect = -ENOSYS; | ||
| 1275 | } | ||
| 1276 | 1258 | ||
| 1277 | if (carddetect) | 1259 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); |
| 1278 | mmc_detect_change(host->mmc, (HZ * 200) / 1000); | ||
| 1279 | else | ||
| 1280 | mmc_detect_change(host->mmc, (HZ * 50) / 1000); | ||
| 1281 | return IRQ_HANDLED; | 1260 | return IRQ_HANDLED; |
| 1282 | } | 1261 | } |
| 1283 | 1262 | ||
