Changeset eebecdc in mainline for uspace/drv/bus/usb/uhci/hc.c


Ignore:
Timestamp:
2025-03-13T18:30:36Z (4 months ago)
Author:
Miroslav Cimerman <mc@…>
Children:
e3e53cc
Parents:
e494d7b (diff), da54714 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge upstream/master into helenraid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    re494d7b reebecdc  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jan Vesely
    34 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek
     
    267268}
    268269
     270/** Quiesce host controller.
     271 *
     272 * @param[in] instance Host controller structure to use.
     273 */
     274int hc_quiesce(hc_device_t *hcd)
     275{
     276        hc_t *instance = hcd_to_hc(hcd);
     277        uhci_regs_t *registers = instance->registers;
     278
     279        /* Reset everything, who knows what touched it before us */
     280        pio_write_16(&registers->usbcmd, UHCI_CMD_GLOBAL_RESET);
     281        fibril_usleep(50000); /* 50ms according to USB spec(root hub reset) */
     282        pio_write_16(&registers->usbcmd, 0);
     283
     284        /* Reset hc, all states and counters. Hope that hw is not broken */
     285        pio_write_16(&registers->usbcmd, UHCI_CMD_HCRESET);
     286        do {
     287                fibril_usleep(10);
     288        } while ((pio_read_16(&registers->usbcmd) & UHCI_CMD_HCRESET) != 0);
     289
     290        return EOK;
     291}
     292
    269293/** Initialize UHCI hc hw resources.
    270294 *
Note: See TracChangeset for help on using the changeset viewer.