diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-29 15:09:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-29 15:09:30 -0400 |
commit | 6b2a4f7a5b777ea8fcf3bb38a0a33e68a920a9dc (patch) | |
tree | fcf7d9bddc31974ad046aecd51cc856c68e14cdd /drivers/mfd | |
parent | eefbab599531240adaffa1d23900afbc8b0342bd (diff) | |
parent | 022b483596fabb5d1320aa4b76f43a754063f37e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (26 commits)
mmc: SDHI should depend on SUPERH || ARCH_SHMOBILE
mmc: tmio_mmc: Move some defines into a shared header
mmc: tmio: support aggressive clock gating
mmc: tmio: fix power-mode interpretation
mmc: tmio: remove work-around for unmasked SDIO interrupts
sh: fix SDHI IO address-range
ARM: mach-shmobile: fix SDHI IO address-range
mmc: tmio: only access registers above 0xff, if available
mfd: remove now redundant sh_mobile_sdhi.h header
sh: convert boards to use linux/mmc/sh_mobile_sdhi.h
ARM: mach-shmobile: convert boards to use linux/mmc/sh_mobile_sdhi.h
mmc: tmio: convert the SDHI MMC driver from MFD to a platform driver
sh: ecovec: use the CONFIG_MMC_TMIO symbols instead of MFD
mmc: tmio: split core functionality, DMA and MFD glue
mmc: tmio: use PIO for short transfers
mmc: tmio-mmc: Improve DMA stability on sh-mobile
mmc: fix mmc_app_send_scr() for dma transfer
mmc: sdhci-esdhc: enable esdhc on imx53
mmc: sdhci-esdhc: use writel/readl as general APIs
mmc: sdhci: add the abort CMDTYPE bits definition
...
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/Kconfig | 14 | ||||
-rw-r--r-- | drivers/mfd/Makefile | 1 | ||||
-rw-r--r-- | drivers/mfd/sh_mobile_sdhi.c | 200 |
3 files changed, 0 insertions, 215 deletions
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 9a46d64996a9..e2fea580585a 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -60,15 +60,6 @@ config MFD_ASIC3 | |||
60 | This driver supports the ASIC3 multifunction chip found on many | 60 | This driver supports the ASIC3 multifunction chip found on many |
61 | PDAs (mainly iPAQ and HTC based ones) | 61 | PDAs (mainly iPAQ and HTC based ones) |
62 | 62 | ||
63 | config MFD_SH_MOBILE_SDHI | ||
64 | bool "Support for SuperH Mobile SDHI" | ||
65 | depends on SUPERH || ARCH_SHMOBILE | ||
66 | select MFD_CORE | ||
67 | select TMIO_MMC_DMA | ||
68 | ---help--- | ||
69 | This driver supports the SDHI hardware block found in many | ||
70 | SuperH Mobile SoCs. | ||
71 | |||
72 | config MFD_DAVINCI_VOICECODEC | 63 | config MFD_DAVINCI_VOICECODEC |
73 | tristate | 64 | tristate |
74 | select MFD_CORE | 65 | select MFD_CORE |
@@ -266,11 +257,6 @@ config MFD_TMIO | |||
266 | bool | 257 | bool |
267 | default n | 258 | default n |
268 | 259 | ||
269 | config TMIO_MMC_DMA | ||
270 | bool | ||
271 | select DMA_ENGINE | ||
272 | select DMADEVICES | ||
273 | |||
274 | config MFD_T7L66XB | 260 | config MFD_T7L66XB |
275 | bool "Support Toshiba T7L66XB" | 261 | bool "Support Toshiba T7L66XB" |
276 | depends on ARM && HAVE_CLK | 262 | depends on ARM && HAVE_CLK |
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index ef489f253402..419caa9d7dcf 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile | |||
@@ -6,7 +6,6 @@ | |||
6 | obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o | 6 | obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o |
7 | obj-$(CONFIG_MFD_SM501) += sm501.o | 7 | obj-$(CONFIG_MFD_SM501) += sm501.o |
8 | obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o | 8 | obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o |
9 | obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o | ||
10 | 9 | ||
11 | obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o | 10 | obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o |
12 | obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o | 11 | obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o |
diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c deleted file mode 100644 index 53a63024bf11..000000000000 --- a/drivers/mfd/sh_mobile_sdhi.c +++ /dev/null | |||
@@ -1,200 +0,0 @@ | |||
1 | /* | ||
2 | * SuperH Mobile SDHI | ||
3 | * | ||
4 | * Copyright (C) 2009 Magnus Damm | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Based on "Compaq ASIC3 support": | ||
11 | * | ||
12 | * Copyright 2001 Compaq Computer Corporation. | ||
13 | * Copyright 2004-2005 Phil Blundell | ||
14 | * Copyright 2007-2008 OpenedHand Ltd. | ||
15 | * | ||
16 | * Authors: Phil Blundell <pb@handhelds.org>, | ||
17 | * Samuel Ortiz <sameo@openedhand.com> | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/slab.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/mmc/host.h> | ||
26 | #include <linux/mfd/core.h> | ||
27 | #include <linux/mfd/tmio.h> | ||
28 | #include <linux/mfd/sh_mobile_sdhi.h> | ||
29 | #include <linux/sh_dma.h> | ||
30 | |||
31 | struct sh_mobile_sdhi { | ||
32 | struct clk *clk; | ||
33 | struct tmio_mmc_data mmc_data; | ||
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; | ||
38 | }; | ||
39 | |||
40 | static struct resource sh_mobile_sdhi_resources[] = { | ||
41 | { | ||
42 | .start = 0x000, | ||
43 | .end = 0x1ff, | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }, | ||
46 | { | ||
47 | .start = 0, | ||
48 | .end = 0, | ||
49 | .flags = IORESOURCE_IRQ, | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static struct mfd_cell sh_mobile_sdhi_cell = { | ||
54 | .name = "tmio-mmc", | ||
55 | .num_resources = ARRAY_SIZE(sh_mobile_sdhi_resources), | ||
56 | .resources = sh_mobile_sdhi_resources, | ||
57 | }; | ||
58 | |||
59 | static void sh_mobile_sdhi_set_pwr(struct platform_device *tmio, int state) | ||
60 | { | ||
61 | struct platform_device *pdev = to_platform_device(tmio->dev.parent); | ||
62 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | ||
63 | |||
64 | if (p && p->set_pwr) | ||
65 | p->set_pwr(pdev, state); | ||
66 | } | ||
67 | |||
68 | static int sh_mobile_sdhi_get_cd(struct platform_device *tmio) | ||
69 | { | ||
70 | struct platform_device *pdev = to_platform_device(tmio->dev.parent); | ||
71 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | ||
72 | |||
73 | if (p && p->get_cd) | ||
74 | return p->get_cd(pdev); | ||
75 | else | ||
76 | return -ENOSYS; | ||
77 | } | ||
78 | |||
79 | static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) | ||
80 | { | ||
81 | struct sh_mobile_sdhi *priv; | ||
82 | struct tmio_mmc_data *mmc_data; | ||
83 | struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; | ||
84 | struct resource *mem; | ||
85 | char clk_name[8]; | ||
86 | int ret, irq; | ||
87 | |||
88 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
89 | if (!mem) | ||
90 | dev_err(&pdev->dev, "missing MEM resource\n"); | ||
91 | |||
92 | irq = platform_get_irq(pdev, 0); | ||
93 | if (irq < 0) | ||
94 | dev_err(&pdev->dev, "missing IRQ resource\n"); | ||
95 | |||
96 | if (!mem || (irq < 0)) | ||
97 | return -EINVAL; | ||
98 | |||
99 | priv = kzalloc(sizeof(struct sh_mobile_sdhi), GFP_KERNEL); | ||
100 | if (priv == NULL) { | ||
101 | dev_err(&pdev->dev, "kzalloc failed\n"); | ||
102 | return -ENOMEM; | ||
103 | } | ||
104 | |||
105 | mmc_data = &priv->mmc_data; | ||
106 | |||
107 | snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); | ||
108 | priv->clk = clk_get(&pdev->dev, clk_name); | ||
109 | if (IS_ERR(priv->clk)) { | ||
110 | dev_err(&pdev->dev, "cannot get clock \"%s\"\n", clk_name); | ||
111 | ret = PTR_ERR(priv->clk); | ||
112 | kfree(priv); | ||
113 | return ret; | ||
114 | } | ||
115 | |||
116 | clk_enable(priv->clk); | ||
117 | |||
118 | mmc_data->hclk = clk_get_rate(priv->clk); | ||
119 | mmc_data->set_pwr = sh_mobile_sdhi_set_pwr; | ||
120 | mmc_data->get_cd = sh_mobile_sdhi_get_cd; | ||
121 | mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; | ||
122 | if (p) { | ||
123 | mmc_data->flags = p->tmio_flags; | ||
124 | mmc_data->ocr_mask = p->tmio_ocr_mask; | ||
125 | mmc_data->capabilities |= p->tmio_caps; | ||
126 | } | ||
127 | |||
128 | /* | ||
129 | * All SDHI blocks support 2-byte and larger block sizes in 4-bit | ||
130 | * bus width mode. | ||
131 | */ | ||
132 | mmc_data->flags |= TMIO_MMC_BLKSZ_2BYTES; | ||
133 | |||
134 | /* | ||
135 | * All SDHI blocks support SDIO IRQ signalling. | ||
136 | */ | ||
137 | mmc_data->flags |= TMIO_MMC_SDIO_IRQ; | ||
138 | |||
139 | if (p && p->dma_slave_tx >= 0 && p->dma_slave_rx >= 0) { | ||
140 | priv->param_tx.slave_id = p->dma_slave_tx; | ||
141 | priv->param_rx.slave_id = p->dma_slave_rx; | ||
142 | priv->dma_priv.chan_priv_tx = &priv->param_tx; | ||
143 | priv->dma_priv.chan_priv_rx = &priv->param_rx; | ||
144 | priv->dma_priv.alignment_shift = 1; /* 2-byte alignment */ | ||
145 | mmc_data->dma = &priv->dma_priv; | ||
146 | } | ||
147 | |||
148 | memcpy(&priv->cell_mmc, &sh_mobile_sdhi_cell, sizeof(priv->cell_mmc)); | ||
149 | priv->cell_mmc.mfd_data = mmc_data; | ||
150 | |||
151 | platform_set_drvdata(pdev, priv); | ||
152 | |||
153 | ret = mfd_add_devices(&pdev->dev, pdev->id, | ||
154 | &priv->cell_mmc, 1, mem, irq); | ||
155 | if (ret) { | ||
156 | clk_disable(priv->clk); | ||
157 | clk_put(priv->clk); | ||
158 | kfree(priv); | ||
159 | } | ||
160 | |||
161 | return ret; | ||
162 | } | ||
163 | |||
164 | static int sh_mobile_sdhi_remove(struct platform_device *pdev) | ||
165 | { | ||
166 | struct sh_mobile_sdhi *priv = platform_get_drvdata(pdev); | ||
167 | |||
168 | mfd_remove_devices(&pdev->dev); | ||
169 | clk_disable(priv->clk); | ||
170 | clk_put(priv->clk); | ||
171 | kfree(priv); | ||
172 | |||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | static struct platform_driver sh_mobile_sdhi_driver = { | ||
177 | .driver = { | ||
178 | .name = "sh_mobile_sdhi", | ||
179 | .owner = THIS_MODULE, | ||
180 | }, | ||
181 | .probe = sh_mobile_sdhi_probe, | ||
182 | .remove = __devexit_p(sh_mobile_sdhi_remove), | ||
183 | }; | ||
184 | |||
185 | static int __init sh_mobile_sdhi_init(void) | ||
186 | { | ||
187 | return platform_driver_register(&sh_mobile_sdhi_driver); | ||
188 | } | ||
189 | |||
190 | static void __exit sh_mobile_sdhi_exit(void) | ||
191 | { | ||
192 | platform_driver_unregister(&sh_mobile_sdhi_driver); | ||
193 | } | ||
194 | |||
195 | module_init(sh_mobile_sdhi_init); | ||
196 | module_exit(sh_mobile_sdhi_exit); | ||
197 | |||
198 | MODULE_DESCRIPTION("SuperH Mobile SDHI driver"); | ||
199 | MODULE_AUTHOR("Magnus Damm"); | ||
200 | MODULE_LICENSE("GPL v2"); | ||