aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-atmel.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-11-21 23:11:13 -0500
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-03-15 12:40:55 -0400
commit9d843003357f0e4948ac624a99a411a2dc37dfaf (patch)
tree5bb5e299bd5128939309f68f69ce27e957473931 /drivers/usb/host/ehci-atmel.c
parent6a0624599085e9e0c7b984c28443531849ab0459 (diff)
ARM: at91: usb ehci add dt support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-atmel.c')
-rw-r--r--drivers/usb/host/ehci-atmel.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index a5a3ef1f0096..19f318ababa2 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/of_platform.h>
16 17
17/* interface and function clocks */ 18/* interface and function clocks */
18static struct clk *iclk, *fclk; 19static struct clk *iclk, *fclk;
@@ -115,6 +116,8 @@ static const struct hc_driver ehci_atmel_hc_driver = {
115 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, 116 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
116}; 117};
117 118
119static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32);
120
118static int __devinit ehci_atmel_drv_probe(struct platform_device *pdev) 121static int __devinit ehci_atmel_drv_probe(struct platform_device *pdev)
119{ 122{
120 struct usb_hcd *hcd; 123 struct usb_hcd *hcd;
@@ -137,6 +140,13 @@ static int __devinit ehci_atmel_drv_probe(struct platform_device *pdev)
137 goto fail_create_hcd; 140 goto fail_create_hcd;
138 } 141 }
139 142
143 /* Right now device-tree probed devices don't get dma_mask set.
144 * Since shared usb code relies on it, set it here for now.
145 * Once we have dma capability bindings this can go away.
146 */
147 if (!pdev->dev.dma_mask)
148 pdev->dev.dma_mask = &at91_ehci_dma_mask;
149
140 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); 150 hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
141 if (!hcd) { 151 if (!hcd) {
142 retval = -ENOMEM; 152 retval = -ENOMEM;
@@ -225,9 +235,21 @@ static int __devexit ehci_atmel_drv_remove(struct platform_device *pdev)
225 return 0; 235 return 0;
226} 236}
227 237
238#ifdef CONFIG_OF
239static const struct of_device_id atmel_ehci_dt_ids[] = {
240 { .compatible = "atmel,at91sam9g45-ehci" },
241 { /* sentinel */ }
242};
243
244MODULE_DEVICE_TABLE(of, atmel_ehci_dt_ids);
245#endif
246
228static struct platform_driver ehci_atmel_driver = { 247static struct platform_driver ehci_atmel_driver = {
229 .probe = ehci_atmel_drv_probe, 248 .probe = ehci_atmel_drv_probe,
230 .remove = __devexit_p(ehci_atmel_drv_remove), 249 .remove = __devexit_p(ehci_atmel_drv_remove),
231 .shutdown = usb_hcd_platform_shutdown, 250 .shutdown = usb_hcd_platform_shutdown,
232 .driver.name = "atmel-ehci", 251 .driver = {
252 .name = "atmel-ehci",
253 .of_match_table = of_match_ptr(atmel_ehci_dt_ids),
254 },
233}; 255};