1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 * Poll a GPIO until it goes to the specified state
6 * Arg1 == state (0 or 1)
7 * Arg2 == timeout in ms
9 Method (GPPL, 3, Serialized)
13 While (Local0 < Local1)
15 If (\_SB.PCI0.GRXS (Arg0) == Arg1) {
24 Printf("[ERROR] GPPL for %o timed out", Arg0)
30 /* Convert from 32-bit integer to 4-byte buffer (little-endian) */
33 Local0 = Buffer(4) { 0, 0, 0, 0 }
34 Local0[0] = Arg0 & 0xFF
35 Local0[1] = (Arg0 >> 8) & 0xFF
36 Local0[2] = (Arg0 >> 16) & 0xFF
37 Local0[3] = (Arg0 >> 24) & 0xFF
41 /* Convert from 64-bit integer to 8-byte buffer (little-endian) */
44 Local0 = Buffer(8) { 0, 0, 0, 0, 0, 0, 0, 0 }
45 Local0[0] = Arg0 & 0xFF
46 Local0[1] = (Arg0 >> 8) & 0xFF
47 Local0[2] = (Arg0 >> 16) & 0xFF
48 Local0[3] = (Arg0 >> 24) & 0xFF
49 Local0[4] = (Arg0 >> 32) & 0xFF
50 Local0[5] = (Arg0 >> 40) & 0xFF
51 Local0[6] = (Arg0 >> 48) & 0xFF
52 Local0[7] = (Arg0 >> 56) & 0xFF