mainboard/intel/avenuecity_crb: Update full IIO configuration
[coreboot2.git] / src / mainboard / razer / blade_stealth_kbl / acpi / battery.asl
blob8f195550eb3010c46218dfe70c8566b42b1faff5
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 Device (BAT)
5         Name (_HID, EisaId ("PNP0C0A"))
6         Name (_UID, 1)
7         Name (_PCL, Package () { \_SB })
9         Name (BSTP, 0)
11         Name (PBIF, Package () {
12                 0x00000001,  /* 0x00: Power Unit: mAh */
13                 0xFFFFFFFF,  /* 0x01: Design Capacity */
14                 0xFFFFFFFF,  /* 0x02: Last Full Charge Capacity */
15                 0x00000001,  /* 0x03: Battery Technology: Rechargeable */
16                 0xFFFFFFFF,  /* 0x04: Design Voltage */
17                 0x00000003,  /* 0x05: Design Capacity of Warning */
18                 0xFFFFFFFF,  /* 0x06: Design Capacity of Low */
19                 0x00000001,  /* 0x07: Capacity Granularity 1 */
20                 0x00000001,  /* 0x08: Capacity Granularity 2 */
21                 "Razer Blade Stealth",
22                 "SERIAL",
23                 "LiIon",
24                 "Razer"
25         })
28         Name (PBST, Package () {
29                 0x00000000,  /* 0x00: Battery State */
30                 0xFFFFFFFF,  /* 0x01: Battery Present Rate */
31                 0xFFFFFFFF,  /* 0x02: Battery Remaining Capacity */
32                 0xFFFFFFFF,  /* 0x03: Battery Present Voltage */
33         })
35         Method (_STA, 0, Serialized)
36         {
37                 Return (0x1F)
38         }
40         Method (_BIF, 0, Serialized)
41         {
42                 /* Last Full Charge Capacity */
43                 PBIF [2] = BFCP
45                 /* Design Voltage */
46                 PBIF [4] = BDVT
48                 /* Design Capacity */
49                 PBIF [1] = BDCP
51                 /* Design Capacity of Warning */
52                 PBIF [5] = BDCP / 50
54                 /* Design Capacity of Low */
55                 PBIF [6] = BDCP / 100
57                 PBIF [10] = ToString (BSER, Ones)
59                 Return (PBIF)
60         }
62         Method (_BST, 0, Serialized)
63         {
64                 /*
65                  * 0: BATTERY STATE
66                  *
67                  * bit 0 = discharging
68                  * bit 1 = charging
69                  * bit 2 = critical level
70                  */
72                 /* Check if AC is present */
73                 If (ACEX) {
74                         /* Read battery status from EC */
75                         Local0 = BCST
76                 } Else {
77                         /* Always discharging when on battery power */
78                         Local0 = 0x01
79                 }
81                 PBST [0] = Local0
83                 /* Notify if battery state has changed since last time */
84                 If (Local0 != BSTP) {
85                         BSTP = Local0
86                         Notify (BAT, 0x80)
87                 }
89                 /*
90                  * 1: BATTERY PRESENT RATE
91                  */
92                 PBST [1] = BCRT
94                 /*
95                  * 2: BATTERY REMAINING CAPACITY
96                  */
97                 PBST [2] = BRCP
99                 /*
100                  * 3: BATTERY PRESENT VOLTAGE
101                  */
102                 PBST [3] = BCVT
104                 Return (PBST)
105         }