diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-03-10 09:02:41 -0400 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-03-17 09:12:00 -0400 |
commit | 740a221ef0e579dc7c675cf6b90f5313509788f7 (patch) | |
tree | 7e31940925f1e6e4b7876c9a1f96a17eef20b401 /drivers/mmc/core/core.c | |
parent | 26652671338a443fd33cf47b50658dd8b095d54a (diff) |
mmc: slot-gpio: Add GPIO descriptor based CD GPIO API
Add functions to request a CD GPIO using the GPIO descriptor API.
Note that the new request function is paired with mmc_gpiod_free_cd()
not mmc_gpio_free_cd(). Note also that it must be called prior to
mmc_add_host() otherwise the caller must also call
mmc_gpiod_request_cd_irq().
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index dc7a5fb81a5c..acbc3f2aaaf9 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/mmc/host.h> | 34 | #include <linux/mmc/host.h> |
35 | #include <linux/mmc/mmc.h> | 35 | #include <linux/mmc/mmc.h> |
36 | #include <linux/mmc/sd.h> | 36 | #include <linux/mmc/sd.h> |
37 | #include <linux/mmc/slot-gpio.h> | ||
37 | 38 | ||
38 | #include "core.h" | 39 | #include "core.h" |
39 | #include "bus.h" | 40 | #include "bus.h" |
@@ -2471,6 +2472,7 @@ void mmc_start_host(struct mmc_host *host) | |||
2471 | mmc_power_off(host); | 2472 | mmc_power_off(host); |
2472 | else | 2473 | else |
2473 | mmc_power_up(host, host->ocr_avail); | 2474 | mmc_power_up(host, host->ocr_avail); |
2475 | mmc_gpiod_request_cd_irq(host); | ||
2474 | _mmc_detect_change(host, 0, false); | 2476 | _mmc_detect_change(host, 0, false); |
2475 | } | 2477 | } |
2476 | 2478 | ||
@@ -2482,6 +2484,8 @@ void mmc_stop_host(struct mmc_host *host) | |||
2482 | host->removed = 1; | 2484 | host->removed = 1; |
2483 | spin_unlock_irqrestore(&host->lock, flags); | 2485 | spin_unlock_irqrestore(&host->lock, flags); |
2484 | #endif | 2486 | #endif |
2487 | if (host->slot.cd_irq >= 0) | ||
2488 | disable_irq(host->slot.cd_irq); | ||
2485 | 2489 | ||
2486 | host->rescan_disable = 1; | 2490 | host->rescan_disable = 1; |
2487 | cancel_delayed_work_sync(&host->detect); | 2491 | cancel_delayed_work_sync(&host->detect); |