mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
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>
This commit is contained in:
parent
c60f55fa1f
commit
be9cd7b6f8
2 changed files with 19 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <linux/mfd/core.h>
|
#include <linux/mfd/core.h>
|
||||||
#include <linux/mfd/tmio.h>
|
#include <linux/mfd/tmio.h>
|
||||||
|
#include <linux/mfd/sh_mobile_sdhi.h>
|
||||||
|
|
||||||
struct sh_mobile_sdhi {
|
struct sh_mobile_sdhi {
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
|
@ -50,6 +51,15 @@ static struct mfd_cell sh_mobile_sdhi_cell = {
|
||||||
.resources = sh_mobile_sdhi_resources,
|
.resources = sh_mobile_sdhi_resources,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state)
|
||||||
|
{
|
||||||
|
struct platform_device *pdev = to_platform_device(tmio->dev.parent);
|
||||||
|
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
|
||||||
|
|
||||||
|
if (p && p->set_pwr)
|
||||||
|
p->set_pwr(pdev, state);
|
||||||
|
}
|
||||||
|
|
||||||
static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
|
static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct sh_mobile_sdhi *priv;
|
struct sh_mobile_sdhi *priv;
|
||||||
|
@ -87,6 +97,7 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* FIXME: silly const unsigned int hclk */
|
/* FIXME: silly const unsigned int hclk */
|
||||||
*(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk);
|
*(unsigned int *)&priv->mmc_data.hclk = clk_get_rate(priv->clk);
|
||||||
|
priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr;
|
||||||
|
|
||||||
memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
|
memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
|
||||||
priv->cell_mmc.driver_data = &priv->mmc_data;
|
priv->cell_mmc.driver_data = &priv->mmc_data;
|
||||||
|
|
8
include/linux/mfd/sh_mobile_sdhi.h
Normal file
8
include/linux/mfd/sh_mobile_sdhi.h
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef __SH_MOBILE_SDHI_H__
|
||||||
|
#define __SH_MOBILE_SDHI_H__
|
||||||
|
|
||||||
|
struct sh_mobile_sdhi_info {
|
||||||
|
void (*set_pwr)(struct platform_device *pdev, int state);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* __SH_MOBILE_SDHI_H__ */
|
Loading…
Reference in a new issue