Skip to content

Commit 7636f09

Browse files
right-0903ij-intel
authored andcommitted
platform: arm64: add Huawei Matebook E Go EC driver
There are three variants of which Huawei released the first two simultaneously. Huawei Matebook E Go LTE(sc8180x), codename seems to be gaokun2. Huawei Matebook E Go([email protected]), codename must be gaokun3. (see [1]) Huawei Matebook E Go 2023([email protected]), codename should be also gaokun3. Adding support for the latter two variants for now, this driver should also work for the sc8180x variant according to acpi table files, but I don't have the device to test yet. Different from other Qualcomm Snapdragon sc8280xp based machines, the Huawei Matebook E Go uses an embedded controller while others use a system called PMIC GLink. This embedded controller can be used to perform a set of various functions, including, but not limited to: - Battery and charger monitoring; - Charge control and smart charge; - Fn_lock settings; - Tablet lid status; - Temperature sensors; - USB Type-C notifications (ports orientation, DP alt mode HPD); - USB Type-C PD (according to observation, up to 48w). Add a driver for the EC which creates devices for UCSI and power supply devices. This driver is inspired by the following drivers: drivers/platform/arm64/acer-aspire1-ec.c drivers/platform/arm64/lenovo-yoga-c630.c drivers/platform/x86/huawei-wmi.c Also thanks for reviewers' working. They have made this patch improve a lot. [1] https://bugzilla.kernel.org/show_bug.cgi?id=219645 Signed-off-by: Pengyu Luo <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent defcf2f commit 7636f09

File tree

5 files changed

+933
-0
lines changed

5 files changed

+933
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10698,6 +10698,13 @@ S: Maintained
1069810698
F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
1069910699
F: drivers/net/ethernet/huawei/hinic/
1070010700

10701+
HUAWEI MATEBOOK E GO EMBEDDED CONTROLLER DRIVER
10702+
M: Pengyu Luo <[email protected]>
10703+
S: Maintained
10704+
F: Documentation/devicetree/bindings/platform/huawei,gaokun-ec.yaml
10705+
F: drivers/platform/arm64/huawei-gaokun-ec.c
10706+
F: include/linux/platform_data/huawei-gaokun-ec.h
10707+
1070110708
HUGETLB SUBSYSTEM
1070210709
M: Muchun Song <[email protected]>
1070310710

drivers/platform/arm64/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,27 @@ config EC_ACER_ASPIRE1
3333
laptop where this information is not properly exposed via the
3434
standard ACPI devices.
3535

36+
config EC_HUAWEI_GAOKUN
37+
tristate "Huawei Matebook E Go Embedded Controller driver"
38+
depends on ARCH_QCOM || COMPILE_TEST
39+
depends on I2C
40+
depends on INPUT
41+
depends on HWMON
42+
select AUXILIARY_BUS
43+
44+
help
45+
Say Y here to enable the EC driver for the Huawei Matebook E Go
46+
which is a sc8280xp-based 2-in-1 tablet. The driver handles battery
47+
(information, charge control) and USB Type-C DP HPD events as well
48+
as some misc functions like the lid sensor and temperature sensors,
49+
etc.
50+
51+
This driver provides battery and AC status support for the mentioned
52+
laptop where this information is not properly exposed via the
53+
standard ACPI devices.
54+
55+
Say M or Y here to include this support.
56+
3657
config EC_LENOVO_YOGA_C630
3758
tristate "Lenovo Yoga C630 Embedded Controller driver"
3859
depends on ARCH_QCOM || COMPILE_TEST

drivers/platform/arm64/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
#
77

88
obj-$(CONFIG_EC_ACER_ASPIRE1) += acer-aspire1-ec.o
9+
obj-$(CONFIG_EC_HUAWEI_GAOKUN) += huawei-gaokun-ec.o
910
obj-$(CONFIG_EC_LENOVO_YOGA_C630) += lenovo-yoga-c630.o

0 commit comments

Comments
 (0)