diff options
author | Peter Mamonov <pmamonov@gmail.com> | 2015-08-28 14:06:25 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-09-04 08:05:11 +0200 |
commit | 790584b76932d7e8ea8769063ad74d219b0ad53a (patch) | |
tree | a2870a538e17173e111914b8caa43852649877c3 /drivers/usb/host/ehci-hcd.c | |
parent | d192ebe8bb78296d1d86b35cacb7aa3cd5414d7a (diff) | |
download | barebox-790584b76932d7e8ea8769063ad74d219b0ad53a.tar.gz barebox-790584b76932d7e8ea8769063ad74d219b0ad53a.tar.xz |
usb: ehci-hcd: add OF bindings
Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r-- | drivers/usb/host/ehci-hcd.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 25e7a3e520..8b4abeb6bf 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -934,13 +934,18 @@ static int ehci_probe(struct device_d *dev) { struct ehci_data data = {}; struct ehci_platform_data *pdata = dev->platform_data; + struct device_node *dn = dev->device_node; - /* default to EHCI_HAS_TT to not change behaviour of boards - * without platform_data - */ if (pdata) data.flags = pdata->flags; - else + else if (dn) { + data.flags = 0; + if (of_property_read_bool(dn, "has-transaction-translator")) + data.flags |= EHCI_HAS_TT; + } else + /* default to EHCI_HAS_TT to not change behaviour of boards + * without platform_data + */ data.flags = EHCI_HAS_TT; data.hccr = dev_request_mem_region(dev, 0); @@ -961,9 +966,18 @@ static void ehci_remove(struct device_d *dev) ehci_halt(ehci); } +static __maybe_unused struct of_device_id ehci_platform_dt_ids[] = { + { + .compatible = "generic-ehci", + }, { + /* sentinel */ + } +}; + static struct driver_d ehci_driver = { .name = "ehci", .probe = ehci_probe, .remove = ehci_remove, + .of_compatible = DRV_OF_COMPAT(ehci_platform_dt_ids), }; device_platform_driver(ehci_driver); |