diff options
author | Tom Rini <trini@konsulko.com> | 2017-07-11 14:21:50 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-07-11 14:21:50 -0400 |
commit | d43ef73bf26614af9b01fd57baa1a1fcf24bfade (patch) | |
tree | e37eac34d78100d69ac984525f98186d1e68d0b7 /drivers/usb/host/dwc2.c | |
parent | 6b26aaef083957b75bcd69aa65bd6ffcf9245bb3 (diff) | |
parent | 2454b719fb874120e06e4aa64bfb9450d091e56c (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'drivers/usb/host/dwc2.c')
-rw-r--r-- | drivers/usb/host/dwc2.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c index 841e596700c..64c42ac4715 100644 --- a/drivers/usb/host/dwc2.c +++ b/drivers/usb/host/dwc2.c @@ -43,6 +43,10 @@ struct dwc2_priv { struct dwc2_core_regs *regs; int root_hub_devnum; bool ext_vbus; + /* + * The hnp/srp capability must be disabled if the platform + * does't support hnp/srp. Otherwise the force mode can't work. + */ bool hnp_srp_disable; bool oc_disable; }; @@ -1239,7 +1243,6 @@ static int dwc2_submit_int_msg(struct udevice *dev, struct usb_device *udev, static int dwc2_usb_ofdata_to_platdata(struct udevice *dev) { struct dwc2_priv *priv = dev_get_priv(dev); - const void *prop; fdt_addr_t addr; addr = devfdt_get_addr(dev); @@ -1247,15 +1250,8 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev) return -EINVAL; priv->regs = (struct dwc2_core_regs *)addr; - prop = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), - "disable-over-current", NULL); - if (prop) - priv->oc_disable = true; - - prop = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), - "hnp-srp-disable", NULL); - if (prop) - priv->hnp_srp_disable = true; + priv->oc_disable = dev_read_bool(dev, "disable-over-current"); + priv->hnp_srp_disable = dev_read_bool(dev, "hnp-srp-disable"); return 0; } |