]> git.sur5r.net Git - u-boot/commitdiff
ehci-hcd: Add init_after_reset
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Thu, 31 Mar 2016 21:12:17 +0000 (23:12 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 1 Apr 2016 21:18:08 +0000 (17:18 -0400)
Some host controllers need addidional initialization after ehci_reset()
In non-dm implementation it is possible to use CONFIG_EHCI_HCD_INIT_AFTER_RESET.
This patch adds similar option to ehci drivers using dm.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci.h

index 0113c6c11c2ffca1500c8cc6ff13eb15f05e88ea..598f444504b7e82fe5eb13cc9d50c4bc382e1ebe 100644 (file)
@@ -1615,6 +1615,12 @@ int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
        if (ret)
                goto err;
 
+       if (ops->init_after_reset) {
+               ret = ops->init_after_reset(ctrl);
+               if (ret)
+                       goto err;
+       }
+
        ret = ehci_common_init(ctrl, tweaks);
        if (ret)
                goto err;
index 826b3fe580834ecc505cf74475e717cd90571004..734d7f036278d2bd13e2250252c6b71f799c57e6 100644 (file)
@@ -240,6 +240,7 @@ struct ehci_ops {
        void (*powerup_fixup)(struct ehci_ctrl *ctrl, uint32_t *status_reg,
                              uint32_t *reg);
        uint32_t *(*get_portsc_register)(struct ehci_ctrl *ctrl, int port);
+       int (*init_after_reset)(struct ehci_ctrl *ctrl);
 };
 
 struct ehci_ctrl {