summaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2017-03-16 08:04:47 -0700
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-30 08:23:18 +0200
commit7c12dfc14cfac31f6273084a2a79a28b3d8ee8e7 (patch)
tree98c38d07693f80abda055bbe5d55fc01f934eb5d /drivers/usb/host
parenta34c5fedf34b8ad95dd34a7324684875a6a64f8c (diff)
downloadbarebox-7c12dfc14cfac31f6273084a2a79a28b3d8ee8e7.tar.gz
barebox-7c12dfc14cfac31f6273084a2a79a28b3d8ee8e7.tar.xz
usb: echi-atmel: Add DT support
Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-atmel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index f075b5080c..1132879c9b 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -65,6 +65,9 @@ static int atmel_ehci_probe(struct device_d *dev)
struct resource *iores;
struct ehci_data data;
struct atmel_ehci_priv *atehci;
+ const char *uclk_name;
+
+ uclk_name = (dev->device_node) ? "usb_clk" : "uhpck";
atehci = xzalloc(sizeof(*atehci));
atehci->dev = dev;
@@ -76,7 +79,7 @@ static int atmel_ehci_probe(struct device_d *dev)
return -ENOENT;
}
- atehci->uclk = clk_get(dev, "uhpck");
+ atehci->uclk = clk_get(dev, uclk_name);
if (IS_ERR(atehci->iclk)) {
dev_err(dev, "Error getting function clock\n");
return -ENOENT;
@@ -107,9 +110,15 @@ static void atmel_ehci_remove(struct device_d *dev)
atmel_stop_clock(dev->priv);
}
+static const struct of_device_id atmel_ehci_dt_ids[] = {
+ { .compatible = "atmel,at91sam9g45-ehci" },
+ { /* sentinel */ }
+};
+
static struct driver_d atmel_ehci_driver = {
.name = "atmel-ehci",
.probe = atmel_ehci_probe,
.remove = atmel_ehci_remove,
+ .of_compatible = DRV_OF_COMPAT(atmel_ehci_dt_ids),
};
device_platform_driver(atmel_ehci_driver);