Battery charge control #23

Closed
opened 2022-08-01 16:59:49 +01:00 by NGnius · 2 comments
NGnius commented 2022-08-01 16:59:49 +01:00 (Migrated from github.com)

Describe what you'd like to be able to do
Control battery charge rate

Describe alternatives you've considered
Live with the battery charging settings as-is. Not great for power users, though.

Additional context
as root, write to /sys/class/hwmon/hwmon5/maximum_battery_charge_rate (max input current in mA). Range is 250 to 2500, default is 2500. If you write 250 here the battery will charge really slowly while still allowing you to play on AC power

to check input current to the battery right now: /sys/class/power_supply/BAT1/current_now (check input current in uA)

(from https://discord.com/channels/865611969661632521/865651345083203644/1003509877915795507 )
I've discussed this with a couple of people before as well, but this is the first time I decided to actually write it down lol

**Describe what you'd like to be able to do** Control battery charge rate **Describe alternatives you've considered** Live with the battery charging settings as-is. Not great for power users, though. **Additional context** as root, write to /sys/class/hwmon/hwmon5/maximum_battery_charge_rate (max input current in mA). Range is 250 to 2500, default is 2500. If you write 250 here the battery will charge really slowly while still allowing you to play on AC power to check input current to the battery right now: /sys/class/power_supply/BAT1/current_now (check input current in uA) (from https://discord.com/channels/865611969661632521/865651345083203644/1003509877915795507 ) I've discussed this with a couple of people before as well, but this is the first time I decided to actually write it down lol
coolbho3k commented 2022-08-01 17:48:22 +01:00 (Migrated from github.com)

Disassembly of the Deck's DSDT ACPI table with the CHGR method: https://gist.github.com/coolbho3k/47e4eeb37c8927ff703c40fab2bb4e11#file-steam_deck_dsdt-dsl-L5270

Writing to maximum_battery_charge_rate calls CHGR with the specified argument.

The disassembly is how I know that only 250 <= x <= 2500 works.

Also see drivers/platform/x86/jupiter.c in the kernel tree, where maximum_battery_charge_rate device is defined.

Disassembly of the Deck's DSDT ACPI table with the `CHGR` method: https://gist.github.com/coolbho3k/47e4eeb37c8927ff703c40fab2bb4e11#file-steam_deck_dsdt-dsl-L5270 Writing to `maximum_battery_charge_rate` calls `CHGR` with the specified argument. The disassembly is how I know that only 250 <= x <= 2500 works. Also see `drivers/platform/x86/jupiter.c` in the kernel tree, where `maximum_battery_charge_rate` device is defined.
NGnius commented 2022-09-01 01:37:52 +01:00 (Migrated from github.com)

Thanks again for the work to figure out this API. It's currently working on the main branch, and will be in the next release version.

Thanks again for the work to figure out this API. It's currently working on the main branch, and will be in the next release version.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: NG-SD-Plugins/PowerTools#23
No description provided.