1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <intelblocks/xhci.h>
6 * USB Port Wake Enable (UPWE) on usb attach/detach
8 * Arg1 - Port 1 Status and control offset
9 * Arg2 - xHCI Memory-mapped address
11 Method (UPWE, 3, Serialized)
13 Local0 = Arg1 + ((Arg0 - 1) * 0x10)
15 /* Map ((XMEM << 16) + Local0 in PSCR */
16 OperationRegion (PSCR, SystemMemory, (Arg2 << 16) + Local0, 0x10)
17 Field (PSCR, DWordAcc, NoLock, Preserve)
22 Local0 &= PORTSCN_BITS_OFF_MASK
23 Local0 |= PORTSCN_WAKE_ON_BOTH_CONNECT_DISCONNECT_ENABLE
28 * USB Wake Enable Setup (UWES)
29 * Arg0 - Port enable bitmap
30 * Arg1 - Port 1 Status and control offset
31 * Arg2 - xHCI Memory-mapped address
33 Method (UWES, 3, Serialized)
38 FindSetRightBit (Local0, Local1)
42 UPWE (Local1, Arg1, Arg2)
44 * Clear the lowest set bit in Local0 since it was
47 Local0 &= (Local0 - 1)