diff options
author | Magnus Damm <damm@opensource.se> | 2009-11-26 23:31:27 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-11-29 22:01:24 -0500 |
commit | be9cd7b6f84fd0cc59c8770771073b5c66f958ac (patch) | |
tree | 6ecc43a8424b87828131c4ed2a4a45ca812db847 /drivers | |
parent | c60f55fa1f82984bbb168c7721db893451f9de6c (diff) |
mfd: Add power control platform data to SDHI driver
This patch adds platform data with a function for power
control to the SDHI driver. The idea is that board specific
code can provide their own functions so power can be enabled
and disabled for the sd-cards.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/sh_mobile_sdhi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c index 56f72cc1d569..03efae8041ab 100644 --- a/drivers/mfd/sh_mobile_sdhi.c +++ b/drivers/mfd/sh_mobile_sdhi.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <linux/mfd/core.h> | 25 | #include <linux/mfd/core.h> |
26 | #include <linux/mfd/tmio.h> | 26 | #include <linux/mfd/tmio.h> |
27 | #include <linux/mfd/sh_mobile_sdhi.h> | ||
27 | 28 | ||
28 | struct sh_mobile_sdhi { | 29 | struct sh_mobile_sdhi { |
29 | struct clk *clk; | 30 | struct clk *clk; |
@@ -50,6 +51,15 @@ static struct mfd_cell sh_mobile_sdhi_cell = { | |||
50 | .resources = sh_mobile_sdhi_resources, | 51 | .resources = sh_mobile_sdhi_resources, |
51 | }; | 52 | }; |
52 | 53 | ||
54 | static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state) | ||
55 | { | ||
56 | struct platform_device *pdev = to_platform_device(tmio->dev.parent); | ||
57 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | ||
58 | |||
59 | if (p && p->set_pwr) | ||
60 | p->set_pwr(pdev, state); | ||
61 | } | ||
62 | |||
53 | static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) | 63 | static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) |
54 | { | 64 | { |
55 | struct sh_mobile_sdhi *priv; | 65 | struct sh_mobile_sdhi *priv; |
@@ -87,6 +97,7 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) | |||
87 | 97 | ||
88 | /* FIXME: silly const unsigned int hclk */ | 98 | /* FIXME: silly const unsigned int hclk */ |
89 | *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk); | 99 | *(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk); |
100 | priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; | ||
90 | 101 | ||
91 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); | 102 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); |
92 | priv->cell_mmc.driver_data = &priv->mmc_data; | 103 | priv->cell_mmc.driver_data = &priv->mmc_data; |