diff options
author | Michael Niewöhner <foss@mniewoehner.de> | 2021-12-01 19:09:13 +0100 |
---|---|---|
committer | Michael Niewöhner <foss@mniewoehner.de> | 2022-11-11 22:42:46 +0000 |
commit | e1e65cb0f1cad6117d48503f2f78d115caecc55b (patch) | |
tree | b6d42b3968fd2e6d57062031a48ac65123bb03ca /src/ec/clevo/it5570e/Kconfig | |
parent | 064c6ced40a0acd7c4127414ee04c90b3a458751 (diff) |
ec/clevo/it5570e: add driver for EC used on various Clevo laptops
This adds a driver for the ITE IT5570E EC in combination with Clevo
vendor EC firmware. The interface is mostly identical on various laptop
models. Thus, we have implemented one common driver to support them all.
The following features were implemented:
- Basics like battery, ac, etc.
- Suspend/hibernate support: S0ix, S3*, S4/S5
- Save/restore of keyboard backlight level during S0ix without the need
for Clevo vendor software (ControlCenter)
- Flexicharger
- Fn keys (backlight, volume, airplane etc.)
- Various configuration options via Kconfig / CMOS options
* Note: S3 support works at least on L140CU (Cometlake), but it's not
enabled for this board because S0ix is used.
Not implemented, yet:
- Type-C UCSI: the EC firmware seems to be buggy (with vendor fw, too)
- dGPU support is WIP
An example of how this driver can be hooked up by a board can be seen in
in change CB:59850, where support for the L140MU is added.
Known issues:
- Touchpad toggle:
The touchpad toggle (Fn-F1) has two modes, Ctrl-Alt-F9 mode and
keycodes 0xf7/0xf8 mode. Ctrl-Alt-F9 is the native touchpad toggle
shortcut on Windows. On Linux this would switch to virtual console 9,
if enabled. Thus, one should use the keycodes mode and add udev
rules as specified in [1]. If VT9 is disabled, Ctrl-Alt-F9 mode could
be used to set up a keyboard shortcut command toggling the touchpad.
- Multi-fan systems
The Clevo NV41MZ (w/o dGPU) has two fans that should be in-sync.
However, the second fan does not spin. This needs further
investigation.
[1] https://docs.dasharo.com/variants/clevo_nv41/post_install/
Testing the various functionalities of this EC driver was done in the
changes hooking up this driver for the boards.
Change-Id: Ic8c0bee9002ad9edcd10c83b775fc723744caaa0
Co-authored-by: Michał Kopeć <michal.kopec@3mdeb.com>
Co-authored-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Co-authored-by: Michael Niewöhner <foss@mniewoehner.de>
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68791
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/ec/clevo/it5570e/Kconfig')
-rw-r--r-- | src/ec/clevo/it5570e/Kconfig | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/src/ec/clevo/it5570e/Kconfig b/src/ec/clevo/it5570e/Kconfig new file mode 100644 index 0000000000..8620eb1233 --- /dev/null +++ b/src/ec/clevo/it5570e/Kconfig @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config EC_CLEVO_IT5570E + bool + select EC_ACPI + help + IT5570E embedded controller in Clevo notebooks + +if EC_CLEVO_IT5570E + +config EC_CLEVO_IT5570E_MEM_BASE + hex + help + Memory address for the EC memory region mapped via LGMR + +config EC_CLEVO_IT5570E_AC_FAN_ALWAYS_ON + bool "Fan always on with AC attached" + default n + help + Never turn the fan fully off when AC is attached. + + This setting can be overridden by cmos option `ac_fan_always_on`. + +config EC_CLEVO_IT5570E_KBLED_BOOTEFFECT + bool "Keyboard boot effect" + default n + help + Enable the "breathing" boot effect of the LED keyboard. + + This setting can be overridden by cmos option `kbled_booteffect`. + +config EC_CLEVO_IT5570E_KBLED_TIMEOUT + int "Keyboard backlight timeout" + default 15 + help + Keyboard backlight timeout in seconds. 0 keeps the backlight + always on. + + This setting can be overridden by cmos option `kbled_timeout`. + +config EC_CLEVO_IT5570E_FN_WIN_SWAP + bool "Swap Fn/Windows keys" + default n + help + Swap the Fn and Windows key. + + This setting can be overridden by cmos option `fn_win_swap`. + +config EC_CLEVO_IT5570E_FLEXICHARGER + bool "Flexicharger" + default n + help + Enable the Flexicharger functionality. + + This setting can be overridden by cmos option `flexicharger`. + +if EC_CLEVO_IT5570E_FLEXICHARGER + +config EC_CLEVO_IT5570E_FLEXICHG_START + int "Start charge threshold" + default 95 + help + Start charge threshold in percent. + + This setting can be overridden by cmos option `flexicharger_start`. + +config EC_CLEVO_IT5570E_FLEXICHG_STOP + int "Stop charge threshold" + default 100 + help + Stop charge threshold in percent. + + This setting can be overridden by cmos option `flexicharger_stop`. + +endif + +choice + prompt "Camera default state" + default EC_CLEVO_IT5570E_CAM_BOOT_STATE_KEEP + help + Camera default state. + + This setting can be overridden by cmos option `camera_boot_state`. + +config EC_CLEVO_IT5570E_CAM_BOOT_STATE_KEEP + bool "Keep previous state" + +config EC_CLEVO_IT5570E_CAM_BOOT_STATE_DISABLE + bool "Disable" + +config EC_CLEVO_IT5570E_CAM_BOOT_STATE_ENABLE + bool "Enable" + +endchoice + +config EC_CLEVO_IT5570E_CAM_BOOT_STATE + int + default 0 if EC_CLEVO_IT5570E_CAM_BOOT_STATE_DISABLE + default 1 if EC_CLEVO_IT5570E_CAM_BOOT_STATE_ENABLE + default 2 + +choice + prompt "Touchpad toggle mode" + default EC_CLEVO_IT5570E_TP_TOGGLE_MODE_CTRLALTF9 + help + There are two modes for the touchpad toggle (Fn-F1): + - Ctrl-Alt-F9 mode sends the windows-native touchpad toggle keyboard shortcut. + - Keycode mode sends special key codes f7/f8 which can be configured in udev + to be handled as touchpad toggle. + + This setting can be overridden by cmos option `tp_toggle_mode`. + +config EC_CLEVO_IT5570E_TP_TOGGLE_MODE_CTRLALTF9 + bool "Ctrl-Alt-F9" + +config EC_CLEVO_IT5570E_TP_TOGGLE_MODE_KEYOCDE_F7F8 + bool "Keycode f7/f8" + +endchoice + +config EC_CLEVO_IT5570E_TP_TOGGLE_MODE + int + default 0 if EC_CLEVO_IT5570E_TP_TOGGLE_MODE_CTRLALTF9 + default 1 if EC_CLEVO_IT5570E_TP_TOGGLE_MODE_KEYOCDE_F7F8 + +endif |