Skip to content

platform/x86: lenovo-yogabook: Modify to also work on Android version

Hans de Goede linux-pwm platform-driver-x86 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 8 repliesIn review
  2. v119 patches 9 repliesSuperseded

Changes in v2 from the cover letter

- Address Andy's review remarks
- Error-exit handling fixes in yogabook_pdev_probe() and yogabook_module_init()
- Explicitly turn off keyboard backlight on suspend

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19pwm: Export pwm_add_table() / pwm_remove_table()drivers/pwm/core.c+2 -00 replies
2/19platform/x86: lenovo-yogabook: Fix work race on remove()drivers/platform/x86/lenovo-yogabook-wmi.c+10 -100 replies
3/19platform/x86: lenovo-yogabook: Reprobe devices on remove()drivers/platform/x86/lenovo-yogabook-wmi.c+11 -00 replies
4/19platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe()drivers/platform/x86/lenovo-yogabook-wmi.c+3 -00 replies
5/19platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanupdrivers/platform/x86/lenovo-yogabook-wmi.c+2 -110 replies
6/19platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS()drivers/platform/x86/lenovo-yogabook-wmi.c+4 -50 replies
7/19platform/x86: lenovo-yogabook: Store dev instead of wdev in drvdata structdrivers/platform/x86/lenovo-yogabook-wmi.c+21 -260 replies
8/19platform/x86: lenovo-yogabook: Add dev local variable to probe()drivers/platform/x86/lenovo-yogabook-wmi.c+12 -120 replies
9/19platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED controldrivers/platform/x86/lenovo-yogabook-wmi.c+21 -420 replies
10/19platform/x86: lenovo-yogabook: Split probe() into generic and WMI specific partsdrivers/platform/x86/lenovo-yogabook-wmi.c+65 -532 replies
11/19platform/x86: lenovo-yogabook: Stop checking adev->power.statedrivers/platform/x86/lenovo-yogabook-wmi.c+5 -100 replies
12/19platform/x86: lenovo-yogabook: Abstract kbd backlight settingdrivers/platform/x86/lenovo-yogabook-wmi.c+8 -50 replies
13/19platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode() helper functiondrivers/platform/x86/lenovo-yogabook-wmi.c+6 -30 replies
14/19platform/x86: lenovo-yogabook: Drop _wmi_ from remaining generic symbolsdrivers/platform/x86/lenovo-yogabook-wmi.c+22 -220 replies
15/19platform/x86: lenovo-yogabook: Group WMI specific code togetherdrivers/platform/x86/lenovo-yogabook-wmi.c+81 -810 replies
16/19platform/x86: lenovo-yogabook: Add YB_KBD_BL_MAX definedrivers/platform/x86/lenovo-yogabook-wmi.c+5 -40 replies
17/19platform/x86: lenovo-yogabook: Add platform driver supportdrivers/platform/x86/lenovo-yogabook-wmi.c+160 -40 replies
18/19platform/x86: lenovo-yogabook: Add keyboard backlight control to platform driverdrivers/platform/x86/lenovo-yogabook-wmi.c+30 -16 replies
19/19platform/x86: lenovo-yogabook: Rename lenovo-yogabook-wmi to lenovo-yogabookdrivers/platform/x86/Kconfig drivers/platform/x86/Makefile drivers/platform/x86/lenovo-yogabook.c+4 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/19] platform/x86: lenovo-yogabook: Modify to also work on Android version

Hi All,

The Lenovo Yoga Book (yb1-x9*) is a yoga 2-in-1 where the keyboard half has a touch keyboard (with a backlit fixed key layout) to make it extra thin and light. The keyboard half can also be switched to an alternative wacom digitizer mode where it instead can be used to draw on. The backlight + switching is handled by
the lenovo-yogabook driver.

There are both Windows and Android versions with different BIOS-es / ACPI tables. This series extends the current Windows model only driver to also support the Android model.

On the Android yb1-x90f/l models there is not ACPI method to control the keyboard backlight brightness. Instead the second PWM controller is exposed directly to the OS there.

This requires adding a pwm_lookup table and the lenovo-yogabook code can (and typically is) build as a module. So the first patch in this series exports pwm_add_table() and pwm_remove_table() for use in modules.

I believe that it is easiest to just merge the entire series through the drivers/platform/x86 tree. Thierry, may I have your ack for patch 1/19 to merge it through the pdx86 tree ?

Changes in v2:
- Address Andy's review remarks
- Error-exit handling fixes in yogabook_pdev_probe() and yogabook_module_init()
- Explicitly turn off keyboard backlight on suspend

Regards,

Hans

Hans de Goede (19):
pwm: Export pwm_add_table() / pwm_remove_table() platform/x86: lenovo-yogabook: Fix work race on remove() platform/x86: lenovo-yogabook: Reprobe devices on remove() platform/x86: lenovo-yogabook: Set default keyboard backligh
brightness on probe()
platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS() platform/x86: lenovo-yogabook: Store dev instead of wdev in drvdata
struct
platform/x86: lenovo-yogabook: Add dev local variable to probe() platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED
control
platform/x86: lenovo-yogabook: Split probe() into generic and WMI
specific parts
platform/x86: lenovo-yogabook: Stop checking adev->power.state platform/x86: lenovo-yogabook: Abstract kbd backlight setting platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode()
helper function
platform/x86: lenovo-yogabook: Drop _wmi_ from remaining generic
symbols
platform/x86: lenovo-yogabook: Group WMI specific code together platform/x86: lenovo-yogabook: Add YB_KBD_BL_MAX define platform/x86: lenovo-yogabook: Add platform driver support platform/x86: lenovo-yogabook: Add keyboard backlight control to
platform driver
platform/x86: lenovo-yogabook: Rename lenovo-yogabook-wmi to
lenovo-yogabook

 drivers/platform/x86/Kconfig               |   6 +-
 drivers/platform/x86/Makefile              |   2 +-
 drivers/platform/x86/lenovo-yogabook-wmi.c | 408 --------------
 drivers/platform/x86/lenovo-yogabook.c     | 585 +++++++++++++++++++++
 drivers/pwm/core.c                         |   2 +
 5 files changed, 591 insertions(+), 412 deletions(-)
 delete mode 100644 drivers/platform/x86/lenovo-yogabook-wmi.c
 create mode 100644 drivers/platform/x86/lenovo-yogabook.c
Signature · 1 line
2.39.2