diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2015-12-22 01:21:03 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-12-31 16:16:29 +0100 |
commit | faa7db24a4b6c1b645dec312a16574442d5adde2 (patch) | |
tree | 7e555277a389ebc566622c0a9910d0513b261b57 /drivers/usb/musb-new/musb_host.c | |
parent | 5253aded464f99734698bffd33c662f1ac071fd0 (diff) |
usb: Move determination of TT hub address/port into separate function
Start split and complete split tokens need the hub address and the
downstream port of the first HS hub (device view).
The core of the function was duplicated in both host/ehci_hcd and
musb-new/usb-compat.h.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/usb/musb-new/musb_host.c')
-rw-r--r-- | drivers/usb/musb-new/musb_host.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/musb-new/musb_host.c b/drivers/usb/musb-new/musb_host.c index 40b9c66af8..70f8a994d1 100644 --- a/drivers/usb/musb-new/musb_host.c +++ b/drivers/usb/musb-new/musb_host.c @@ -2092,9 +2092,13 @@ int musb_urb_enqueue( } #else if (tt_needed(musb, urb->dev)) { - u16 hub_port = find_tt(urb->dev); - qh->h_addr_reg = (u8) (hub_port >> 8); - qh->h_port_reg = (u8) (hub_port & 0xff); + uint8_t portnr = 0; + uint8_t hubaddr = 0; + usb_find_usb2_hub_address_port(urb->dev, + &hubaddr, + &portnr); + qh->h_addr_reg = hubaddr; + qh->h_port_reg = portnr - 1; } #endif } |