Changeset 9dfb034 in mainline for uspace/drv/bus/usb/ohci/hc.c


Ignore:
Timestamp:
2025-03-04T17:35:28Z (34 hours ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
89b5a75, 94ea2e3
Parents:
77a0119
Message:

Implement quiesce for EHCI and OHCI.

File:
1 edited

Legend:

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

    r77a0119 r9dfb034  
    11/*
     2 * Copyright (c) 2025 Jiri Svoboda
    23 * Copyright (c) 2011 Jan Vesely
    34 * Copyright (c) 2018 Ondrej Hlavaty
     
    196197}
    197198
     199/** Quiesce host controller
     200 *
     201 * @param hcd Host controller device
     202 */
     203int hc_quiesce(hc_device_t *hcd)
     204{
     205        hc_t *instance = hcd_to_hc(hcd);
     206
     207        /* OHCI guide page 42 */
     208        usb_log_debug2("Started hc initialization routine.");
     209
     210        /* Reset hc */
     211        usb_log_debug2("HC reset.");
     212        size_t time = 0;
     213        OHCI_WR(instance->registers->command_status, CS_HCR);
     214        while (OHCI_RD(instance->registers->command_status) & CS_HCR) {
     215                fibril_usleep(10);
     216                time += 10;
     217        }
     218        usb_log_debug2("HC reset complete in %zu us.", time);
     219
     220        return EOK;
     221}
     222
    198223void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep)
    199224{
Note: See TracChangeset for help on using the changeset viewer.