summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/dell/alienware-wmi.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-03-26 09:54:40 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2025-03-26 09:54:40 -0700
commitfb1ceb29b27cda91af35851ebab01f298d82162e (patch)
treea11d78ea36617fc0ec93502f95c917f75573b000 /drivers/platform/x86/dell/alienware-wmi.h
parente50da555ca4d42b1b98d0f26789db64f26a0919a (diff)
parent2c30357e755b087217c7643fda2b8aea6d6deda4 (diff)
Merge tag 'platform-drivers-x86-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform drivers updates from Ilpo Järvinen: - alienware-wmi: - Refactor and split WMAX/legacy drivers - dell-ddv: - Correct +0.1 offset in temperature - Use the power supply extension mechanism for battery temperatures - intel/pmc: - Refactor init to mostly use a common init function - Add support for Arrow Lake U/H - Add support for Panther Lake - intel/sst: - Improve multi die handling - Prefix header search path with sysroot (fixes cross-compiling) - lenovo-wmi-hotkey-utilities: - Support for mic & audio mute LEDs - samsung-galaxybook: - Add driver for Samsung Galaxy Book series - wmi: - Rework WCxx/WExx ACPI method handling - Enable data block collection when the data block is set - platform/arm: - Add Huawei Matebook E Go EC driver - platform/mellanox: - Relocate to drivers/platform/mellanox/ - mlxbf-bootctl: - RTC battery status sysfs support - Miscellaneous cleanups / refactoring / improvements * tag 'platform-drivers-x86-v6.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (75 commits) platform/x86: x86-android-tablets: Add select POWER_SUPPLY to Kconfig platform/x86/amd/pmf: convert timeouts to secs_to_jiffies() platform/x86: thinkpad_acpi: convert timeouts to secs_to_jiffies() irqdomain: platform/x86: Switch to irq_domain_create_linear() platform/x86/amd/pmc: fix leak in probe() tools/power/x86/intel-speed-select: v1.22 release tools/power/x86/intel-speed-select: Prefix header search path with sysroot tools/power/x86/intel-speed-select: Die ID for IO dies tools/power/x86/intel-speed-select: Fix the condition to check multi die system tools/power/x86/intel-speed-select: Prevent increasing MAX_DIE_PER_PACKAGE platform/x86/amd/pmc: Use managed APIs for mutex platform/x86/amd/pmc: Remove unnecessary line breaks platform/x86/amd/pmc: Move macros and structures to the PMC header file platform/x86/amd/pmc: Notify user when platform does not support s0ix transition platform/x86: dell-ddv: Use the power supply extension mechanism platform/x86: dell-ddv: Use devm_battery_hook_register platform/x86: dell-ddv: Fix temperature calculation platform/x86: thinkpad_acpi: check the return value of devm_mutex_init() platform/x86: samsung-galaxybook: Fix block_recording not supported logic platform/x86: dell-uart-backlight: Make dell_uart_bl_serdev_driver static ...
Diffstat (limited to 'drivers/platform/x86/dell/alienware-wmi.h')
-rw-r--r--drivers/platform/x86/dell/alienware-wmi.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/drivers/platform/x86/dell/alienware-wmi.h b/drivers/platform/x86/dell/alienware-wmi.h
new file mode 100644
index 000000000000..68d4242211ae
--- /dev/null
+++ b/drivers/platform/x86/dell/alienware-wmi.h
@@ -0,0 +1,117 @@
+/* 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);
+
+#if IS_ENABLED(CONFIG_ALIENWARE_WMI_LEGACY)
+int __init alienware_legacy_wmi_init(void);
+void __exit alienware_legacy_wmi_exit(void);
+#else
+static inline int alienware_legacy_wmi_init(void)
+{
+ return -ENODEV;
+}
+
+static inline void alienware_legacy_wmi_exit(void)
+{
+}
+#endif
+
+#if IS_ENABLED(CONFIG_ALIENWARE_WMI_WMAX)
+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);
+#else
+#define WMAX_DEV_GROUPS
+
+static inline int alienware_wmax_wmi_init(void)
+{
+ return -ENODEV;
+}
+
+
+static inline void alienware_wmax_wmi_exit(void)
+{
+}
+#endif
+
+#endif