| From 4b27b3333d50a9a453ed10b60847e9d4f488ea22 Mon Sep 17 00:00:00 2001 |
| From: Chris Ball <cjb@laptop.org> |
| Date: Fri, 6 Sep 2013 07:29:05 -0400 |
| Subject: Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data" |
| |
| This reverts commit 3af9d15c719017feb63fa99f89ac6009a5a3d467, which |
| causes a build failure: |
| |
| drivers/mfd/asic3.c:724:2: error: unknown field 'set_pwr' specified in initializer |
| |
| (cherry picked from commit 9d731e7539713acc0ec7b67a5a91357c455d2334) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/mmc/host/tmio_mmc.h | 1 + |
| drivers/mmc/host/tmio_mmc_pio.c | 7 +++++++ |
| include/linux/mfd/tmio.h | 1 + |
| 3 files changed, 9 insertions(+) |
| |
| diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h |
| index 39c2f451..86fd21e0 100644 |
| --- a/drivers/mmc/host/tmio_mmc.h |
| +++ b/drivers/mmc/host/tmio_mmc.h |
| @@ -68,6 +68,7 @@ struct tmio_mmc_host { |
| enum tmio_mmc_power 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); |
| |
| /* pio related stuff */ |
| diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c |
| index 67a3bf12..b3802256 100644 |
| --- a/drivers/mmc/host/tmio_mmc_pio.c |
| +++ b/drivers/mmc/host/tmio_mmc_pio.c |
| @@ -777,6 +777,9 @@ static void tmio_mmc_power_on(struct tmio_mmc_host *host, unsigned short vdd) |
| |
| /* .set_ios() is returning void, so, no chance to report an error */ |
| |
| + if (host->set_pwr) |
| + host->set_pwr(host->pdev, 1); |
| + |
| if (!IS_ERR(mmc->supply.vmmc)) { |
| ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); |
| /* |
| @@ -810,6 +813,9 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host) |
| |
| if (!IS_ERR(mmc->supply.vmmc)) |
| mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); |
| + |
| + if (host->set_pwr) |
| + host->set_pwr(host->pdev, 0); |
| } |
| |
| /* Set MMC clock / power. |
| @@ -996,6 +1002,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host, |
| _host->pdev = pdev; |
| platform_set_drvdata(pdev, mmc); |
| |
| + _host->set_pwr = pdata->set_pwr; |
| _host->set_clk_div = pdata->set_clk_div; |
| |
| /* SD control register space size is 0x200, 0x400 for bus_shift=1 */ |
| diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h |
| index baa23464..b22883d6 100644 |
| --- a/include/linux/mfd/tmio.h |
| +++ b/include/linux/mfd/tmio.h |
| @@ -106,6 +106,7 @@ struct tmio_mmc_data { |
| struct tmio_mmc_dma *dma; |
| struct device *dev; |
| unsigned int cd_gpio; |
| + void (*set_pwr)(struct platform_device *host, int state); |
| void (*set_clk_div)(struct platform_device *host, int state); |
| int (*write16_hook)(struct tmio_mmc_host *host, int addr); |
| /* clock management callbacks */ |
| -- |
| 1.8.4.3.gca3854a |
| |