Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219005
b: refs/heads/master
c: 12ae637
h: refs/heads/master
i:
  219003: b224869
v: v3
  • Loading branch information
Ohad Ben-Cohen authored and Chris Ball committed Oct 23, 2010
1 parent 6afea56 commit d6c5731
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b966aae6419f7d75a87114c4d82bfb8f8699132
refs/heads/master: 12ae637f081a7a05144af65802a7b492b9162660
20 changes: 14 additions & 6 deletions trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,37 +1583,45 @@ void mmc_stop_host(struct mmc_host *host)
mmc_power_off(host);
}

void mmc_power_save_host(struct mmc_host *host)
int mmc_power_save_host(struct mmc_host *host)
{
int ret = 0;

mmc_bus_get(host);

if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
mmc_bus_put(host);
return;
return -EINVAL;
}

if (host->bus_ops->power_save)
host->bus_ops->power_save(host);
ret = host->bus_ops->power_save(host);

mmc_bus_put(host);

mmc_power_off(host);

return ret;
}
EXPORT_SYMBOL(mmc_power_save_host);

void mmc_power_restore_host(struct mmc_host *host)
int mmc_power_restore_host(struct mmc_host *host)
{
int ret;

mmc_bus_get(host);

if (!host->bus_ops || host->bus_dead || !host->bus_ops->power_restore) {
mmc_bus_put(host);
return;
return -EINVAL;
}

mmc_power_up(host);
host->bus_ops->power_restore(host);
ret = host->bus_ops->power_restore(host);

mmc_bus_put(host);

return ret;
}
EXPORT_SYMBOL(mmc_power_restore_host);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/mmc/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ struct mmc_bus_ops {
void (*detect)(struct mmc_host *);
int (*suspend)(struct mmc_host *);
int (*resume)(struct mmc_host *);
void (*power_save)(struct mmc_host *);
void (*power_restore)(struct mmc_host *);
int (*power_save)(struct mmc_host *);
int (*power_restore)(struct mmc_host *);
};

void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,12 +657,16 @@ static int mmc_resume(struct mmc_host *host)
return err;
}

static void mmc_power_restore(struct mmc_host *host)
static int mmc_power_restore(struct mmc_host *host)
{
int ret;

host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_claim_host(host);
mmc_init_card(host, host->ocr, host->card);
ret = mmc_init_card(host, host->ocr, host->card);
mmc_release_host(host);

return ret;
}

static int mmc_sleep(struct mmc_host *host)
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,16 @@ static int mmc_sd_resume(struct mmc_host *host)
return err;
}

static void mmc_sd_power_restore(struct mmc_host *host)
static int mmc_sd_power_restore(struct mmc_host *host)
{
int ret;

host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_claim_host(host);
mmc_sd_init_card(host, host->ocr, host->card);
ret = mmc_sd_init_card(host, host->ocr, host->card);
mmc_release_host(host);

return ret;
}

static const struct mmc_bus_ops mmc_sd_ops = {
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ static inline void *mmc_priv(struct mmc_host *host)
extern int mmc_suspend_host(struct mmc_host *);
extern int mmc_resume_host(struct mmc_host *);

extern void mmc_power_save_host(struct mmc_host *host);
extern void mmc_power_restore_host(struct mmc_host *host);
extern int mmc_power_save_host(struct mmc_host *host);
extern int mmc_power_restore_host(struct mmc_host *host);

extern void mmc_detect_change(struct mmc_host *, unsigned long delay);
extern void mmc_request_done(struct mmc_host *, struct mmc_request *);
Expand Down

0 comments on commit d6c5731

Please sign in to comment.