1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, EisaId ("PNP0C0A") /* Control Method Battery */)
7 Name (_PCL, Package (0x01) // _PCL: Power Consumer List
12 Method (_STA, 0, NotSerialized)
14 If (^^PCI0.LPCB.EC0.ECOK)
16 If (^^PCI0.LPCB.EC0.BAT0)
31 Name (PBIF, Package (0x0D)
34 0xFFFFFFFF, // 1 - Design Capacity
35 0xFFFFFFFF, // 2 - Last Full Charge Capacity
36 1, // 3 - Battery Technology
37 0x39D0, // 4 - Design Voltage
38 0, // 5 - Design Capacity of Warning
39 0, // 6 - Design Capacity of Low
40 0x40, // 7 - Battery Capacity Granularity 1
41 0x40, // 8 - Battery Capacity Granularity 2
42 "BAT", // 9 - Model Number
43 "0001", // 10 - Serial Number
44 "LION", // 11 - Battery Type
45 "Notebook" // 12 - OEM Information
47 Method (IVBI, 0, NotSerialized)
59 Method (UPBI, 0, NotSerialized)
61 If (^^PCI0.LPCB.EC0.BAT0)
63 Local0 = (^^PCI0.LPCB.EC0.BDC0 & 0xFFFF)
65 Local0 = (^^PCI0.LPCB.EC0.BFC0 & 0xFFFF)
68 Local0 = (^^PCI0.LPCB.EC0.BDV0 & 0xFFFF)
70 Local0 = (^^PCI0.LPCB.EC0.BCW0 & 0xFFFF)
72 Local0 = (^^PCI0.LPCB.EC0.BCL0 & 0xFFFF)
77 PBIF [12] = "Notebook"
85 Method (_BIF, 0, NotSerialized) // _BIF: Battery Information
87 If (^^PCI0.LPCB.EC0.ECOK)
96 Return (PBIF) /* \_SB_.BAT0.PBIF */
99 Name (PBST, Package (0x04)
101 0, // 0 - Battery state
102 0xFFFFFFFF, // 1 - Battery present rate
103 0xFFFFFFFF, // 2 - Battery remaining capacity
104 0x3D90 // 3 - Battery present voltage
106 Method (IVBS, 0, NotSerialized)
109 PBST [1] = 0xFFFFFFFF
110 PBST [2] = 0xFFFFFFFF
114 Method (UPBS, 0, NotSerialized)
116 If (^^PCI0.LPCB.EC0.BAT0)
122 If (((^^PCI0.LPCB.EC0.BST0 & 0x02) == 0x02))
125 Local1 = (^^PCI0.LPCB.EC0.BPR0 & 0xFFFF)
131 Local1 = (^^PCI0.LPCB.EC0.BPR0 & 0xFFFF)
134 Local7 = (Local1 & 0x8000)
135 If ((Local7 == 0x8000))
140 Local2 = (^^PCI0.LPCB.EC0.BRC0 & 0xFFFF)
141 Local3 = (^^PCI0.LPCB.EC0.BPV0 & 0xFFFF)
146 If ((BFCC != ^^PCI0.LPCB.EC0.BFC0))
148 Notify (BAT0, 0x81) // Information Change
157 Method (_BST, 0, NotSerialized) // _BST: Battery Status
159 If (^^PCI0.LPCB.EC0.ECOK)
168 Return (PBST) /* \_SB_.BAT0.PBST */