1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */) // _HID: Hardware ID
6 Name (_UID, Zero) // _UID: Unique ID
7 Name (_PCL, Package (0x01) // _PCL: Power Consumer List
14 // Test if EC0 is ready, and if it is, if the battery is present
15 Method (BTOK, 0, NotSerialized)
26 Method (_STA, 0, NotSerialized) // _STA: Status
29 Printf ("BAT0: _STA: present")
33 Printf ("BAT0: _STA: not present")
37 Name (PBIF, Package (0x0D) // Persistent battery information
39 One, // 0 - Power Unit - mA/mAh
40 0xFFFFFFFF, // 1 - Design Capacity
41 0xFFFFFFFF, // 2 - Last Full Charge Capacity
42 One, // 3 - Battery Technology
43 0xFFFFFFFF, // 4 - Design Voltage
44 Zero, // 5 - Design Capacity of Warning
45 Zero, // 6 - Design Capacity of Low
46 Zero, // 7 - Battery Capacity Granularity 1
47 Zero, // 8 - Battery Capacity Granularity 2
48 "", // 9 - Model Number
49 "", // 10 - Serial Number
50 "", // 11 - Battery Type
51 "" // 12 - OEM Information
54 Method (IVBI, 0, NotSerialized) // Set invalid battery information
67 Method (UPBI, 0, Serialized) // Update battery information
70 Local0 = ^^BTDC // design cap
71 Local1 = ^^BTFC // last full capacity
74 // Last full charge capacity
76 // Warn/low capacities - 15% and 10% of design capacity
77 PBIF [5] = Local1 * 15 / 100
78 PBIF [6] = Local1 * 10 / 100
79 // Granularity is 1% of design capacity
80 PBIF [7] = Local0 / 100
81 PBIF [8] = Local0 / 100
91 Method (_BIF, 0, NotSerialized) // _BIF: Battery Information
97 Name (PBST, Package (0x04) // Persistent battery state
99 Zero, // 0 - Battery state
100 0xFFFFFFFF, // 1 - Battery present rate
101 0xFFFFFFFF, // 2 - Battery remaining capacity
102 0xFFFFFFFF // 3 - Battery present voltage
105 Method (IVBS, 0, NotSerialized) // Invalid battery state
108 PBST [1] = 0xFFFFFFFF
109 PBST [2] = 0xFFFFFFFF
110 PBST [3] = 0xFFFFFFFF
113 Method (UPBS, 0, Serialized)
116 // Status flags - 3 bits; this EC does not report the
117 // charge limiting state
121 // Remaining capacity
131 Method (_BST, 0, NotSerialized) // _BST: Battery Status