From: Navon John Lukose <navonjohnlukose@gmail.com>
To: Hans de Goede <hansg@kernel.org>,
Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>,
Sebastian Reichel <sre@kernel.org>
Cc: platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, Jorge Lopez <jorge.lopez2@hp.com>
Subject: [RFC] HP laptop charge mode control via POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR
Date: Mon, 27 Apr 2026 19:38:57 +0530 [thread overview]
Message-ID: <20260427140857.397971-1-navonjohnlukose@gmail.com> (raw)
Hi,
I have been looking at battery charge control on an HP laptop, and I would like
to check the right upstream direction before preparing a patch.
This is not a new userspace ABI. The kernel already has
POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR, and some existing drivers expose charge
modes without exposing charge thresholds. I am trying to confirm whether that is
the right interface for this HP firmware interface, and where the implementation
should live.
On this machine, Linux currently exposes no native battery charge thresholds:
- no charge_control_start_threshold
- no charge_control_end_threshold
The existing HP kernel drivers also do not expose this feature here:
- hp-wmi does not expose battery charge mode control
- hp-bioscfg is present, but does not expose Battery Health Manager or related
battery threshold attributes on this machine
However, the firmware exposes working ACPI methods for charge mode control:
- \SBCC 0x0000 -> normal charging / auto
- \SBCO 0x0500 -> inhibit charge
- \SBCO 0x0200 -> force discharge while on AC
These mappings have been tested from Linux by observing battery and adapter
state transitions:
- auto allows normal charging
- inhibit-charge leaves AC online and reports Not charging / zero current
- force-discharge makes the battery path discharge while AC is connected
My current thinking is:
- expose only POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR
- support AUTO, INHIBIT_CHARGE, and FORCE_DISCHARGE
- do not synthesize charge_control_*_threshold properties in the kernel
- leave policies such as "resume below 75%, stop above 80%" to userspace
For driver placement, this seems HP-specific rather than generic power-supply
logic, so I think it should probably live under drivers/platform/x86/hp/ and
register a power_supply extension on the battery, similar to other platform
drivers that use power_supply_register_extension() from a battery hook.
Does that sound like the right direction?
In particular:
1. Is POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR the right ABI for an HP platform that
appears to expose only mode-based charging control?
2. Should this be implemented as part of an existing HP driver such as hp-wmi,
or as a small new HP-specific driver under drivers/platform/x86/hp/?
3. What should the driver gate support on? For example, should this be gated
by DMI quirks, HP WMI/BIOS GUID presence, ACPI method presence, or some
combination of those?
Thanks,
Navon John Lukose
next reply other threads:[~2026-04-27 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 14:08 Navon John Lukose [this message]
2026-04-27 15:45 ` [RFC] HP laptop charge mode control via POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR Hans de Goede
2026-04-28 14:18 ` Navon John Lukose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260427140857.397971-1-navonjohnlukose@gmail.com \
--to=navonjohnlukose@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jorge.lopez2@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox