Skip to content

linux: bypass charging on SM8750#2840

Open
aanze wants to merge 1 commit into
ROCKNIX:nextfrom
aanze:sm8750-charge-bypass
Open

linux: bypass charging on SM8750#2840
aanze wants to merge 1 commit into
ROCKNIX:nextfrom
aanze:sm8750-charge-bypass

Conversation

@aanze

@aanze aanze commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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

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>
@github-actions github-actions Bot added the ai-generated This PR was generated or assisted by AI tools label Jun 3, 2026
@aanze aanze changed the title SM8750: bypass charging via charge_behaviour (qcom_battmgr) linux: qcom_battmgr bypass charging on SM8750 Jun 3, 2026
@aanze aanze changed the title linux: qcom_battmgr bypass charging on SM8750 linux: bypass charging on SM8750 Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated This PR was generated or assisted by AI tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant