1 /* SPDX-License-Identifier: GPL-2.0-only */
3 Field(ERAM, ByteAcc, NoLock, Preserve)
13 Field(ERAM, ByteAcc, Lock, Preserve)
19 Method(SBPC, 0, NotSerialized)
34 Method(SBRW, 2, NotSerialized)
46 Method(SBRB, 2, NotSerialized)
60 Name(_HID, EisaId("PNP0C0A"))
62 Name(_PCL, Package() { \_SB })
66 0x00, // 0: PowerUnit: Report in mWh
67 0xFFFFFFFF, // 1: Design cap
68 0xFFFFFFFF, // 2: Last full charge cap
69 0x01, // 3: Battery Technology
70 10800, // 4: Design Voltage(mV)
71 0x00, // 5: Warning design capacity
72 200, // 6: Low design capacity
73 10, // 7: granularity1
74 10, // 8: granularity2
75 "", // 9: Model number
76 "", // A: Serial number
77 "", // B: Battery Type
78 "" // C: OEM information
86 // Bit 2 - critical state
87 0, // Battery present Rate
88 0, // Battery remaining capacity
89 0 // Battery present voltage
92 Method(_BIF, 0, NotSerialized)
94 BATS[1] = ^^SBRW(0x0B, 0x18) * 10
95 BATS[2] = ^^SBRW(0x0B, 0x10) * 10
97 BATS[4] = ^^SBRW(0x0B, 0x19)
98 BATS[9] = ^^SBRB(0x0B, 0x21)
99 BATS[11] = ^^SBRB(0x0B, 0x22)
100 BATS[12] = ^^SBRB(0x0B, 0x20)
105 Method(_STA, 0, NotSerialized)
107 If (^^SBRW(0x0A, 0x01) & 0x01) {
114 Method(_BST, 0, NotSerialized)
116 /* Check for battery presence. */
117 If (!(^^SBRW(0x0A, 0x01) & 0x01)) {
126 Local1 = ^^SBRW(0x0B, 0x09)
128 Local0 = ^^SBRW(0x0B, 0x0A)
130 /* Sign-extend Local0. */
139 BATI[1] = Local0 / 1000
140 BATI[2] = ^^SBRW(0x0B, 0x0F) * 10
142 If (!(^^SBRW(0x0B, 0x16) & 0x40)) {