mirror of
https://github.com/torvalds/linux.git
synced 2026-10-17 05:52:34 +02:00
The Lenovo Yoga Book 9 14IAH10 ships with a detachable Bluetooth keyboard
that magnetically attaches to the bottom (secondary) screen in one of two
positions. The Embedded Controller tracks the attachment state in a 2-bit
field called BKBD and signals changes via WMI event GUID
806BD2A2-177B-481D-BFB5-3BA0BB4A2285 (notify ID 0xEB on the WM10 ACPI
device, _UID "GMZN").
The device contains embedded BMOF data (WQDD, 20705 bytes) documenting
both WMI interfaces used by this driver:
LENOVO_BTKBD_EVENT (event GUID): WmiDataId(1) uint32 Status.
The ACPI _WED(0xEB) method returns EC.BKBD directly as an integer,
so the notify callback receives BKBD without a separate query.
LENOVO_FEATURE_STATUS_DATA (block GUID, WQAF method): returns an
8-byte buffer {uint32 IDs=0x00060000, uint32 Status=BKBD}.
Used for the initial state read on probe and after resume.
BKBD encoding:
0 = keyboard detached
1 = keyboard docked on top half of bottom screen
2 = keyboard docked on bottom half of bottom screen
3 = reserved (not observed in practice)
This driver registers two WMI drivers sharing a module-level
BLOCKING_NOTIFIER_HEAD:
- The event driver (LENOVO_BTKBD_EVENT) uses .notify_new() to receive
a pre-parsed wmi_buffer and fires the notifier chain with the BKBD
value extracted from the buffer.
- The block driver (LENOVO_FEATURE_STATUS_DATA) owns the input_dev in
its per-device private struct. At probe time it registers a
notifier_block on the chain and reads the initial BKBD state via
wmidev_query_block(). The WMI buffer is parsed as
struct lenovo_feature_status { __le32 id; __le32 status; }, and the
ID field is verified before the status is used.
- SW_TABLET_MODE=1 is reported when the keyboard is detached;
SW_TABLET_MODE=0 when docked in either position (keyboard present).
- The raw BKBD value is exposed via read-only sysfs attribute
"keyboard_position".
- BKBD state is re-read via wmidev_query_block() on resume from
suspend or hibernation.
Tested on: Lenovo Yoga Book 9 14IAH10 (model 83KJ), kernel 7.0.
Acked-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Dave Carey <carvsdriver@gmail.com>
Link: https://patch.msgid.link/20260728225545.1333610-3-carvsdriver@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
293 lines
9.5 KiB
Plaintext
293 lines
9.5 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Lenovo X86 Platform Specific Drivers
|
|
#
|
|
|
|
config IDEAPAD_LAPTOP
|
|
tristate "Lenovo IdeaPad Laptop Extras"
|
|
depends on ACPI
|
|
depends on ACPI_BATTERY
|
|
depends on RFKILL && INPUT
|
|
depends on SERIO_I8042
|
|
depends on BACKLIGHT_CLASS_DEVICE
|
|
depends on ACPI_VIDEO || ACPI_VIDEO = n
|
|
depends on ACPI_WMI || ACPI_WMI = n
|
|
select ACPI_PLATFORM_PROFILE
|
|
select INPUT_SPARSEKMAP
|
|
select NEW_LEDS
|
|
select LEDS_CLASS
|
|
help
|
|
This is a driver for Lenovo IdeaPad netbooks contains drivers for
|
|
rfkill switch, hotkey, fan control and backlight control.
|
|
|
|
config LENOVO_WMI_HOTKEY_UTILITIES
|
|
tristate "Lenovo Hotkey Utility WMI extras driver"
|
|
depends on ACPI_WMI
|
|
select NEW_LEDS
|
|
select LEDS_CLASS
|
|
imply IDEAPAD_LAPTOP
|
|
help
|
|
This driver provides WMI support for Lenovo customized hotkeys function,
|
|
such as LED control for audio/mic mute event for Ideapad, YOGA, XiaoXin,
|
|
Gaming, ThinkBook and so on.
|
|
|
|
config LENOVO_WMI_CAMERA
|
|
tristate "Lenovo WMI Camera Button driver"
|
|
depends on ACPI_WMI
|
|
depends on INPUT
|
|
help
|
|
This driver provides support for Lenovo camera button. The Camera
|
|
button is a GPIO device. This driver receives ACPI notifications when
|
|
the camera button is switched on/off.
|
|
|
|
To compile this driver as a module, choose M here: the module
|
|
will be called lenovo-wmi-camera.
|
|
|
|
config LENOVO_YB9_KBDOCK
|
|
tristate "Lenovo Yoga Book 9 keyboard dock detection"
|
|
depends on ACPI_WMI
|
|
depends on DMI
|
|
depends on INPUT
|
|
help
|
|
Say Y here to enable keyboard dock detection on the Lenovo Yoga Book 9
|
|
14IAH10. The detachable Bluetooth keyboard magnetically attaches to
|
|
either screen; this driver reports SW_TABLET_MODE input events based
|
|
on the attachment state and exposes the raw position in sysfs.
|
|
|
|
To compile this driver as a module, choose M here: the module will be
|
|
called lenovo-yb9-kbdock.
|
|
|
|
config LENOVO_YMC
|
|
tristate "Lenovo Yoga Tablet Mode Control"
|
|
depends on ACPI_WMI
|
|
depends on INPUT
|
|
depends on IDEAPAD_LAPTOP
|
|
select INPUT_SPARSEKMAP
|
|
help
|
|
This driver maps the Tablet Mode Control switch to SW_TABLET_MODE input
|
|
events for Lenovo Yoga notebooks.
|
|
|
|
config THINKPAD_ACPI
|
|
tristate "ThinkPad ACPI Laptop Extras"
|
|
depends on ACPI_EC
|
|
depends on ACPI_BATTERY
|
|
depends on INPUT
|
|
depends on RFKILL || RFKILL = n
|
|
depends on ACPI_VIDEO || ACPI_VIDEO = n
|
|
depends on BACKLIGHT_CLASS_DEVICE
|
|
depends on I2C
|
|
depends on DRM
|
|
select ACPI_PLATFORM_PROFILE
|
|
select DRM_PRIVACY_SCREEN
|
|
select HWMON
|
|
select NVRAM
|
|
select NEW_LEDS
|
|
select LEDS_CLASS
|
|
select INPUT_SPARSEKMAP
|
|
help
|
|
This is a driver for the IBM and Lenovo ThinkPad laptops. It adds
|
|
support for Fn-Fx key combinations, Bluetooth control, video
|
|
output switching, ThinkLight control, UltraBay eject and more.
|
|
For more information about this driver see
|
|
<file:Documentation/admin-guide/laptops/thinkpad-acpi.rst> and
|
|
<http://ibm-acpi.sf.net/> .
|
|
|
|
This driver was formerly known as ibm-acpi.
|
|
|
|
Extra functionality will be available if the rfkill (CONFIG_RFKILL)
|
|
and/or ALSA (CONFIG_SND) subsystems are available in the kernel.
|
|
Note that if you want ThinkPad-ACPI to be built-in instead of
|
|
modular, ALSA and rfkill will also have to be built-in.
|
|
|
|
If you have an IBM or Lenovo ThinkPad laptop, say Y or M here.
|
|
|
|
config THINKPAD_ACPI_ALSA_SUPPORT
|
|
bool "Console audio control ALSA interface"
|
|
depends on THINKPAD_ACPI
|
|
depends on SND
|
|
depends on SND = y || THINKPAD_ACPI = SND
|
|
default y
|
|
help
|
|
Enables monitoring of the built-in console audio output control
|
|
(headphone and speakers), which is operated by the mute and (in
|
|
some ThinkPad models) volume hotkeys.
|
|
|
|
If this option is enabled, ThinkPad-ACPI will export an ALSA card
|
|
with a single read-only mixer control, which should be used for
|
|
on-screen-display feedback purposes by the Desktop Environment.
|
|
|
|
Optionally, the driver will also allow software control (the
|
|
ALSA mixer will be made read-write). Please refer to the driver
|
|
documentation for details.
|
|
|
|
All IBM models have both volume and mute control. Newer Lenovo
|
|
models only have mute control (the volume hotkeys are just normal
|
|
keys and volume control is done through the main HDA mixer).
|
|
|
|
config THINKPAD_ACPI_DEBUGFACILITIES
|
|
bool "Maintainer debug facilities"
|
|
depends on THINKPAD_ACPI
|
|
help
|
|
Enables extra stuff in the thinkpad-acpi which is completely useless
|
|
for normal use. Read the driver source to find out what it does.
|
|
|
|
Say N here, unless you were told by a kernel maintainer to do
|
|
otherwise.
|
|
|
|
config THINKPAD_ACPI_DEBUG
|
|
bool "Verbose debug mode"
|
|
depends on THINKPAD_ACPI
|
|
help
|
|
Enables extra debugging information, at the expense of a slightly
|
|
increase in driver size.
|
|
|
|
If you are not sure, say N here.
|
|
|
|
config THINKPAD_ACPI_UNSAFE_LEDS
|
|
bool "Allow control of important LEDs (unsafe)"
|
|
depends on THINKPAD_ACPI
|
|
help
|
|
Overriding LED state on ThinkPads can mask important
|
|
firmware alerts (like critical battery condition), or misled
|
|
the user into damaging the hardware (undocking or ejecting
|
|
the bay while buses are still active), etc.
|
|
|
|
LED control on the ThinkPad is write-only (with very few
|
|
exceptions on very ancient models), which makes it
|
|
impossible to know beforehand if important information will
|
|
be lost when one changes LED state.
|
|
|
|
Users that know what they are doing can enable this option
|
|
and the driver will allow control of every LED, including
|
|
the ones on the dock stations.
|
|
|
|
Never enable this option on a distribution kernel.
|
|
|
|
Say N here, unless you are building a kernel for your own
|
|
use, and need to control the important firmware LEDs.
|
|
|
|
config THINKPAD_ACPI_VIDEO
|
|
bool "Video output control support"
|
|
depends on THINKPAD_ACPI
|
|
default y
|
|
help
|
|
Allows the thinkpad_acpi driver to provide an interface to control
|
|
the various video output ports.
|
|
|
|
This feature often won't work well, depending on ThinkPad model,
|
|
display state, video output devices in use, whether there is a X
|
|
server running, phase of the moon, and the current mood of
|
|
Schroedinger's cat. If you can use X.org's RandR to control
|
|
your ThinkPad's video output ports instead of this feature,
|
|
don't think twice: do it and say N here to save memory and avoid
|
|
bad interactions with X.org.
|
|
|
|
NOTE: access to this feature is limited to processes with the
|
|
CAP_SYS_ADMIN capability, to avoid local DoS issues in platforms
|
|
where it interacts badly with X.org.
|
|
|
|
If you are not sure, say Y here but do try to check if you could
|
|
be using X.org RandR instead.
|
|
|
|
config THINKPAD_ACPI_HOTKEY_POLL
|
|
bool "Support NVRAM polling for hot keys"
|
|
depends on THINKPAD_ACPI
|
|
default y
|
|
help
|
|
Some thinkpad models benefit from NVRAM polling to detect a few of
|
|
the hot key press events. If you know your ThinkPad model does not
|
|
need to do NVRAM polling to support any of the hot keys you use,
|
|
unselecting this option will save about 1kB of memory.
|
|
|
|
ThinkPads T40 and newer, R52 and newer, and X31 and newer are
|
|
unlikely to need NVRAM polling in their latest BIOS versions.
|
|
|
|
NVRAM polling can detect at most the following keys: ThinkPad/Access
|
|
IBM, Zoom, Switch Display (fn+F7), ThinkLight, Volume up/down/mute,
|
|
Brightness up/down, Display Expand (fn+F8), Hibernate (fn+F12).
|
|
|
|
If you are not sure, say Y here. The driver enables polling only if
|
|
it is strictly necessary to do so.
|
|
|
|
config THINKPAD_LMI
|
|
tristate "Lenovo WMI-based systems management driver"
|
|
depends on ACPI_WMI
|
|
depends on DMI
|
|
select FW_ATTR_CLASS
|
|
help
|
|
This driver allows changing BIOS settings on Lenovo machines whose
|
|
BIOS support the WMI interface.
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
be called think-lmi.
|
|
|
|
config YOGABOOK
|
|
tristate "Lenovo Yoga Book tablet key driver"
|
|
depends on ACPI_WMI
|
|
depends on INPUT
|
|
depends on I2C
|
|
select LEDS_CLASS
|
|
select NEW_LEDS
|
|
help
|
|
Say Y here if you want to support the 'Pen' key and keyboard backlight
|
|
control on the Lenovo Yoga Book tablets.
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
be called lenovo-yogabook.
|
|
|
|
config YT2_1380
|
|
tristate "Lenovo Yoga Tablet 2 1380 fast charge driver"
|
|
depends on SERIAL_DEV_BUS
|
|
depends on EXTCON
|
|
depends on ACPI
|
|
help
|
|
Say Y here to enable support for the custom fast charging protocol
|
|
found on the Lenovo Yoga Tablet 2 1380F / 1380L models.
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
be called lenovo-yogabook.
|
|
|
|
config LENOVO_WMI_CAPDATA
|
|
tristate
|
|
depends on ACPI_WMI
|
|
depends on LENOVO_WMI_HELPERS
|
|
|
|
config LENOVO_WMI_EVENTS
|
|
tristate
|
|
depends on ACPI_WMI
|
|
|
|
config LENOVO_WMI_HELPERS
|
|
tristate
|
|
depends on ACPI_WMI
|
|
|
|
config LENOVO_WMI_GAMEZONE
|
|
tristate "Lenovo GameZone WMI Driver"
|
|
depends on ACPI_WMI
|
|
depends on DMI
|
|
select ACPI_PLATFORM_PROFILE
|
|
select LENOVO_WMI_EVENTS
|
|
select LENOVO_WMI_HELPERS
|
|
help
|
|
Say Y here if you have a WMI aware Lenovo Legion device and would like to use the
|
|
platform-profile firmware interface to manage power usage.
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
be called lenovo-wmi-gamezone.
|
|
|
|
config LENOVO_WMI_TUNING
|
|
tristate "Lenovo Other Mode WMI Driver"
|
|
depends on ACPI_WMI
|
|
depends on ACPI_BATTERY
|
|
select HWMON
|
|
select FW_ATTR_CLASS
|
|
select LENOVO_WMI_CAPDATA
|
|
select LENOVO_WMI_EVENTS
|
|
select LENOVO_WMI_HELPERS
|
|
help
|
|
Say Y here if you have a WMI aware Lenovo Legion device and would like to use the
|
|
firmware_attributes API to control various tunable settings typically exposed by
|
|
Lenovo software in Windows.
|
|
|
|
To compile this driver as a module, choose M here: the module will
|
|
be called lenovo-wmi-other.
|