1 /* SPDX-License-Identifier: GPL-2.0-only */
4 * Arg1: Battery Status Package
8 Method(BSTA, 4, NotSerialized)
21 If (Local2 == 0x8000) {
26 if (Arg3) // discharging
29 Local2 = 0x10000 - Local2
44 Method(BINF, 2, Serialized)
52 Arg0[1] = Local1 // Design Capacity
53 Arg0[2] = Local2 // Last full charge capacity
55 Arg0[4] = BADV // Design Voltage
56 Arg0[5] = Local2 / 20 // Warning capacity
60 Name (SERN, Buffer (0x06) { " " })
66 Local2 -= (Local0 * 0x0A)
67 SERN[Local1] = Local2 + 48
70 Arg0[10] = SERN // Serial Number
72 Name (TYPE, Buffer() { 0, 0, 0, 0, 0 })
75 Arg0[11] = TYPE // Battery type
77 Arg0[12] = BAOE // OEM information
79 Arg0[9] = BANA // Model number
86 Name (_HID, EisaId ("PNP0C0A"))
88 Name (_PCL, Package () { \_SB })
90 Name (BATS, Package ()
92 0x00, // 0: PowerUnit: Report in mWh
93 0xFFFFFFFF, // 1: Design cap
94 0xFFFFFFFF, // 2: Last full charge cap
95 0x01, // 3: Battery Technology
96 10800, // 4: Design Voltage (mV)
97 0x00, // 5: Warning design capacity
98 200, // 6: Low design capacity
100 1, // 8: granularity2
101 "", // 9: Model number
102 "", // A: Serial number
103 "", // B: Battery Type
104 "" // C: OEM information
107 Method (_BIF, 0, NotSerialized)
109 Return (BINF(BATS, 0))
112 Name (BATI, Package ()
117 // Bit 2 - critical state
118 0, // Battery present Rate
119 0, // Battery remaining capacity
120 0 // Battery present voltage
123 Method (_BST, 0, NotSerialized)
126 Return (BSTA(0, BATI, B0CH, B0DI))
132 Method (_STA, 0, NotSerialized)
142 /* Battery attach/detach */
143 Method(_Q40, 0, NotSerialized)
147 Method(_Q41, 0, NotSerialized)
152 Method(_Q48, 0, NotSerialized)
156 Method(_Q4C, 0, NotSerialized)