Skip to content

Commit cab1c65

Browse files
pastaq1Naim
authored andcommitted
platform/x86: lenovo-wmi-helpers: Move gamezone enums to wmi-helpers
In a later patch in the series the thermal mode enum will be accessed across three separate drivers (wmi-capdata, wmi-gamezonem and wmi-other). An additional patch in the series will also add a function protoype that needs to reference this enum in wmi-helpers.h To avoid having all these drivers begin to import each others headers, and to avoid declaring an opaque enum to hande the second case, move the thermal mode enum to helpers where it can be safely accessed by everything that needs it from a single import. While at it, since the gamezone_events_type enum is the only remaining item in the header, move that as well and remove the gamezone header entirely. Reviewed-by: Rong Zhang <i@rong.moe> Tested-by: Rong Zhang <i@rong.moe> Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
1 parent fe087a8 commit cab1c65

5 files changed

Lines changed: 15 additions & 25 deletions

File tree

drivers/platform/x86/lenovo/wmi-events.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <linux/wmi.h>
1818

1919
#include "wmi-events.h"
20-
#include "wmi-gamezone.h"
20+
#include "wmi-helpers.h"
2121

2222
#define THERMAL_MODE_EVENT_GUID "D320289E-8FEA-41E0-86F9-911D83151B5F"
2323

drivers/platform/x86/lenovo/wmi-gamezone.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <linux/wmi.h>
2222

2323
#include "wmi-events.h"
24-
#include "wmi-gamezone.h"
2524
#include "wmi-helpers.h"
2625

2726
#define LENOVO_GAMEZONE_GUID "887B54E3-DDDC-4B2C-8B88-68A26A8835D0"

drivers/platform/x86/lenovo/wmi-gamezone.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

drivers/platform/x86/lenovo/wmi-helpers.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ struct wmi_method_args_32 {
1616
u32 arg1;
1717
};
1818

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+
1932
int lwmi_dev_evaluate_int(struct wmi_device *wdev, u8 instance, u32 method_id,
2033
unsigned char *buf, size_t size, u32 *retval);
2134

drivers/platform/x86/lenovo/wmi-other.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646

4747
#include "wmi-capdata.h"
4848
#include "wmi-events.h"
49-
#include "wmi-gamezone.h"
5049
#include "wmi-helpers.h"
5150
#include "../firmware_attributes_class.h"
5251

@@ -787,7 +786,7 @@ static bool lwmi_attr_01_is_supported(struct tunable_attr_01 *tunable_attr)
787786
{
788787
u8 modes[2] = { LWMI_GZ_THERMAL_MODE_CUSTOM, LWMI_GZ_THERMAL_MODE_NONE };
789788
struct lwmi_om_priv *priv = dev_get_drvdata(tunable_attr->dev);
790-
struct wmi_method_args_32 args = { 0x0, 0x0 };
789+
struct wmi_method_args_32 args = {};
791790
bool cd_mode_found = false;
792791
bool cv_mode_found = false;
793792
struct capdata01 capdata;

0 commit comments

Comments
 (0)