aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 13:39:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 13:39:26 -0500
commitdb5b0ae00712b5176d7405e7a1dd2bfd6e8f5070 (patch)
tree4e874d81ca9037dda1007178bbc9613649d43305 /drivers/usb
parent6be35c700f742e911ecedd07fcc43d4439922334 (diff)
parent64507dd7028e3e0145077e73b8374bd75aea117c (diff)
Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree conversions and enablement from Olof Johansson: "Continued device tree conversion and enablement across a number of platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other smaller series as well. ux500 has seen continued conversion for platforms. Several platforms have seen pinctrl-via-devicetree conversions for simpler multiplatform. Tegra is adding data for new devices/drivers, and Exynos has a bunch of new bindings and devices added as well. So, pretty much the same progression in the right direction as the last few releases." Fix up conflicts as per Olof. * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (185 commits) ARM: ux500: Rename dbx500 cpufreq code to be more generic ARM: dts: add missing ux500 device trees ARM: ux500: Stop registering the PCM driver from platform code ARM: ux500: Move board specific GPIO info out to subordinate DTS files ARM: ux500: Disable the MMCI gpio-regulator by default ARM: Kirkwood: remove kirkwood_ehci_init() from new boards ARM: Kirkwood: Add support LED of OpenBlocks A6 ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6 ARM: kirkwood: Add NAND partiton map for OpenBlocks A6 ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6 ARM: kirkwood: Add support DT of second I2C bus ARM: kirkwood: Convert mplcec4 board to pinctrl ARM: Kirkwood: Convert km_kirkwood to pinctrl ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl ARM: Kirkwood: Convert IX2-200 to pinctrl. ARM: Kirkwood: Convert lsxl boards to pinctrl. ARM: Kirkwood: Convert ib62x0 to pinctrl. ARM: Kirkwood: Convert GoFlex Net to pinctrl. ARM: Kirkwood: Convert dreamplug to pinctrl. ARM: Kirkwood: Convert dockstar to pinctrl. ...
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-orion.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index f74794c93152..a7d1f5b4c4ed 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -14,6 +14,9 @@
14#include <linux/mbus.h> 14#include <linux/mbus.h>
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/platform_data/usb-ehci-orion.h> 16#include <linux/platform_data/usb-ehci-orion.h>
17#include <linux/of.h>
18#include <linux/of_device.h>
19#include <linux/of_irq.h>
17 20
18#define rdl(off) __raw_readl(hcd->regs + (off)) 21#define rdl(off) __raw_readl(hcd->regs + (off))
19#define wrl(off, val) __raw_writel((val), hcd->regs + (off)) 22#define wrl(off, val) __raw_writel((val), hcd->regs + (off))
@@ -167,6 +170,8 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
167 } 170 }
168} 171}
169 172
173static u64 ehci_orion_dma_mask = DMA_BIT_MASK(32);
174
170static int ehci_orion_drv_probe(struct platform_device *pdev) 175static int ehci_orion_drv_probe(struct platform_device *pdev)
171{ 176{
172 struct orion_ehci_data *pd = pdev->dev.platform_data; 177 struct orion_ehci_data *pd = pdev->dev.platform_data;
@@ -177,13 +182,17 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
177 struct clk *clk; 182 struct clk *clk;
178 void __iomem *regs; 183 void __iomem *regs;
179 int irq, err; 184 int irq, err;
185 enum orion_ehci_phy_ver phy_version;
180 186
181 if (usb_disabled()) 187 if (usb_disabled())
182 return -ENODEV; 188 return -ENODEV;
183 189
184 pr_debug("Initializing Orion-SoC USB Host Controller\n"); 190 pr_debug("Initializing Orion-SoC USB Host Controller\n");
185 191
186 irq = platform_get_irq(pdev, 0); 192 if (pdev->dev.of_node)
193 irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
194 else
195 irq = platform_get_irq(pdev, 0);
187 if (irq <= 0) { 196 if (irq <= 0) {
188 dev_err(&pdev->dev, 197 dev_err(&pdev->dev,
189 "Found HC with no IRQ. Check %s setup!\n", 198 "Found HC with no IRQ. Check %s setup!\n",
@@ -201,6 +210,14 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
201 goto err1; 210 goto err1;
202 } 211 }
203 212
213 /*
214 * Right now device-tree probed devices don't get dma_mask
215 * set. Since shared usb code relies on it, set it here for
216 * now. Once we have dma capability bindings this can go away.
217 */
218 if (!pdev->dev.dma_mask)
219 pdev->dev.dma_mask = &ehci_orion_dma_mask;
220
204 if (!request_mem_region(res->start, resource_size(res), 221 if (!request_mem_region(res->start, resource_size(res),
205 ehci_orion_hc_driver.description)) { 222 ehci_orion_hc_driver.description)) {
206 dev_dbg(&pdev->dev, "controller already in use\n"); 223 dev_dbg(&pdev->dev, "controller already in use\n");
@@ -248,7 +265,12 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
248 /* 265 /*
249 * setup Orion USB controller. 266 * setup Orion USB controller.
250 */ 267 */
251 switch (pd->phy_version) { 268 if (pdev->dev.of_node)
269 phy_version = EHCI_PHY_NA;
270 else
271 phy_version = pd->phy_version;
272
273 switch (phy_version) {
252 case EHCI_PHY_NA: /* dont change USB phy settings */ 274 case EHCI_PHY_NA: /* dont change USB phy settings */
253 break; 275 break;
254 case EHCI_PHY_ORION: 276 case EHCI_PHY_ORION:
@@ -303,9 +325,19 @@ static int __exit ehci_orion_drv_remove(struct platform_device *pdev)
303 325
304MODULE_ALIAS("platform:orion-ehci"); 326MODULE_ALIAS("platform:orion-ehci");
305 327
328static const struct of_device_id ehci_orion_dt_ids[] __devinitdata = {
329 { .compatible = "marvell,orion-ehci", },
330 {},
331};
332MODULE_DEVICE_TABLE(of, ehci_orion_dt_ids);
333
306static struct platform_driver ehci_orion_driver = { 334static struct platform_driver ehci_orion_driver = {
307 .probe = ehci_orion_drv_probe, 335 .probe = ehci_orion_drv_probe,
308 .remove = __exit_p(ehci_orion_drv_remove), 336 .remove = __exit_p(ehci_orion_drv_remove),
309 .shutdown = usb_hcd_platform_shutdown, 337 .shutdown = usb_hcd_platform_shutdown,
310 .driver.name = "orion-ehci", 338 .driver = {
339 .name = "orion-ehci",
340 .owner = THIS_MODULE,
341 .of_match_table = of_match_ptr(ehci_orion_dt_ids),
342 },
311}; 343};