diff options
Diffstat (limited to 'drivers/mfd/sh_mobile_sdhi.c')
-rw-r--r-- | drivers/mfd/sh_mobile_sdhi.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c index 497f91b6138..cd164595f08 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 | ||
30 | struct sh_mobile_sdhi { | 31 | struct 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 | ||
36 | static struct resource sh_mobile_sdhi_resources[] = { | 40 | static struct resource sh_mobile_sdhi_resources[] = { |
@@ -64,6 +68,8 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state) | |||
64 | static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) | 68 | static 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,24 @@ 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 | if (p) { | ||
111 | mmc_data->flags = p->tmio_flags; | ||
112 | mmc_data->ocr_mask = p->tmio_ocr_mask; | ||
113 | } | ||
114 | |||
115 | if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) { | ||
116 | priv->param_tx.slave_id = p->dma_slave_tx; | ||
117 | priv->param_rx.slave_id = p->dma_slave_rx; | ||
118 | priv->dma_priv.chan_priv_tx = &priv->param_tx; | ||
119 | priv->dma_priv.chan_priv_rx = &priv->param_rx; | ||
120 | mmc_data->dma = &priv->dma_priv; | ||
121 | } | ||
102 | 122 | ||
103 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); | 123 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); |
104 | priv->cell_mmc.driver_data = &priv->mmc_data; | 124 | priv->cell_mmc.driver_data = mmc_data; |
105 | priv->cell_mmc.platform_data = &priv->cell_mmc; | 125 | priv->cell_mmc.platform_data = &priv->cell_mmc; |
106 | priv->cell_mmc.data_size = sizeof(priv->cell_mmc); | 126 | priv->cell_mmc.data_size = sizeof(priv->cell_mmc); |
107 | 127 | ||