aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/sh_mobile_sdhi.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-05-19 14:34:16 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-22 03:51:18 -0400
commit056676dabd9f4c69a6adcad208e9aa2ca7241400 (patch)
tree0113922d7128d285e052cd08156f283365ec86df /drivers/mfd/sh_mobile_sdhi.c
parent42a4533976d922ff3272fad17dd52fe3682899dd (diff)
sh: prepare the SDHI MFD driver to pass DMA configuration to tmio_mmc.c
Pass DMA slave IDs from platform down to the tmio_mmc driver, to be used for dmaengine configuration. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/mfd/sh_mobile_sdhi.c')
-rw-r--r--drivers/mfd/sh_mobile_sdhi.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c
index 497f91b6138e..555374db8662 100644
--- a/drivers/mfd/sh_mobile_sdhi.c
+++ b/drivers/mfd/sh_mobile_sdhi.c
@@ -26,11 +26,15 @@
26#include <linux/mfd/core.h> 26#include <linux/mfd/core.h>
27#include <linux/mfd/tmio.h> 27#include <linux/mfd/tmio.h>
28#include <linux/mfd/sh_mobile_sdhi.h> 28#include <linux/mfd/sh_mobile_sdhi.h>
29#include <linux/sh_dma.h>
29 30
30struct sh_mobile_sdhi { 31struct sh_mobile_sdhi {
31 struct clk *clk; 32 struct clk *clk;
32 struct tmio_mmc_data mmc_data; 33 struct tmio_mmc_data mmc_data;
33 struct mfd_cell cell_mmc; 34 struct mfd_cell cell_mmc;
35 struct sh_dmae_slave param_tx;
36 struct sh_dmae_slave param_rx;
37 struct tmio_mmc_dma dma_priv;
34}; 38};
35 39
36static struct resource sh_mobile_sdhi_resources[] = { 40static struct resource sh_mobile_sdhi_resources[] = {
@@ -64,6 +68,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state)
64static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) 68static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
65{ 69{
66 struct sh_mobile_sdhi *priv; 70 struct sh_mobile_sdhi *priv;
71 struct tmio_mmc_data *mmc_data;
72 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
67 struct resource *mem; 73 struct resource *mem;
68 char clk_name[8]; 74 char clk_name[8];
69 int ret, irq; 75 int ret, irq;
@@ -85,6 +91,8 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
85 return -ENOMEM; 91 return -ENOMEM;
86 } 92 }
87 93
94 mmc_data = &priv->mmc_data;
95
88 snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); 96 snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
89 priv->clk = clk_get(&pdev->dev, clk_name); 97 priv->clk = clk_get(&pdev->dev, clk_name);
90 if (IS_ERR(priv->clk)) { 98 if (IS_ERR(priv->clk)) {
@@ -96,12 +104,20 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev)
96 104
97 clk_enable(priv->clk); 105 clk_enable(priv->clk);
98 106
99 priv->mmc_data.hclk = clk_get_rate(priv->clk); 107 mmc_data->hclk = clk_get_rate(priv->clk);
100 priv->mmc_data.set_pwr = sh_mobile_sdhi_set_pwr; 108 mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
101 priv->mmc_data.capabilities = MMC_CAP_MMC_HIGHSPEED; 109 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
110
111 if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) {
112 priv->param_tx.slave_id = p->dma_slave_tx;
113 priv->param_rx.slave_id = p->dma_slave_rx;
114 priv->dma_priv.chan_priv_tx = &priv->param_tx;
115 priv->dma_priv.chan_priv_rx = &priv->param_rx;
116 mmc_data->dma = &priv->dma_priv;
117 }
102 118
103 memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); 119 memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc));
104 priv->cell_mmc.driver_data = &priv->mmc_data; 120 priv->cell_mmc.driver_data = mmc_data;
105 priv->cell_mmc.platform_data = &priv->cell_mmc; 121 priv->cell_mmc.platform_data = &priv->cell_mmc;
106 priv->cell_mmc.data_size = sizeof(priv->cell_mmc); 122 priv->cell_mmc.data_size = sizeof(priv->cell_mmc);
107 123