-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a header file for alienware-wmi with shared resources to support the upcoming file split. Reviewed-by: Armin Wolf <W_Armin@gmx.de> Signed-off-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250207154610.13675-11-kuurtb@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
- Loading branch information
Kurt Borja
authored and
Ilpo Järvinen
committed
Feb 10, 2025
1 parent
2e56ac8
commit c5ebbaf
Showing
2 changed files
with
114 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* Alienware WMI special features driver | ||
* | ||
* Copyright (C) 2014 Dell Inc <Dell.Client.Kernel@dell.com> | ||
* Copyright (C) 2024 Kurt Borja <kuurtb@gmail.com> | ||
*/ | ||
|
||
#ifndef _ALIENWARE_WMI_H_ | ||
#define _ALIENWARE_WMI_H_ | ||
|
||
#include <linux/leds.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/wmi.h> | ||
|
||
#define LEGACY_CONTROL_GUID "A90597CE-A997-11DA-B012-B622A1EF5492" | ||
#define LEGACY_POWER_CONTROL_GUID "A80593CE-A997-11DA-B012-B622A1EF5492" | ||
#define WMAX_CONTROL_GUID "A70591CE-A997-11DA-B012-B622A1EF5492" | ||
|
||
enum INTERFACE_FLAGS { | ||
LEGACY, | ||
WMAX, | ||
}; | ||
|
||
enum LEGACY_CONTROL_STATES { | ||
LEGACY_RUNNING = 1, | ||
LEGACY_BOOTING = 0, | ||
LEGACY_SUSPEND = 3, | ||
}; | ||
|
||
enum WMAX_CONTROL_STATES { | ||
WMAX_RUNNING = 0xFF, | ||
WMAX_BOOTING = 0, | ||
WMAX_SUSPEND = 3, | ||
}; | ||
|
||
struct alienfx_quirks { | ||
u8 num_zones; | ||
bool hdmi_mux; | ||
bool amplifier; | ||
bool deepslp; | ||
}; | ||
|
||
struct color_platform { | ||
u8 blue; | ||
u8 green; | ||
u8 red; | ||
} __packed; | ||
|
||
struct alienfx_priv { | ||
struct platform_device *pdev; | ||
struct led_classdev global_led; | ||
struct color_platform colors[4]; | ||
u8 global_brightness; | ||
u8 lighting_control_state; | ||
}; | ||
|
||
struct alienfx_ops { | ||
int (*upd_led)(struct alienfx_priv *priv, struct wmi_device *wdev, | ||
u8 location); | ||
int (*upd_brightness)(struct alienfx_priv *priv, struct wmi_device *wdev, | ||
u8 brightness); | ||
}; | ||
|
||
struct alienfx_platdata { | ||
struct wmi_device *wdev; | ||
struct alienfx_ops ops; | ||
}; | ||
|
||
extern u8 alienware_interface; | ||
extern struct alienfx_quirks *alienfx; | ||
|
||
int alienware_wmi_command(struct wmi_device *wdev, u32 method_id, | ||
void *in_args, size_t in_size, u32 *out_data); | ||
|
||
int alienware_alienfx_setup(struct alienfx_platdata *pdata); | ||
|
||
int __init alienware_legacy_wmi_init(void); | ||
void __exit alienware_legacy_wmi_exit(void); | ||
|
||
extern const struct attribute_group wmax_hdmi_attribute_group; | ||
extern const struct attribute_group wmax_amplifier_attribute_group; | ||
extern const struct attribute_group wmax_deepsleep_attribute_group; | ||
|
||
#define WMAX_DEV_GROUPS &wmax_hdmi_attribute_group, \ | ||
&wmax_amplifier_attribute_group, \ | ||
&wmax_deepsleep_attribute_group, | ||
|
||
int __init alienware_wmax_wmi_init(void); | ||
void __exit alienware_wmax_wmi_exit(void); | ||
|
||
#endif |