blob: 7c7f62fb57127c08f021220b541fb39de19561bb [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001Device (TCHG)
2{
3 Name (_HID, "INT3403")
4 Name (_UID, 0)
5 Name (PTYP, 0x0B)
6 Name (_STR, Unicode("Battery Charger"))
7
8 Method (_STA)
9 {
10 If (LEqual (\DPTE, One)) {
11 Return (0xF)
12 } Else {
13 Return (0x0)
14 }
15 }
16
17 /* Return charger performance states defined by mainboard */
18 Method (PPSS)
19 {
20 Return (\_SB.CHPS)
21 }
22
23 /* Return maximum charger current limit */
24 Method (PPPC)
25 {
26 /* Convert size of PPSS table to index */
27 Store (SizeOf (\_SB.CHPS), Local0)
28 Decrement (Local0)
29
30 /* Check if charging is disabled (AC removed) */
31 If (LEqual (\PWRS, Zero)) {
32 /* Return last power state */
33 Return (Local0)
34 } Else {
35 /* Return highest power state */
36 Return (0)
37 }
38
39 Return (0)
40 }
41
42 /* Set charger current limit */
43 Method (SPPC, 1)
44 {
45 /* Retrieve Control (index 4) for specified PPSS level */
46 Store (DeRefOf (Index (DeRefOf (Index
47 (\_SB.CHPS, ToInteger (Arg0))), 4)), Local0)
48
49 /* Pass Control value to EC to limit charging */
50 \_SB.PCI0.LPCB.EC0.CHGS (Local0)
51 }
52
53 /* Initialize charger participant */
54 Method (INIT)
55 {
56 /* Disable charge limit */
57 \_SB.PCI0.LPCB.EC0.CHGD ()
58 }
59}