diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2011-05-06 05:14:05 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-07-21 10:35:02 -0400 |
commit | e0c7f99b863b485ad0cde371ea1f62ec8ff70c5d (patch) | |
tree | 66b39be4541469ffab16d44debc63e1a4368f3f9 /drivers/mmc | |
parent | ac330f44c6bcc5f8ef7eb6ea7fd00575a1d5ef1a (diff) |
mmc: omap_hsmmc: introduce start_clock and re-use stop_clock
There is similar code in two functions which enable the clock. Refactor
this code to omap_hsmmc_start_clock(). Re-use omap_hsmmc_stop_clock() in
omap_hsmmc_context_restore() as well.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 2840c7af02c2..2645bdc94dae 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -553,6 +553,15 @@ static void omap_hsmmc_gpio_free(struct omap_mmc_platform_data *pdata) | |||
553 | } | 553 | } |
554 | 554 | ||
555 | /* | 555 | /* |
556 | * Start clock to the card | ||
557 | */ | ||
558 | static void omap_hsmmc_start_clock(struct omap_hsmmc_host *host) | ||
559 | { | ||
560 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | ||
561 | OMAP_HSMMC_READ(host->base, SYSCTL) | CEN); | ||
562 | } | ||
563 | |||
564 | /* | ||
556 | * Stop clock to the card | 565 | * Stop clock to the card |
557 | */ | 566 | */ |
558 | static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host) | 567 | static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host) |
@@ -693,8 +702,8 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) | |||
693 | break; | 702 | break; |
694 | } | 703 | } |
695 | 704 | ||
696 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 705 | omap_hsmmc_stop_clock(host); |
697 | OMAP_HSMMC_READ(host->base, SYSCTL) & ~CEN); | 706 | |
698 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 707 | OMAP_HSMMC_WRITE(host->base, SYSCTL, |
699 | (calc_divisor(ios) << 6) | (DTO << 16)); | 708 | (calc_divisor(ios) << 6) | (DTO << 16)); |
700 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 709 | OMAP_HSMMC_WRITE(host->base, SYSCTL, |
@@ -705,8 +714,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) | |||
705 | && time_before(jiffies, timeout)) | 714 | && time_before(jiffies, timeout)) |
706 | ; | 715 | ; |
707 | 716 | ||
708 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 717 | omap_hsmmc_start_clock(host); |
709 | OMAP_HSMMC_READ(host->base, SYSCTL) | CEN); | ||
710 | 718 | ||
711 | con = OMAP_HSMMC_READ(host->base, CON); | 719 | con = OMAP_HSMMC_READ(host->base, CON); |
712 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) | 720 | if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) |
@@ -1684,8 +1692,7 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1684 | && time_before(jiffies, timeout)) | 1692 | && time_before(jiffies, timeout)) |
1685 | msleep(1); | 1693 | msleep(1); |
1686 | 1694 | ||
1687 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 1695 | omap_hsmmc_start_clock(host); |
1688 | OMAP_HSMMC_READ(host->base, SYSCTL) | CEN); | ||
1689 | 1696 | ||
1690 | if (do_send_init_stream) | 1697 | if (do_send_init_stream) |
1691 | send_init_stream(host); | 1698 | send_init_stream(host); |