1 /* SPDX-License-Identifier: GPL-2.0-only */
5 Name (_HID, DPTF_GEN_DEVICE)
9 Name (_STR, Unicode("Battery Charger"))
20 /* Return charger performance states defined by mainboard */
26 /* Return maximum charger current limit */
29 /* Convert size of PPSS table to index */
30 Local0 = SizeOf (\_SB.CHPS)
33 /* Check if charging is disabled (AC removed) */
34 If (\_SB.PCI0.LPCB.EC0.ACEX == 0) {
35 /* Return last power state */
38 /* Return highest power state */
45 /* Set charger current limit */
48 /* Retrieve Control (index 4) for specified PPSS level */
49 Local0 = DeRefOf (DeRefOf (\_SB.CHPS[ToInteger (Arg0)])[4])
51 /* Pass Control value to EC to limit charging */
52 \_SB.PCI0.LPCB.EC0.CHGS (Local0)
55 /* Initialize charger participant */
58 /* Disable charge limit */
59 \_SB.PCI0.LPCB.EC0.CHGD ()