aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-02-09 16:57:13 -0500
committerChris Ball <cjb@laptop.org>2012-03-27 12:20:16 -0400
commitc391e1b9ebfe31514fa95a0cdd30c2cbc9652c89 (patch)
treea126e9621172ead9bede04f2413fa79ffd3871d2
parent58126c878b4a4f658015e383614bafb6331e46d3 (diff)
mmc: tmio_mmc: power status flag doesn't have to be exposed in platform data
The controller power status flag does not have to be accessed from the hot-plug detection code any more, it can now be removed from the platform data and put in the controller private struct. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/tmio_mmc.h3
-rw-r--r--drivers/mmc/host/tmio_mmc_pio.c13
-rw-r--r--include/linux/mfd/tmio.h1
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index ede2f4e5b952..edfcfd767511 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -49,6 +49,9 @@ struct tmio_mmc_host {
49 struct mmc_host *mmc; 49 struct mmc_host *mmc;
50 unsigned int sdio_irq_enabled; 50 unsigned int sdio_irq_enabled;
51 51
52 /* Controller power state */
53 bool power;
54
52 /* Callbacks for clock / power control */ 55 /* Callbacks for clock / power control */
53 void (*set_pwr)(struct platform_device *host, int state); 56 void (*set_pwr)(struct platform_device *host, int state);
54 void (*set_clk_div)(struct platform_device *host, int state); 57 void (*set_clk_div)(struct platform_device *host, int state);
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 42970ab6e803..9f22681a37bd 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -762,7 +762,6 @@ fail:
762static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) 762static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
763{ 763{
764 struct tmio_mmc_host *host = mmc_priv(mmc); 764 struct tmio_mmc_host *host = mmc_priv(mmc);
765 struct tmio_mmc_data *pdata = host->pdata;
766 unsigned long flags; 765 unsigned long flags;
767 766
768 mutex_lock(&host->ios_lock); 767 mutex_lock(&host->ios_lock);
@@ -792,15 +791,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
792 spin_unlock_irqrestore(&host->lock, flags); 791 spin_unlock_irqrestore(&host->lock, flags);
793 792
794 /* 793 /*
795 * pdata->power toggles between false and true in both cases - either 794 * host->power toggles between false and true in both cases - either
796 * or not the controller can be runtime-suspended during inactivity. 795 * or not the controller can be runtime-suspended during inactivity.
797 * But if the controller has to be kept on, the runtime-pm usage_count 796 * But if the controller has to be kept on, the runtime-pm usage_count
798 * is kept positive, so no suspending actually takes place. 797 * is kept positive, so no suspending actually takes place.
799 */ 798 */
800 if (ios->power_mode == MMC_POWER_ON && ios->clock) { 799 if (ios->power_mode == MMC_POWER_ON && ios->clock) {
801 if (!pdata->power) { 800 if (!host->power) {
802 pm_runtime_get_sync(&host->pdev->dev); 801 pm_runtime_get_sync(&host->pdev->dev);
803 pdata->power = true; 802 host->power = true;
804 } 803 }
805 tmio_mmc_set_clock(host, ios->clock); 804 tmio_mmc_set_clock(host, ios->clock);
806 /* power up SD bus */ 805 /* power up SD bus */
@@ -811,8 +810,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
811 } else if (ios->power_mode != MMC_POWER_UP) { 810 } else if (ios->power_mode != MMC_POWER_UP) {
812 if (host->set_pwr && ios->power_mode == MMC_POWER_OFF) 811 if (host->set_pwr && ios->power_mode == MMC_POWER_OFF)
813 host->set_pwr(host->pdev, 0); 812 host->set_pwr(host->pdev, 0);
814 if (pdata->power) { 813 if (host->power) {
815 pdata->power = false; 814 host->power = false;
816 pm_runtime_put(&host->pdev->dev); 815 pm_runtime_put(&host->pdev->dev);
817 } 816 }
818 tmio_mmc_clk_stop(host); 817 tmio_mmc_clk_stop(host);
@@ -923,7 +922,7 @@ int __devinit tmio_mmc_host_probe(struct tmio_mmc_host **host,
923 mmc->caps & MMC_CAP_NEEDS_POLL || 922 mmc->caps & MMC_CAP_NEEDS_POLL ||
924 mmc->caps & MMC_CAP_NONREMOVABLE); 923 mmc->caps & MMC_CAP_NONREMOVABLE);
925 924
926 pdata->power = false; 925 _host->power = false;
927 pm_runtime_enable(&pdev->dev); 926 pm_runtime_enable(&pdev->dev);
928 ret = pm_runtime_resume(&pdev->dev); 927 ret = pm_runtime_resume(&pdev->dev);
929 if (ret < 0) 928 if (ret < 0)
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 5a197de4aac9..f5171dbf8850 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -105,7 +105,6 @@ struct tmio_mmc_data {
105 u32 ocr_mask; /* available voltages */ 105 u32 ocr_mask; /* available voltages */
106 struct tmio_mmc_dma *dma; 106 struct tmio_mmc_dma *dma;
107 struct device *dev; 107 struct device *dev;
108 bool power;
109 unsigned int cd_gpio; 108 unsigned int cd_gpio;
110 void (*set_pwr)(struct platform_device *host, int state); 109 void (*set_pwr)(struct platform_device *host, int state);
111 void (*set_clk_div)(struct platform_device *host, int state); 110 void (*set_clk_div)(struct platform_device *host, int state);