diff options
author | Jean-Jacques Hiblot <jjhiblot@ti.com> | 2019-09-11 12:33:52 +0300 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2019-10-24 12:28:17 +0300 |
commit | ba6c5f7a28c8f8ac9eae194c2d37afa0ef51cb3d (patch) | |
tree | d9a06db8731dd54086c519fdb5a4b96ce619031b /drivers/usb/dwc3/dwc3-generic.c | |
parent | 1a63e5e5fbfff7779ce24b404bef3b8ccddf1a8b (diff) | |
download | u-boot-ba6c5f7a28c8f8ac9eae194c2d37afa0ef51cb3d.tar.xz |
usb: dwc3: Add dwc3_of_parse() to get quirks information from DT
Add a new function that read quirk and configuration information from the
DT. The goal is to allow platforms using their own version of DWC3 driver
to migrate to the generic DWC3 driver.
The function is adapted from the function dwc3_get_properties() in the
linux dwc3 driver introduced in commit c5ac6116db35d.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-generic.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-generic.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index a3b65088f1..023e95395b 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -48,8 +48,12 @@ static int dwc3_generic_probe(struct udevice *dev, struct dwc3_generic_plat *plat = dev_get_platdata(dev); struct dwc3 *dwc3 = &priv->dwc3; + dwc3->dev = dev; dwc3->maximum_speed = plat->maximum_speed; dwc3->dr_mode = plat->dr_mode; +#if CONFIG_IS_ENABLED(OF_CONTROL) + dwc3_of_parse(dwc3); +#endif rc = dwc3_setup_phy(dev, &priv->phys, &priv->num_phys); if (rc) @@ -57,7 +61,7 @@ static int dwc3_generic_probe(struct udevice *dev, priv->base = map_physmem(plat->base, DWC3_OTG_REGS_END, MAP_NOCACHE); dwc3->regs = priv->base + DWC3_GLOBALS_REGS_START; - dwc3->dev = dev; + rc = dwc3_init(dwc3); if (rc) { |