Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Battery charge control #23

Closed
NGnius opened this issue Aug 1, 2022 · 2 comments
Closed

Battery charge control #23

NGnius opened this issue Aug 1, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request indev Selected for development; coming soon
Milestone

Comments

@NGnius
Copy link
Owner

NGnius commented Aug 1, 2022

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

@NGnius NGnius added the enhancement New feature or request label Aug 1, 2022
@NGnius NGnius added this to the The upgrade milestone Aug 1, 2022
@NGnius NGnius self-assigned this Aug 1, 2022
@coolbho3k
Copy link

coolbho3k commented Aug 1, 2022

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 NGnius added the indev Selected for development; coming soon label Aug 26, 2022
@NGnius
Copy link
Owner Author

NGnius commented Sep 1, 2022

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.

@NGnius NGnius closed this as completed Sep 1, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement New feature or request indev Selected for development; coming soon
Projects
None yet
Development

No branches or pull requests

2 participants