]> git.ipfire.org Git - thirdparty/linux.git/commit
platform/x86: lenovo-wmi-capdata: Wire up Fan Test Data
authorRong Zhang <i@rong.moe>
Tue, 20 Jan 2026 18:20:07 +0000 (02:20 +0800)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 21 Jan 2026 08:49:57 +0000 (10:49 +0200)
commit67d9a39ce85fafc2d88f82c9229ace111aaa8c1f
tree7817f1223119557eb77a2ce655caff810f82f8d5
parent012a8f967a87dea3f25c3a3ae32610c0dd145f34
platform/x86: lenovo-wmi-capdata: Wire up Fan Test Data

A capdata00 attribute (0x04050000) describes the presence of Fan Test
Data. Query it, and bind Fan Test Data as a component of capdata00
accordingly. The component master of capdata00 may pass a callback while
binding to retrieve fan info from Fan Test Data.

Summarizing this scheme:

lenovo-wmi-other <-> capdata00 <-> capdata_fan
|- master            |- component  |
                     |- sub-master |- sub-component

The callback will be called once both the master and the sub-component
are bound to the sub-master (component).

This scheme is essential to solve these issues:
- The component framework only supports one aggregation per master
- A binding is only established until all components are found
- The Fan Test Data interface may be missing on some devices
- To get rid of queries for the presence of WMI GUIDs
- The notifier framework cannot cleanly connect capdata_fan to
  lenovo-wmi-other without introducing assumptions on probing sequence

capdata00 is registered as a component and a sub-master on probe,
instead of chaining the registrations in one's bind callback. This is
because calling (un)registration methods of the component framework
causes deadlock in (un)bind callbacks, i.e., it's impossible to register
capdata00 as a sub-master/component in its component/sub-master bind
callback, and vice versa.

Signed-off-by: Rong Zhang <i@rong.moe>
Reviewed-by: Derek J. Clark <derekjohn.clark@gmail.com>
Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Link: https://patch.msgid.link/20260120182104.163424-7-i@rong.moe
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/lenovo/wmi-capdata.c
drivers/platform/x86/lenovo/wmi-capdata.h
drivers/platform/x86/lenovo/wmi-other.c