Commit 25958804 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Chris Ball

mmc: sdhi: allow powering down controller with no card inserted

Supply a link to TMIO private data for platforms to implement their
own card detection.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 7311bef0
...@@ -71,6 +71,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) ...@@ -71,6 +71,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
} }
mmc_data = &priv->mmc_data; mmc_data = &priv->mmc_data;
p->pdata = mmc_data;
snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
priv->clk = clk_get(&pdev->dev, clk_name); priv->clk = clk_get(&pdev->dev, clk_name);
...@@ -159,8 +160,11 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) ...@@ -159,8 +160,11 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
struct mmc_host *mmc = platform_get_drvdata(pdev); struct mmc_host *mmc = platform_get_drvdata(pdev);
struct tmio_mmc_host *host = mmc_priv(mmc); struct tmio_mmc_host *host = mmc_priv(mmc);
struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data);
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
int i, irq; int i, irq;
p->pdata = NULL;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
irq = platform_get_irq(pdev, i); irq = platform_get_irq(pdev, i);
if (irq >= 0) if (irq >= 0)
...@@ -178,6 +182,8 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) ...@@ -178,6 +182,8 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
.suspend = tmio_mmc_host_suspend, .suspend = tmio_mmc_host_suspend,
.resume = tmio_mmc_host_resume, .resume = tmio_mmc_host_resume,
.runtime_suspend = tmio_mmc_host_runtime_suspend,
.runtime_resume = tmio_mmc_host_runtime_resume,
}; };
static struct platform_driver sh_mobile_sdhi_driver = { static struct platform_driver sh_mobile_sdhi_driver = {
......
...@@ -3,12 +3,16 @@ ...@@ -3,12 +3,16 @@
#include <linux/types.h> #include <linux/types.h>
struct platform_device;
struct tmio_mmc_data;
struct sh_mobile_sdhi_info { struct sh_mobile_sdhi_info {
int dma_slave_tx; int dma_slave_tx;
int dma_slave_rx; int dma_slave_rx;
unsigned long tmio_flags; unsigned long tmio_flags;
unsigned long tmio_caps; unsigned long tmio_caps;
u32 tmio_ocr_mask; /* available MMC voltages */ u32 tmio_ocr_mask; /* available MMC voltages */
struct tmio_mmc_data *pdata;
void (*set_pwr)(struct platform_device *pdev, int state); void (*set_pwr)(struct platform_device *pdev, int state);
int (*get_cd)(struct platform_device *pdev); int (*get_cd)(struct platform_device *pdev);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment