aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorAxel Haslam <axelhaslam@ti.com>2011-09-05 14:26:52 -0700
committerTodd Poynor <toddpoynor@google.com>2011-09-06 19:48:37 -0700
commit18c2cdffc3995aaa38792e5d65a4ad4c00d700c6 (patch)
tree001205f82f4323be5acda1e981af532bbbd8a640 /drivers/mmc/host
parent6d80f8efdbe1e5e2bc6622aed693ea61c92edd25 (diff)
downloadkernel_samsung_tuna-18c2cdffc3995aaa38792e5d65a4ad4c00d700c6.zip
kernel_samsung_tuna-18c2cdffc3995aaa38792e5d65a4ad4c00d700c6.tar.gz
kernel_samsung_tuna-18c2cdffc3995aaa38792e5d65a4ad4c00d700c6.tar.bz2
OMAP: PM: replace omap_pm_get_dev_context_loss_count with omap_pm_was_context_lost
Drivers just need to know if thier context was lost or not. There is not much point in maintaining a count This removes omap_pm_get_dev_context_loss_count and replaces it with omap_pm_was_context_lost Adapt drivers to use the omap_pm_was_context_lost API, which returns a bool value instead of relying on the incrementing context lost counter. This makes drivers a little more snappier as they do not need to restore contexts when not needed. WARNING: this changes the api set available to drivers to use from OMAP PM layer. Change-Id: I7fd9183d3e12982bb40651df9378637073121399 Signed-off-by: Axel Haslam <axelhaslam@ti.com>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2ca145b..18fc306 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -41,6 +41,7 @@
#include <plat/board.h>
#include <plat/mmc.h>
#include <plat/cpu.h>
+#include <plat/omap-pm.h>
/* OMAP HSMMC Host Controller Registers */
#define OMAP_HSMMC_SYSCONFIG 0x0010
@@ -181,7 +182,6 @@ struct omap_hsmmc_host {
int slot_id;
int got_dbclk;
int response_busy;
- int context_loss;
int dpm_state;
int vdd;
int protect_card;
@@ -597,21 +597,11 @@ static void omap_hsmmc_disable_irq(struct omap_hsmmc_host *host)
static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
{
struct mmc_ios *ios = &host->mmc->ios;
- struct omap_mmc_platform_data *pdata = host->pdata;
- int context_loss = 0;
u32 hctl, capa, con;
u16 dsor = 0;
unsigned long timeout;
- if (pdata->get_context_loss_count) {
- context_loss = pdata->get_context_loss_count(host->dev);
- if (context_loss < 0)
- return 1;
- }
-
- dev_dbg(mmc_dev(host->mmc), "context was %slost\n",
- context_loss == host->context_loss ? "not " : "");
- if (host->context_loss == context_loss)
+ if (!omap_pm_was_context_lost(host->dev))
return 1;
/* Wait for hardware reset */
@@ -711,8 +701,6 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
else
OMAP_HSMMC_WRITE(host->base, CON, con & ~OD);
out:
- host->context_loss = context_loss;
-
dev_dbg(mmc_dev(host->mmc), "context is restored\n");
return 0;
}
@@ -722,15 +710,7 @@ out:
*/
static void omap_hsmmc_context_save(struct omap_hsmmc_host *host)
{
- struct omap_mmc_platform_data *pdata = host->pdata;
- int context_loss;
-
- if (pdata->get_context_loss_count) {
- context_loss = pdata->get_context_loss_count(host->dev);
- if (context_loss < 0)
- return;
- host->context_loss = context_loss;
- }
+ return;
}
#else
@@ -1946,20 +1926,15 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
{
struct mmc_host *mmc = s->private;
struct omap_hsmmc_host *host = mmc_priv(mmc);
- int context_loss = 0;
- if (host->pdata->get_context_loss_count)
- context_loss = host->pdata->get_context_loss_count(host->dev);
seq_printf(s, "mmc%d:\n"
" enabled:\t%d\n"
" dpm_state:\t%d\n"
" nesting_cnt:\t%d\n"
- " ctx_loss:\t%d:%d\n"
- "\nregs:\n",
+ " ct",
mmc->index, mmc->enabled ? 1 : 0,
- host->dpm_state, mmc->nesting_cnt,
- host->context_loss, context_loss);
+ host->dpm_state, mmc->nesting_cnt);
if (host->suspended || host->dpm_state == OFF) {
seq_printf(s, "host suspended, can't read registers\n");