diff options
author | Vivek Gautam <gautam.vivek@samsung.com> | 2012-07-16 01:55:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-16 20:16:17 -0400 |
commit | d51389306f598d635c55e72f42609b543efd9469 (patch) | |
tree | 7d9f6b4c0b86badd5a54da76773a7c852f3eaf71 /drivers/usb/host/ohci-exynos.c | |
parent | ba5952e0711b14d8d4fe172671f8aa6091ace3ee (diff) |
USB: ohci-exynos: Add support for device tree
This patch adds support to parse probe data for
ohci driver for exynos using device tree.
Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-exynos.c')
-rw-r--r-- | drivers/usb/host/ohci-exynos.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 8bcbdb5ade2d..fc3091bd2379 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c | |||
@@ -12,6 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/clk.h> | 14 | #include <linux/clk.h> |
15 | #include <linux/of.h> | ||
15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
16 | #include <mach/ohci.h> | 17 | #include <mach/ohci.h> |
17 | #include <plat/usb-phy.h> | 18 | #include <plat/usb-phy.h> |
@@ -71,6 +72,8 @@ static const struct hc_driver exynos_ohci_hc_driver = { | |||
71 | .start_port_reset = ohci_start_port_reset, | 72 | .start_port_reset = ohci_start_port_reset, |
72 | }; | 73 | }; |
73 | 74 | ||
75 | static u64 ohci_exynos_dma_mask = DMA_BIT_MASK(32); | ||
76 | |||
74 | static int __devinit exynos_ohci_probe(struct platform_device *pdev) | 77 | static int __devinit exynos_ohci_probe(struct platform_device *pdev) |
75 | { | 78 | { |
76 | struct exynos4_ohci_platdata *pdata; | 79 | struct exynos4_ohci_platdata *pdata; |
@@ -87,6 +90,16 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev) | |||
87 | return -EINVAL; | 90 | return -EINVAL; |
88 | } | 91 | } |
89 | 92 | ||
93 | /* | ||
94 | * Right now device-tree probed devices don't get dma_mask set. | ||
95 | * Since shared usb code relies on it, set it here for now. | ||
96 | * Once we move to full device tree support this will vanish off. | ||
97 | */ | ||
98 | if (!pdev->dev.dma_mask) | ||
99 | pdev->dev.dma_mask = &ohci_exynos_dma_mask; | ||
100 | if (!pdev->dev.coherent_dma_mask) | ||
101 | pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
102 | |||
90 | exynos_ohci = devm_kzalloc(&pdev->dev, sizeof(struct exynos_ohci_hcd), | 103 | exynos_ohci = devm_kzalloc(&pdev->dev, sizeof(struct exynos_ohci_hcd), |
91 | GFP_KERNEL); | 104 | GFP_KERNEL); |
92 | if (!exynos_ohci) | 105 | if (!exynos_ohci) |
@@ -256,6 +269,14 @@ static const struct dev_pm_ops exynos_ohci_pm_ops = { | |||
256 | .resume = exynos_ohci_resume, | 269 | .resume = exynos_ohci_resume, |
257 | }; | 270 | }; |
258 | 271 | ||
272 | #ifdef CONFIG_OF | ||
273 | static const struct of_device_id exynos_ohci_match[] = { | ||
274 | { .compatible = "samsung,exynos-ohci" }, | ||
275 | {}, | ||
276 | }; | ||
277 | MODULE_DEVICE_TABLE(of, exynos_ohci_match); | ||
278 | #endif | ||
279 | |||
259 | static struct platform_driver exynos_ohci_driver = { | 280 | static struct platform_driver exynos_ohci_driver = { |
260 | .probe = exynos_ohci_probe, | 281 | .probe = exynos_ohci_probe, |
261 | .remove = __devexit_p(exynos_ohci_remove), | 282 | .remove = __devexit_p(exynos_ohci_remove), |
@@ -264,6 +285,7 @@ static struct platform_driver exynos_ohci_driver = { | |||
264 | .name = "exynos-ohci", | 285 | .name = "exynos-ohci", |
265 | .owner = THIS_MODULE, | 286 | .owner = THIS_MODULE, |
266 | .pm = &exynos_ohci_pm_ops, | 287 | .pm = &exynos_ohci_pm_ops, |
288 | .of_match_table = of_match_ptr(exynos_ohci_match), | ||
267 | } | 289 | } |
268 | }; | 290 | }; |
269 | 291 | ||