Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297362
b: refs/heads/master
c: c391e1b
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Mar 27, 2012
1 parent c6866b9 commit 44c4ffa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 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: 58126c878b4a4f658015e383614bafb6331e46d3
refs/heads/master: c391e1b9ebfe31514fa95a0cdd30c2cbc9652c89
3 changes: 3 additions & 0 deletions trunk/drivers/mmc/host/tmio_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ struct tmio_mmc_host {
struct mmc_host *mmc;
unsigned int sdio_irq_enabled;

/* Controller power state */
bool power;

/* Callbacks for clock / power control */
void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state);
Expand Down
13 changes: 6 additions & 7 deletions trunk/drivers/mmc/host/tmio_mmc_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
struct tmio_mmc_data *pdata = host->pdata;
unsigned long flags;

mutex_lock(&host->ios_lock);
Expand Down Expand Up @@ -792,15 +791,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
spin_unlock_irqrestore(&host->lock, flags);

/*
* pdata->power toggles between false and true in both cases - either
* host->power toggles between false and true in both cases - either
* or not the controller can be runtime-suspended during inactivity.
* But if the controller has to be kept on, the runtime-pm usage_count
* is kept positive, so no suspending actually takes place.
*/
if (ios->power_mode == MMC_POWER_ON && ios->clock) {
if (!pdata->power) {
if (!host->power) {
pm_runtime_get_sync(&host->pdev->dev);
pdata->power = true;
host->power = true;
}
tmio_mmc_set_clock(host, ios->clock);
/* power up SD bus */
Expand All @@ -811,8 +810,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
} else if (ios->power_mode != MMC_POWER_UP) {
if (host->set_pwr && ios->power_mode == MMC_POWER_OFF)
host->set_pwr(host->pdev, 0);
if (pdata->power) {
pdata->power = false;
if (host->power) {
host->power = false;
pm_runtime_put(&host->pdev->dev);
}
tmio_mmc_clk_stop(host);
Expand Down Expand Up @@ -923,7 +922,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
mmc->caps & MMC_CAP_NEEDS_POLL ||
mmc->caps & MMC_CAP_NONREMOVABLE);

pdata->power = false;
_host->power = false;
pm_runtime_enable(&pdev->dev);
ret = pm_runtime_resume(&pdev->dev);
if (ret < 0)
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/mfd/tmio.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ struct tmio_mmc_data {
u32 ocr_mask; /* available voltages */
struct tmio_mmc_dma *dma;
struct device *dev;
bool power;
unsigned int cd_gpio;
void (*set_pwr)(struct platform_device *host, int state);
void (*set_clk_div)(struct platform_device *host, int state);
Expand Down

0 comments on commit 44c4ffa

Please sign in to comment.