summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/lenovo/wmi-helpers.h
blob: 039fe61003ceb9196835b64fce519f91b349c62a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* SPDX-License-Identifier: GPL-2.0-or-later */

/* Copyright (C) 2025 Derek J. Clark <derekjohn.clark@gmail.com> */

#ifndef _LENOVO_WMI_HELPERS_H_
#define _LENOVO_WMI_HELPERS_H_

#include <linux/types.h>

struct device;
struct notifier_block;
struct wmi_device;

struct wmi_method_args_32 {
	u32 arg0;
	u32 arg1;
};

struct dentry *lwmi_debugfs_create_dir(struct wmi_device *wdev);

enum lwmi_event_type {
	LWMI_GZ_GET_THERMAL_MODE = 0x01,
};

enum thermal_mode {
	LWMI_GZ_THERMAL_MODE_NONE =	   0x00,
	LWMI_GZ_THERMAL_MODE_QUIET =	   0x01,
	LWMI_GZ_THERMAL_MODE_BALANCED =	   0x02,
	LWMI_GZ_THERMAL_MODE_PERFORMANCE = 0x03,
	LWMI_GZ_THERMAL_MODE_EXTREME =	   0xE0, /* Ver 6+ */
	LWMI_GZ_THERMAL_MODE_CUSTOM =	   0xFF,
};

int lwmi_dev_evaluate_int(struct wmi_device *wdev, u8 instance, u32 method_id,
			  unsigned char *buf, size_t size, u32 *retval);

int lwmi_tm_register_notifier(struct notifier_block *nb);
int lwmi_tm_unregister_notifier(struct notifier_block *nb);
int devm_lwmi_tm_register_notifier(struct device *dev,
				   struct notifier_block *nb);
int lwmi_tm_notifier_call(enum thermal_mode *mode);

#endif /* !_LENOVO_WMI_HELPERS_H_ */