commonlib: Add new "ESE completed AUnit loading" TS
[coreboot2.git] / src / ec / roda / it8518 / acpi / battery.asl
blobf164587102a08e23dca98f1d4fea591541cdd435
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 //SCOPE EC0
5 Device (BAT0)
7         Name (_HID, EISAID ("PNP0C0A"))
8         Name (_UID, 1)
9         Name (_PCL, Package () { \_SB })
12         //
13         // Default Static Battery Information
14         //
15         Name (PBIF, Package (13)
16         {
17                 1,              //  0: Power Unit
18                 4800,           //  1: Design Capacity
19                 4650,           //  2: Last Full Charge Capacity
20                 1,              //  3: Battery Technology(Rechargeable)
21                 12608,          //  4: Design Voltage 10.8V
22                 0,              //  5: Design capacity of warning
23                 0,              //  6: Design capacity of low
24                 0,              //  7: Battery capacity granularity 1
25                 0,              //  8: Battery capacity granularity 2
26                 "BAT0",         //  9: Model Number
27                 "RT672",        // 10: Serial Number
28                 "LiON",         // 11: Battery Type
29                 "ASP"           // 12: OEM Information
30         })
33         Name (PBST, Package (4)
34         {
35                 0x00000000,     // Battery State
36                 0xffffffff,     // Battery Present Rate
37                 0xffffffff,     // Battery Remaining Capacity
38                 0xffffffff,     // Battery Present Voltage
39         })
42         // Battery Slot Status
43         Method (_STA, 0, Serialized)
44         {
45                 Printf ("-----> BAT0: _STA")
47                 Local0 = 0x0f
49                 Local1 = ECPS & 0x02
50                 If (Local1 == 0x02)
51                 {
52                         Local0 = 0x1f
53                 }
55                 Printf ("<----- BAT0: _STA")
57                 Return (Local0)
58         }
60         Method (_BIF, 0, Serialized)
61         {
62                 Printf ("-----> BAT0: _BIF")
64                 PBIF[2] = B0FC
65                 PBIF[5] = (B0FC * 6) / 100
66                 PBIF[6] = (B0FC * 3) / 100
68                 Printf ("<----- BAT0: _BIF")
70                 Return (PBIF)
71         }
73         Method (_BST, 0, Serialized)
74         {
75                 Printf ("-----> BAT0: _BST")
77                 Local0 = B0ST & 0x40
78                 If (Local0 == 0x40)
79                 {
80                         If (PWRS == 1)
81                         {
82                                 PBST[0] = 0x00
83                         }
84                         Else
85                         {
86                                 PBST[0] = 0x01
87                         }
88                 }
89                 Else
90                 {
91                         PBST[0] = 0x02
92                 }
94                 Local1 = B0AC
95                 If (Local1 >= 0x8000)
96                 {
97                         Local1 = 0x00010000 - Local1
98                 }
100                 PBST[1] = Local1
101                 PBST[2] = B0RC
102                 PBST[3] = B0VT
104                 Printf ("<----- BAT0: _BST")
106                 Return (PBST)
107         }