1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #if CONFIG(EC_STARLABS_MERLIN)
4 Method (_Q0B, 0, NotSerialized) // Event: Battery Information Update
12 Name (_HID, EisaId("PNP0C0A"))
14 Method (_STA, 0, NotSerialized)
17 // 0x80 BIT1 0x01 = Present
18 // 0x80 BIT1 0x00 = Not Present
19 If (ECRD (RefOf(ECPS)) & 0x02)
26 Name (SBIF, Package (13)
28 1, // 0: Power Unit 0: mWh
30 0xffffffff, // 1: Design Capacity
31 0xffffffff, // 2: Last Full Charge Capacity
32 1, // 3: Battery Technology 0: Primary (non-rechargeable)
33 // 1: Secondary (rechargeable)
34 0xffffffff, // 4: Design Voltage
35 0, // 5: Design capacity of Warning
36 0, // 6: Design capacity of Low
37 0xffffffff, // 7: Battery capacity Decrement Granularity
38 0xffffffff, // 8: Battery capacity Increment Granularity
39 CONFIG_EC_STARLABS_BATTERY_MODEL, // 9: Model Number
40 "Unknown", // 10: Serial Number
41 CONFIG_EC_STARLABS_BATTERY_TYPE, // 11: Battery Type
42 CONFIG_EC_STARLABS_BATTERY_OEM // 12: OEM Information
45 Method (_BIF, 0, NotSerialized)
47 Local0 = ECRD(RefOf(B1DC))
51 SBIF [2] = ECRD(RefOf(B1FC))
55 SBIF [4] = ECRD(RefOf(B1DV))
56 SBIF [5] = Local0 / 5 // 20%
57 SBIF [6] = Local0 / 20 // 5%
58 SBIF [7] = Local0 / 500 // 0.2%
59 SBIF [8] = Local0 / 500 // 0.2%
64 Name (XBIF, Package (21)
66 1, // 0: Revision 0: 3.0
68 1, // 1: Power Unit 0: mWh
70 0xffffffff, // 2: Design Capacity
71 0xffffffff, // 3: Last Full Charge Capacity
72 1, // 4: Battery Technology 0: Primary (non-rechargeable)
73 // 1: Secondary (rechargeable)
74 0xffffffff, // 5: Design Voltage
75 0xffffffff, // 6: Design Capacity of Warning
76 0xffffffff, // 7: Design Capacity of Low
77 0xffffffff, // 8: Cycle Count
78 2, // 9: Measurement Accuracy
79 5000, // 10: Max Sampling Time (ms)
80 1000, // 11: Min Sampling Time (ms)
81 5000, // 12: Max Averaging Interval
82 1000, // 13: Min Averaging Interval
83 0xffffffff, // 14: Battery Capacity Decrement Granularity
84 0xffffffff, // 15: Battery Capacity Increment Granularity
85 CONFIG_EC_STARLABS_BATTERY_MODEL, // 16: Model Number
86 "Unknown", // 17: Serial Number
87 CONFIG_EC_STARLABS_BATTERY_TYPE, // 18: Battery Type
88 CONFIG_EC_STARLABS_BATTERY_OEM, // 19: OEM Information
89 1, // 20: Swapping Capability 0: Non swappable
93 Method (_BIX, 0, NotSerialized)
95 Local0 = ECRD(RefOf(B1DC))
99 XBIF [3] = ECRD(RefOf(B1FC))
103 XBIF [5] = ECRD(RefOf(B1DV))
104 XBIF [6] = Local0 / 5 // 20%
105 XBIF [7] = Local0 / 20 // 5%
106 If (B1CC != 0xffff) {
107 XBIF [8] = ECRD(RefOf(B1CC))
109 XBIF [14] = Local0 / 500 // 0.2%
110 XBIF [15] = Local0 / 500 // 0.2%
115 Name (PKG1, Package (4)
117 0xffffffff, // 0: Battery State
118 0xffffffff, // 1: Battery Present Rate
119 0xffffffff, // 2: Battery Remaining Capacity
120 0xffffffff, // 3: Battery Present Voltage
122 Method (_BST, 0, NotSerialized)
124 PKG1[0] = (ECRD(RefOf(B1ST)) & 0x07)
125 PKG1[1] = ECRD(RefOf(B1PR))
127 Local0 = ECRD(RefOf(B1RC))
128 If (Local0 != 0xffff) {
131 PKG1[2] = (ECRD(RefOf(B1RP)) * ECRD(RefOf(B1DC))) / 100
133 PKG1[3] = ECRD(RefOf(B1PV))
136 Method (_PCL, 0, NotSerialized)