Skip to content

Commit cfe7696

Browse files
right-0903sre
authored andcommitted
power: supply: add Huawei Matebook E Go psy driver
On the Huawei Matebook E Go tablet the EC provides access to the adapter and battery status. Add the driver to read power supply status on the tablet. This driver is inspired by the following drivers: drivers/power/supply/lenovo_yoga_c630_battery.c drivers/platform/arm64/acer-aspire1-ec.c drivers/acpi/battery.c drivers/acpi/ac.c base-commit: 613af589b566093ce7388bf3202fca70d742c166 Signed-off-by: Pengyu Luo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent fbc1d05 commit cfe7696

File tree

5 files changed

+684
-0
lines changed

5 files changed

+684
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
What: /sys/class/power_supply/gaokun-ec-battery/smart_charge_delay
2+
Date: March 2025
3+
KernelVersion: 6.15
4+
Contact: Pengyu Luo <[email protected]>
5+
Description:
6+
This entry allows configuration of smart charging delay.
7+
8+
Smart charging behavior: when the power adapter is connected
9+
for delay hours, battery charging will follow the rules of
10+
charge_control_start_threshold and charge_control_end_threshold.
11+
For more information about charge control, please refer to
12+
sysfs-class-power.
13+
14+
Access: Read, Write
15+
16+
Valid values: In hours (non-negative)
17+
18+
What: /sys/class/power_supply/gaokun-ec-battery/battery_adaptive_charge
19+
Date: March 2025
20+
KernelVersion: 6.15
21+
Contact: Pengyu Luo <[email protected]>
22+
Description:
23+
This entry allows enabling battery adaptive charging.
24+
25+
Access: Read, Write
26+
27+
Valid values: 0 (disabled) or 1 (enabled)

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10950,6 +10950,7 @@ M: Pengyu Luo <[email protected]>
1095010950
S: Maintained
1095110951
F: Documentation/devicetree/bindings/platform/huawei,gaokun-ec.yaml
1095210952
F: drivers/platform/arm64/huawei-gaokun-ec.c
10953+
F: drivers/power/supply/huawei-gaokun-battery.c
1095310954
F: include/linux/platform_data/huawei-gaokun-ec.h
1095410955

1095510956
HUGETLB SUBSYSTEM

drivers/power/supply/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ config BATTERY_DS2782
173173
Say Y here to enable support for the DS2782/DS2786 standalone battery
174174
gas-gauge.
175175

176+
config BATTERY_HUAWEI_GAOKUN
177+
tristate "Huawei Matebook E Go power supply"
178+
depends on EC_HUAWEI_GAOKUN
179+
help
180+
This driver enables battery and adapter support on the Huawei Matebook
181+
E Go, which is a sc8280xp-based 2-in-1 tablet.
182+
183+
To compile the driver as a module, choose M here: the module will be
184+
called huawei-gaokun-battery.
185+
176186
config BATTERY_LEGO_EV3
177187
tristate "LEGO MINDSTORMS EV3 battery"
178188
depends on OF && IIO && GPIOLIB && (ARCH_DAVINCI_DA850 || COMPILE_TEST)

drivers/power/supply/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o
3232
obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
3333
obj-$(CONFIG_BATTERY_GAUGE_LTC2941) += ltc2941-battery-gauge.o
3434
obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o
35+
obj-$(CONFIG_BATTERY_HUAWEI_GAOKUN) += huawei-gaokun-battery.o
3536
obj-$(CONFIG_BATTERY_LEGO_EV3) += lego_ev3_battery.o
3637
obj-$(CONFIG_BATTERY_LENOVO_YOGA_C630) += lenovo_yoga_c630_battery.o
3738
obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o

0 commit comments

Comments
 (0)