linux: bypass charging on SM8750#2840
Open
aanze wants to merge 1 commit into
Open
Conversation
Add an SM8750 kernel patch exposing the firmware's USB power-path bypass
through the standard POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR interface on the
sm8550 battmgr variant:
/sys/class/power_supply/battery/charge_behaviour
auto -> charge normally
inhibit-charge -> run from the adapter, leave the battery untouched
The GLINK request reuses qcom_battmgr's existing property helper; only the
opcode (USB_PROPERTY_SET) and property id (14, the vendor 'usb_charge_now'
control) differ. Reverse-engineered from the AYN Odin 3 Android charger
driver (qti_battery_charger) and verified on-device: with inhibit-charge
and the charger online, battery status -> Discharging / current ~0.
The patch is self-contained (only the sm8550 battery psy) and applies to
mainline qcom_battmgr.c unchanged, so it is submittable upstream as-is.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the SM8750 (AYN Odin 3) charger firmware's USB power-path
bypass through the standard POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR
interface on the sm8550 battmgr variant:
/sys/class/power_supply/battery/charge_behaviour
auto -> charge the battery normally
inhibit-charge -> run from the adapter, battery untouched
Reverse-engineered from the Odin 3 Android charger driver
(qti_battery_charger) and verified on-device: with inhibit-charge
and the charger online, battery status goes to Discharging and
current to ~0 while the input stays online.
The change is confined to the sm8550 battery psy, so other battmgr
variants are unaffected.
AI Usage
While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.
Did you use AI tools to help write this code? YES