Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[battery-udev] Enablers for configurable charger types. JB#49693
For example pinephone exposes charger devices in a manner where the name is prefixed with chiptype (e.g. "axp813-ac" / "axp20x-usb"). As mce does not recognize these, both wall charger and pc connection gets treated as "other" type charger - which works to some extent but triggers incorrect UI actions. If direct match for power supply device type / name is not found, try to eliminate chipname prefix so that for example names such as "axp20x-usb" get treated as plain "usb". To future proof things, make it possible to override build-in defaults and heuristics via mce configuration files. Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
- Loading branch information
Showing
4 changed files
with
164 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Configuration file for MCE - udev battery plugin | ||
|
||
[BatteryUDevChargerTypes] | ||
|
||
# Charger type is derived primarily from POWER_SUPPLY_TYPE | ||
# udev attribute, or if such property is not present from | ||
# device name. | ||
|
||
# The built-in defaults are as follows: | ||
|
||
#ac=dcp | ||
#unknown=none | ||
#mains=dcp | ||
#usb_hvdcp=hwdcp | ||
#wireless=wireless | ||
#cdp=cdp | ||
#usb_aca=usb | ||
#usb=usb | ||
#usb_dcp=dcp | ||
#usb_hvdcp_3=hwdcp | ||
#usb_cdp=cdp |
This file contains 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
This file contains 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