| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
|
| 3 |
Field (ERAM, ByteAcc, Lock, Preserve) |
| 4 |
{ |
| 5 |
Offset (0xBC), |
| 6 |
BTL0, 8, /* BAT0 charging start threshold */ |
| 7 |
BTH0, 8, /* BAT0 charging end threshold */ |
| 8 |
} |
| 9 |
|
| 10 |
/* |
| 11 |
* Get battery charging threshold |
| 12 |
* |
| 13 |
* Arg0: 0: Start threshold |
| 14 |
* 1: Stop threshold |
| 15 |
*/ |
| 16 |
Method (GBCT, 1, NotSerialized) |
| 17 |
{ |
| 18 |
If (Arg0 == 0) { |
| 19 |
Return (BTL0) |
| 20 |
} |
| 21 |
|
| 22 |
If (Arg0 == 1) { |
| 23 |
Return (BTH0) |
| 24 |
} |
| 25 |
|
| 26 |
Return (0xFF) |
| 27 |
} |
| 28 |
|
| 29 |
/* |
| 30 |
* Set battery charging threshold |
| 31 |
* |
| 32 |
* Arg0: 0: Start threshold |
| 33 |
* 1: Stop threshold |
| 34 |
* Arg1: Percentage |
| 35 |
*/ |
| 36 |
Method (SBCT, 2, NotSerialized) |
| 37 |
{ |
| 38 |
If (Arg1 <= 100) { |
| 39 |
If (Arg0 == 0) { |
| 40 |
BTL0 = Arg1 |
| 41 |
} |
| 42 |
If (Arg0 == 1) { |
| 43 |
BTH0 = Arg1 |
| 44 |
} |
| 45 |
} |
| 46 |
} |