From nobody Wed Oct 8 07:09:34 2025 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 129621D88D7; Wed, 2 Jul 2025 03:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751427517; cv=none; b=P6Za6+NQFxj6Qy1RgxHZ+aw2SHSj4Ra6C6IVlkLzmSvvHnVBAyxMZaSVQKx+kBvIF7kTlhdGzwQdaPrEaXPIRQUmqb41alXCaabiNvws19m/Ea7mDs4xw0Qu3oaNLJ/RDXO5M+wdvTSy/0IU6fY+sf3K9AMxD5lCXosSWfhnreM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751427517; c=relaxed/simple; bh=rJl3aFWtlqRs+dqcSti/loEsT2WNTFhQNPWTd8K6laY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i/R6tfE54s/B1VZO0C20R6wIITSu/7LvAPpF2EkDsIsR9i4GWtOJaJWQgqrbV1eY+7B2SxULnfEzhcoroJp9Kg8HVLdE87ZXILPEmNkcRcjaLoD7hbCYTm6PgXUAsQ6kRepZnZKYEM/AE46w1apEdp9NeFer2k4rES5hczgkGtI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Pgscq20p; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Pgscq20p" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-7481600130eso5128751b3a.3; Tue, 01 Jul 2025 20:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751427514; x=1752032314; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Yi+NoAQErcTbWl94DF71VoeBJYcbpe09ipCKXKmsis=; b=Pgscq20pbGoHRjMZu9WtaJ+z8nTQVn1ey2B1Qp4X9nt11ntSUiVcFshdtQMi9DdF5W jKov/uKrm5CsEJBgpB28R0YkJvUev8hXHVzHV+CORBMq9JQCXjw1yOP6qAv/pcHwpRA/ Q7quMJKXLSPLTw9Bsh4VKMhVYv1Wby5IKPEOR8meTQy2hqSCIrllBTBf6dn+7FgWCltr 5Yuo0ZVYaAl6EDMZ+7KeYHANdpxWkbTsGMIXOwEZzzZ9hOUJgidnvzr0t2foFI4UGPFP TsOq/1AHV8vR9laGDZFmZ2N8p5BzwXNmPBDni6U8Ic5lguzIV9G+LLOQFRMCx1/xFfMK 7KjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751427514; x=1752032314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8Yi+NoAQErcTbWl94DF71VoeBJYcbpe09ipCKXKmsis=; b=bAXcqLCzOSjBKg/6mCv3VaY36ZIdxgR5NKMK/SPTtJKm8KxC0fCPwUmqI+uVxdFgxP 8YgM1f4WAuKPfxI+MYI4M7xm1Kmg4Xpp9HVsH9gVbcBsvcBkrXZ7kLuNcS1rNE+NjKbN 4MotWAKYmdJTAXQQ+gtkiU/uCfDG64muvoplPYFTZ8gzend9G29gZjZgzoHg5hyjkH9n cpkwdyQcfCq6s0DeajauVN2fEj9HAAyG7uH0CL9J+m16L4IwvgvCVv5Wkn5FfO+mdqS4 t3Oe2iEEXT7PU3XZ1mkM+iHiU/Wp9bPWV+SEETS8pbPXudxOQxKbDJjIK55oxWykSFx7 PaVw== X-Forwarded-Encrypted: i=1; AJvYcCWlYLKaXl8u2kkfE1PbNBF1KMO/PmqYu3CWpXVIFyFoGI6KBMqEe68t4Kl3x5LlHsbEMR8K81+JszbWYx/Q@vger.kernel.org, AJvYcCWtB5+hcQLQJmvNxrPTmNvwbRedbJDk1eA3m0gjleFyF7dE3LX0tj6cB0pwGQT+ZXn6DSpb+20LR8XIuPZR21PHIvzg4g==@vger.kernel.org, AJvYcCXsc9nex+fZjHniYglmnhh75ls5iDBzjib/uLpUBN40RF9oK1U2DRZ+muko+s2j4P2SL75BKIJHIpU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi1bVe8ubs7kHScpxHPWOR6fUAMCkNFaPekaPi5/+hqQXetPeG IVhKc2l7QlSubjjBl77sDqz7aUEwD5oj9KqCxEehMZA3xPfgwDdYDBweOz02cuwe X-Gm-Gg: ASbGncvEERyH0kCDs1+y2dno6Qr5jc4m91skWy1rvMtOkibOpdI9Juzj9BPY3siIBTc 1M1aKi1E/IUcahAwF3oBB2Q96jVxGVwf16oo22m7Hhikuf8Jkphq7V8JyoOfsbXMoCuor+lgPKE O8YmovWqAB3gvA45HKU+KE1vwDzyfH8epE16bjky37ptP8twNGq2XppROrFo9rsEdhI+O/gjOOz YmK5DDDFBO9nXMP9QxCi9Ik1sgw/jagdNrlhYkOzzG958ANKN5JnpPkhWqBc6zrhzYZ62USP0iL 2VbCzRUeRPxaba9L6tMGzhi8kCaXwSklnlIrH4f5L4ZFD6YIW0C2wEcc5WAYpVh+qCM40oUv4fD 4u/o6T/FQDCPm77Wa0Mkry2I1maugKAwzAiYdzHOGhw== X-Google-Smtp-Source: AGHT+IGosLydtrG301xy3oYUSuaFi1PomDNwgDqEzYXX2BhNkFhix5vpZkIynsZZGYUXT/VGSi2Usg== X-Received: by 2002:a05:6a21:498:b0:21f:83ae:3290 with SMTP id adf61e73a8af0-222d7ef812dmr2026155637.33.1751427514175; Tue, 01 Jul 2025 20:38:34 -0700 (PDT) Received: from bliptop (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b34e301d64fsm11783008a12.19.2025.07.01.20.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jul 2025 20:38:33 -0700 (PDT) From: "Derek J. Clark" To: Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Armin Wolf , Jonathan Corbet , Mario Limonciello , Luke Jones , Xino Ni , Zhixin Zhang , Mia Shao , Mark Pearson , "Pierre-Loup A . Griffais" , "Cody T . H . Chiu" , John Martens , Kurt Borja , "Derek J . Clark" , platform-driver-x86@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Alok Tiwari , Mario Limonciello Subject: [PATCH v13 1/6] platform/x86: Add lenovo-wmi-* driver Documentation Date: Tue, 1 Jul 2025 20:38:21 -0700 Message-ID: <20250702033826.1057762-2-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250702033826.1057762-1-derekjohn.clark@gmail.com> References: <20250702033826.1057762-1-derekjohn.clark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Adds documentation for new lenovo-wmi drivers. Reviewed-by: Alok Tiwari Reviewed-by: Armin Wolf Reviewed-by: Mario Limonciello Signed-off-by: Derek J. Clark --- v13: - Move drivers into new lenovo folder. - Use LENOVO DRIVERS entry in MAKEFILE instead of new entry. v12: No change v11: No change v10: No change v9: No change v8: No change v7: No change v6: - Fix typos and requested rewordings from v5 review. - Rename lenovo-wmi-other-method.rst to lenovo-wmi-other.rst, fixes warining and aligns documentation with driver name. v5: - Fix extra spaces in lenovo-wmi-gamezone.rst. - Fix monospace for GUID's. v4: - Fixed MOF formatting issues. - Fixed spelling mistakes. - Updated description of balanced-performance profile for Gamezone. - Updated description of thermal mode event GUID for Gamezone. v3: - Split documentation into multiple files, one for each parent driver for the Gamezone and Other Mode WMI interfaces. - Add MOF data for all parent and child interfaces. - Remove lenovo-wmi-camera.c driver from v2 documentation. v2: - Update description of Custom Profile to include the need to manually set it. - Remove all references to Legion hardware. - Add section for lenovo-wmi-camera.c driver as it follows the same naming convention. --- --- .../wmi/devices/lenovo-wmi-gamezone.rst | 203 ++++++++++++++++++ .../wmi/devices/lenovo-wmi-other.rst | 108 ++++++++++ MAINTAINERS | 3 + 3 files changed, 314 insertions(+) create mode 100644 Documentation/wmi/devices/lenovo-wmi-gamezone.rst create mode 100644 Documentation/wmi/devices/lenovo-wmi-other.rst diff --git a/Documentation/wmi/devices/lenovo-wmi-gamezone.rst b/Documentat= ion/wmi/devices/lenovo-wmi-gamezone.rst new file mode 100644 index 000000000000..997263e51a7d --- /dev/null +++ b/Documentation/wmi/devices/lenovo-wmi-gamezone.rst @@ -0,0 +1,203 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D +Lenovo WMI Interface Gamezone Driver (lenovo-wmi-gamezone) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D + +Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +The Lenovo WMI gamezone interface is broken up into multiple GUIDs, +The primary "Gamezone" GUID provides advanced features such as fan +profiles and overclocking. It is paired with multiple event GUIDs +and data block GUIDs that provide context for the various methods. + +Gamezone Data +------------- + +WMI GUID ``887B54E3-DDDC-4B2C-8B88-68A26A8835D0`` + +The Gamezone Data WMI interface provides platform-profile and fan curve +settings for devices that fall under the "Gaming Series" of Lenovo devices. +It uses a notifier chain to inform other Lenovo WMI interface drivers of t= he +current platform profile when it changes. + +The following platform profiles are supported: + - low-power + - balanced + - balanced-performance + - performance + - custom + +Balanced-Performance +~~~~~~~~~~~~~~~~~~~~ +Some newer Lenovo "Gaming Series" laptops have an "Extreme Mode" profile +enabled in their BIOS. For these devices, the performance platform profile +corresponds to the BIOS Extreme Mode, while the balanced-performance +platform profile corresponds to the BIOS Performance mode. For legacy +devices, the performance platform profile will correspond with the BIOS +Performance mode. + +For some newer devices the "Extreme Mode" profile is incomplete in the BIOS +and setting it will cause undefined behavior. A BIOS bug quirk table is +provided to ensure these devices cannot set "Extreme Mode" from the driver. + +Custom Profile +~~~~~~~~~~~~~~ +The custom profile represents a hardware mode on Lenovo devices that enabl= es +user modifications to Package Power Tracking (PPT) and fan curve settings. +When an attribute exposed by the Other Mode WMI interface is to be modifie= d, +the Gamezone driver must first be switched to the "custom" profile manuall= y, +or the setting will have no effect. If another profile is set from the list +of supported profiles, the BIOS will override any user PPT settings when +switching to that profile. + +Gamezone Thermal Mode Event +--------------------------- + +WMI GUID ``D320289E-8FEA-41E0-86F9-911D83151B5F`` + +The Gamezone Thermal Mode Event interface notifies the system when the pla= tform +profile has changed, either through the hardware event (Fn+Q for laptops or +Legion + Y for Go Series), or through the Gamezone WMI interface. This eve= nt is +implemented in the Lenovo WMI Events driver (lenovo-wmi-events). + + +WMI interface description +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +The WMI interface description can be decoded from the embedded binary MOF = (bmof) +data using the `bmfdec `_ utility: + +:: + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("LE= NOVO_GAMEZONE_DATA class"), guid("{887B54E3-DDDC-4B2C-8B88-68A26A8835D0}")] + class LENOVO_GAMEZONE_DATA { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiMethodId(4), Implemented, Description("Is SupportGpu OverClock")] = void IsSupportGpuOC([out, Description("Is SupportGpu OverClock")] uint32 Da= ta); + [WmiMethodId(11), Implemented, Description("Get AslCode Version")] voi= d GetVersion ([out, Description("AslCode version")] UINT32 Data); + [WmiMethodId(12), Implemented, Description("Fan cooling capability")] = void IsSupportFanCooling([out, Description("Fan cooling capability")] UINT3= 2 Data); + [WmiMethodId(13), Implemented, Description("Set Fan cooling on/off")] = void SetFanCooling ([in, Description("Set Fan cooling on/off")] UINT32 Data= ); + [WmiMethodId(14), Implemented, Description("cpu oc capability")] void = IsSupportCpuOC ([out, Description("cpu oc capability")] UINT32 Data); + [WmiMethodId(15), Implemented, Description("bios has overclock capabil= ity")] void IsBIOSSupportOC ([out, Description("bios has overclock capabili= ty")] UINT32 Data); + [WmiMethodId(16), Implemented, Description("enable or disable overcloc= k in bios")] void SetBIOSOC ([in, Description("enable or disable overclock = in bios")] UINT32 Data); + [WmiMethodId(18), Implemented, Description("Get CPU temperature")] voi= d GetCPUTemp ([out, Description("Get CPU temperature")] UINT32 Data); + [WmiMethodId(19), Implemented, Description("Get GPU temperature")] voi= d GetGPUTemp ([out, Description("Get GPU temperature")] UINT32 Data); + [WmiMethodId(20), Implemented, Description("Get Fan cooling on/off sta= tus")] void GetFanCoolingStatus ([out, Description("Get Fan cooling on/off = status")] UINT32 Data); + [WmiMethodId(21), Implemented, Description("EC support disable windows= key capability")] void IsSupportDisableWinKey ([out, Description("EC suppo= rt disable windows key capability")] UINT32 Data); + [WmiMethodId(22), Implemented, Description("Set windows key disable/en= able")] void SetWinKeyStatus ([in, Description("Set windows key disable/ena= ble")] UINT32 Data); + [WmiMethodId(23), Implemented, Description("Get windows key disable/en= able status")] void GetWinKeyStatus ([out, Description("Get windows key dis= able/enable status")] UINT32 Data); + [WmiMethodId(24), Implemented, Description("EC support disable touchpa= d capability")] void IsSupportDisableTP ([out, Description("EC support disa= ble touchpad capability")] UINT32 Data); + [WmiMethodId(25), Implemented, Description("Set touchpad disable/enabl= e")] void SetTPStatus ([in, Description("Set touchpad disable/enable")] UIN= T32 Data); + [WmiMethodId(26), Implemented, Description("Get touchpad disable/enabl= e status")] void GetTPStatus ([out, Description("Get touchpad disable/enabl= e status")] UINT32 Data); + [WmiMethodId(30), Implemented, Description("Get Keyboard feature list"= )] void GetKeyboardfeaturelist ([out, Description("Get Keyboard feature lis= t")] UINT32 Data); + [WmiMethodId(31), Implemented, Description("Get Memory OC Information"= )] void GetMemoryOCInfo ([out, Description("Get Memory OC Information")] UI= NT32 Data); + [WmiMethodId(32), Implemented, Description("Water Cooling feature capa= bility")] void IsSupportWaterCooling ([out, Description("Water Cooling feat= ure capability")] UINT32 Data); + [WmiMethodId(33), Implemented, Description("Set Water Cooling status")= ] void SetWaterCoolingStatus ([in, Description("Set Water Cooling status")]= UINT32 Data); + [WmiMethodId(34), Implemented, Description("Get Water Cooling status")= ] void GetWaterCoolingStatus ([out, Description("Get Water Cooling status")= ] UINT32 Data); + [WmiMethodId(35), Implemented, Description("Lighting feature capabilit= y")] void IsSupportLightingFeature ([out, Description("Lighting feature cap= ability")] UINT32 Data); + [WmiMethodId(36), Implemented, Description("Set keyboard light off or = on to max")] void SetKeyboardLight ([in, Description("keyboard light off or= on switch")] UINT32 Data); + [WmiMethodId(37), Implemented, Description("Get keyboard light on/off = status")] void GetKeyboardLight ([out, Description("Get keyboard light on/o= ff status")] UINT32 Data); + [WmiMethodId(38), Implemented, Description("Get Macrokey scan code")] = void GetMacrokeyScancode ([in, Description("Macrokey index")] UINT32 idx, [= out, Description("Scan code")] UINT32 scancode); + [WmiMethodId(39), Implemented, Description("Get Macrokey count")] void= GetMacrokeyCount ([out, Description("Macrokey count")] UINT32 Data); + [WmiMethodId(40), Implemented, Description("Support G-Sync feature")] = void IsSupportGSync ([out, Description("Support G-Sync feature")] UINT32 Da= ta); + [WmiMethodId(41), Implemented, Description("Get G-Sync Status")] void = GetGSyncStatus ([out, Description("Get G-Sync Status")] UINT32 Data); + [WmiMethodId(42), Implemented, Description("Set G-Sync Status")] void = SetGSyncStatus ([in, Description("Set G-Sync Status")] UINT32 Data); + [WmiMethodId(43), Implemented, Description("Support Smart Fan feature"= )] void IsSupportSmartFan ([out, Description("Support Smart Fan feature")] = UINT32 Data); + [WmiMethodId(44), Implemented, Description("Set Smart Fan Mode")] void= SetSmartFanMode ([in, Description("Set Smart Fan Mode")] UINT32 Data); + [WmiMethodId(45), Implemented, Description("Get Smart Fan Mode")] void= GetSmartFanMode ([out, Description("Get Smart Fan Mode")] UINT32 Data); + [WmiMethodId(46), Implemented, Description("Get Smart Fan Setting Mode= ")] void GetSmartFanSetting ([out, Description("Get Smart Setting Mode")] U= INT32 Data); + [WmiMethodId(47), Implemented, Description("Get Power Charge Mode")] v= oid GetPowerChargeMode ([out, Description("Get Power Charge Mode")] UINT32 = Data); + [WmiMethodId(48), Implemented, Description("Get Gaming Product Info")]= void GetProductInfo ([out, Description("Get Gaming Product Info")] UINT32 = Data); + [WmiMethodId(49), Implemented, Description("Over Drive feature capabil= ity")] void IsSupportOD ([out, Description("Over Drive feature capability")= ] UINT32 Data); + [WmiMethodId(50), Implemented, Description("Get Over Drive status")] v= oid GetODStatus ([out, Description("Get Over Drive status")] UINT32 Data); + [WmiMethodId(51), Implemented, Description("Set Over Drive status")] v= oid SetODStatus ([in, Description("Set Over Drive status")] UINT32 Data); + [WmiMethodId(52), Implemented, Description("Set Light Control Owner")]= void SetLightControlOwner ([in, Description("Set Light Control Owner")] UI= NT32 Data); + [WmiMethodId(53), Implemented, Description("Set DDS Control Owner")] v= oid SetDDSControlOwner ([in, Description("Set DDS Control Owner")] UINT32 D= ata); + [WmiMethodId(54), Implemented, Description("Get the flag of restore OC= value")] void IsRestoreOCValue ([in, Description("Clean this flag")] UINT3= 2 idx, [out, Description("Restore oc value flag")] UINT32 Data); + [WmiMethodId(55), Implemented, Description("Get Real Thremal Mode")] v= oid GetThermalMode ([out, Description("Real Thremal Mode")] UINT32 Data); + [WmiMethodId(56), Implemented, Description("Get the OC switch status i= n BIOS")] void GetBIOSOCMode ([out, Description("OC Mode")] UINT32 Data); + [WmiMethodId(59), Implemented, Description("Get hardware info support = version")] void GetHardwareInfoSupportVersion ([out, Description("version")= ] UINT32 Data); + [WmiMethodId(60), Implemented, Description("Get Cpu core 0 max frequen= cy")] void GetCpuFrequency ([out, Description("frequency")] UINT32 Data); + [WmiMethodId(62), Implemented, Description("Check the Adapter type fit= for OC")] void IsACFitForOC ([out, Description("AC check result")] UINT32 = Data); + [WmiMethodId(63), Implemented, Description("Is support IGPU mode")] vo= id IsSupportIGPUMode ([out, Description("IGPU modes")] UINT32 Data); + [WmiMethodId(64), Implemented, Description("Get IGPU Mode Status")] vo= id GetIGPUModeStatus([out, Description("IGPU Mode Status")] UINT32 Data); + [WmiMethodId(65), Implemented, Description("Set IGPU Mode")] void SetI= GPUModeStatus([in, Description("IGPU Mode")] UINT32 mode, [out, Description= ("return code")] UINT32 Data); + [WmiMethodId(66), Implemented, Description("Notify DGPU Status")] void= NotifyDGPUStatus([in, Description("DGPU status")] UINT32 status, [out, Des= cription("return code")] UINT32 Data); + [WmiMethodId(67), Implemented, Description("Is changed Y log")] void I= sChangedYLog([out, Description("Is changed Y Log")] UINT32 Data); + [WmiMethodId(68), Implemented, Description("Get DGPU Hardwawre ID")] v= oid GetDGPUHWId([out, Description("Get DGPU Hardware ID")] string Data); + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("De= finition of CPU OC parameter list"), guid("{B7F3CA0A-ACDC-42D2-9217-77C6C62= 8FBD2}")] + class LENOVO_GAMEZONE_CPU_OC_DATA { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("OC tune id.")] uint32 Tuneid; + [WmiDataId(2), read, Description("Default value.")] uint32 DefaultValu= e; + [WmiDataId(3), read, Description("OC Value.")] uint32 OCValue; + [WmiDataId(4), read, Description("Min Value.")] uint32 MinValue; + [WmiDataId(5), read, Description("Max Value.")] uint32 MaxValue; + [WmiDataId(6), read, Description("Scale Value.")] uint32 ScaleValue; + [WmiDataId(7), read, Description("OC Order id.")] uint32 OCOrderid; + [WmiDataId(8), read, Description("NON-OC Order id.")] uint32 NOCOrderi= d; + [WmiDataId(9), read, Description("Delay time in ms.")] uint32 Interval; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("De= finition of GPU OC parameter list"), guid("{887B54E2-DDDC-4B2C-8B88-68A26A8= 835D0}")] + class LENOVO_GAMEZONE_GPU_OC_DATA { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("P-State ID.")] uint32 PStateID; + [WmiDataId(2), read, Description("CLOCK ID.")] uint32 ClockID; + [WmiDataId(3), read, Description("Default value.")] uint32 defaultvalu= e; + [WmiDataId(4), read, Description("OC Offset freqency.")] uint32 OCOffs= etFreq; + [WmiDataId(5), read, Description("OC Min offset value.")] uint32 OCMin= Offset; + [WmiDataId(6), read, Description("OC Max offset value.")] uint32 OCMax= Offset; + [WmiDataId(7), read, Description("OC Offset Scale.")] uint32 OCOffsetS= cale; + [WmiDataId(8), read, Description("OC Order id.")] uint32 OCOrderid; + [WmiDataId(9), read, Description("NON-OC Order id.")] uint32 NOCOrderi= d; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("Fa= ncooling finish event"), guid("{BC72A435-E8C1-4275-B3E2-D8B8074ABA59}")] + class LENOVO_GAMEZONE_FAN_COOLING_EVENT: WMIEvent { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("Fancooling clean finish event")] uin= t32 EventId; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("Sm= art Fan mode change event"), guid("{D320289E-8FEA-41E0-86F9-611D83151B5F}")] + class LENOVO_GAMEZONE_SMART_FAN_MODE_EVENT: WMIEvent { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("Smart Fan Mode change event")] uint3= 2 mode; + [WmiDataId(2), read, Description("version of FN+Q")] uint32 version; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("Sm= art Fan setting mode change event"), guid("{D320289E-8FEA-41E1-86F9-611D831= 51B5F}")] + class LENOVO_GAMEZONE_SMART_FAN_SETTING_EVENT: WMIEvent { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("Smart Fan Setting mode change event"= )] uint32 mode; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("PO= WER CHARGE MODE Change EVENT"), guid("{D320289E-8FEA-41E0-86F9-711D83151B5F= }")] + class LENOVO_GAMEZONE_POWER_CHARGE_MODE_EVENT: WMIEvent { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("POWER CHARGE MODE Change EVENT")] ui= nt32 mode; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("Th= ermal Mode Real Mode change event"), guid("{D320289E-8FEA-41E0-86F9-911D831= 51B5F}")] + class LENOVO_GAMEZONE_THERMAL_MODE_EVENT: WMIEvent { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description("Thermal Mode Real Mode")] uint32 mod= e; + }; diff --git a/Documentation/wmi/devices/lenovo-wmi-other.rst b/Documentation= /wmi/devices/lenovo-wmi-other.rst new file mode 100644 index 000000000000..d7928b8dfb4b --- /dev/null +++ b/Documentation/wmi/devices/lenovo-wmi-other.rst @@ -0,0 +1,108 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Lenovo WMI Interface Other Mode Driver (lenovo-wmi-other) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Lenovo WMI Other Mode interface is broken up into multiple GUIDs, +The primary Other Mode interface provides advanced power tuning features +such as Package Power Tracking (PPT). It is paired with multiple data block +GUIDs that provide context for the various methods. + + +Other Mode +---------- + +WMI GUID ``DC2A8805-3A8C-41BA-A6F7-092E0089CD3B`` + +The Other Mode WMI interface uses the firmware_attributes class to expose +various WMI attributes provided by the interface in the sysfs. This enables +CPU and GPU power limit tuning as well as various other attributes for +devices that fall under the "Gaming Series" of Lenovo devices. Each +attribute exposed by the Other Mode interface has corresponding +capability data blocks which allow the driver to probe details about the +attribute. Each attribute has multiple pages, one for each of the platform +profiles managed by the Gamezone interface. Attributes are exposed in sysfs +under the following path: + +:: + + /sys/class/firmware-attributes/lenovo-wmi-other/attributes// + +LENOVO_CAPABILITY_DATA_01 +------------------------- + +WMI GUID ``7A8F5407-CB67-4D6E-B547-39B3BE018154`` + +The LENOVO_CAPABILITY_DATA_01 interface provides information on various +power limits of integrated CPU and GPU components. + +Each attribute has the following properties: + - current_value + - default_value + - display_name + - max_value + - min_value + - scalar_increment + - type + +The following attributes are implemented: + - ppt_pl1_spl: Platform Profile Tracking Sustained Power Limit + - ppt_pl2_sppt: Platform Profile Tracking Slow Package Power Tracking + - ppt_pl3_fppt: Platform Profile Tracking Fast Package Power Tracking + + +WMI interface description +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +The WMI interface description can be decoded from the embedded binary MOF = (bmof) +data using the `bmfdec `_ utility: + +:: + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("LE= NOVO_OTHER_METHOD class"), guid("{dc2a8805-3a8c-41ba-a6f7-092e0089cd3b}")] + class LENOVO_OTHER_METHOD { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiMethodId(17), Implemented, Description("Get Feature Value ")] void= GetFeatureValue([in] uint32 IDs, [out] uint32 value); + [WmiMethodId(18), Implemented, Description("Set Feature Value ")] void= SetFeatureValue([in] uint32 IDs, [in] uint32 value); + [WmiMethodId(19), Implemented, Description("Get Data By Command ")] vo= id GetDataByCommand([in] uint32 IDs, [in] uint32 Command, [out] uint32 Data= Size, [out, WmiSizeIs("DataSize")] uint32 Data[]); + [WmiMethodId(99), Implemented, Description("Get Data By Package for TA= C")] void GetDataByPackage([in, Max(40)] uint8 Input[], [out] uint32 DataSi= ze, [out, WmiSizeIs("DataSize")] uint8 Data[]); + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("LE= NOVO CAPABILITY DATA 00"), guid("{362a3afe-3d96-4665-8530-96dad5bb300e}")] + class LENOVO_CAPABILITY_DATA_00 { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description(" IDs.")] uint32 IDs; + [WmiDataId(2), read, Description("Capability.")] uint32 Capability; + [WmiDataId(3), read, Description("Capability Default Value.")] uint32 = DefaultValue; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("LE= NOVO CAPABILITY DATA 01"), guid("{7a8f5407-cb67-4d6e-b547-39b3be018154}")] + class LENOVO_CAPABILITY_DATA_01 { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description(" IDs.")] uint32 IDs; + [WmiDataId(2), read, Description("Capability.")] uint32 Capability; + [WmiDataId(3), read, Description("Default Value.")] uint32 DefaultValu= e; + [WmiDataId(4), read, Description("Step.")] uint32 Step; + [WmiDataId(5), read, Description("Minimum Value.")] uint32 MinValue; + [WmiDataId(6), read, Description("Maximum Value.")] uint32 MaxValue; + }; + + [WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("LE= NOVO CAPABILITY DATA 02"), guid("{bbf1f790-6c2f-422b-bc8c-4e7369c7f6ab}")] + class LENOVO_CAPABILITY_DATA_02 { + [key, read] string InstanceName; + [read] boolean Active; + + [WmiDataId(1), read, Description(" IDs.")] uint32 IDs; + [WmiDataId(2), read, Description("Capability.")] uint32 Capability; + [WmiDataId(3), read, Description("Data Size.")] uint32 DataSize; + [WmiDataId(4), read, Description("Default Value"), WmiSizeIs("DataSize= ")] uint8 DefaultValue[]; + }; diff --git a/MAINTAINERS b/MAINTAINERS index c14614613377..c202c67efa3c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13673,8 +13673,11 @@ F: drivers/usb/misc/legousbtower.c =20 LENOVO drivers M: Mark Pearson +M: Derek J. Clark L: platform-driver-x86@vger.kernel.org S: Maintained +F: Documentation/wmi/devices/lenovo-wmi-gamezone.rst +F: Documentation/wmi/devices/lenovo-wmi-other.rst F: drivers/platform/x86/lenovo/* =20 LENOVO WMI HOTKEY UTILITIES DRIVER --=20 2.50.0