xref: /linux/drivers/platform/x86/lenovo/wmi-helpers.h (revision 4c2cd91bff6371b58e672e8791c3bfa70c1b821f)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /* Copyright (C) 2025 Derek J. Clark <derekjohn.clark@gmail.com> */
4 
5 #ifndef _LENOVO_WMI_HELPERS_H_
6 #define _LENOVO_WMI_HELPERS_H_
7 
8 #include <linux/types.h>
9 
10 struct device;
11 struct notifier_block;
12 struct wmi_device;
13 
14 struct wmi_method_args_32 {
15 	u32 arg0;
16 	u32 arg1;
17 };
18 
19 enum lwmi_event_type {
20 	LWMI_GZ_GET_THERMAL_MODE = 0x01,
21 };
22 
23 enum thermal_mode {
24 	LWMI_GZ_THERMAL_MODE_NONE =	   0x00,
25 	LWMI_GZ_THERMAL_MODE_QUIET =	   0x01,
26 	LWMI_GZ_THERMAL_MODE_BALANCED =	   0x02,
27 	LWMI_GZ_THERMAL_MODE_PERFORMANCE = 0x03,
28 	LWMI_GZ_THERMAL_MODE_EXTREME =	   0xE0, /* Ver 6+ */
29 	LWMI_GZ_THERMAL_MODE_CUSTOM =	   0xFF,
30 };
31 
32 int lwmi_dev_evaluate_int(struct wmi_device *wdev, u8 instance, u32 method_id,
33 			  unsigned char *buf, size_t size, u32 *retval);
34 
35 int lwmi_tm_register_notifier(struct notifier_block *nb);
36 int lwmi_tm_unregister_notifier(struct notifier_block *nb);
37 int devm_lwmi_tm_register_notifier(struct device *dev,
38 				   struct notifier_block *nb);
39 int lwmi_tm_notifier_call(enum thermal_mode *mode);
40 
41 #endif /* !_LENOVO_WMI_HELPERS_H_ */
42