summaryrefslogtreecommitdiffstats
path: root/include/linux/wmi.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:49:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:49:45 +0000
commit2c3c1048746a4622d8c89a29670120dc8fab93c4 (patch)
tree848558de17fb3008cdf4d861b01ac7781903ce39 /include/linux/wmi.h
parentInitial commit. (diff)
downloadlinux-2c3c1048746a4622d8c89a29670120dc8fab93c4.tar.xz
linux-2c3c1048746a4622d8c89a29670120dc8fab93c4.zip
Adding upstream version 6.1.76.upstream/6.1.76upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/linux/wmi.h')
-rw-r--r--include/linux/wmi.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/include/linux/wmi.h b/include/linux/wmi.h
new file mode 100644
index 000000000..b88d7b58e
--- /dev/null
+++ b/include/linux/wmi.h
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * wmi.h - ACPI WMI interface
+ *
+ * Copyright (c) 2015 Andrew Lutomirski
+ */
+
+#ifndef _LINUX_WMI_H
+#define _LINUX_WMI_H
+
+#include <linux/device.h>
+#include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
+#include <uapi/linux/wmi.h>
+
+struct wmi_device {
+ struct device dev;
+
+ /* True for data blocks implementing the Set Control Method */
+ bool setable;
+};
+
+/* evaluate the ACPI method associated with this device */
+extern acpi_status wmidev_evaluate_method(struct wmi_device *wdev,
+ u8 instance, u32 method_id,
+ const struct acpi_buffer *in,
+ struct acpi_buffer *out);
+
+/* Caller must kfree the result. */
+extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
+ u8 instance);
+
+extern int set_required_buffer_size(struct wmi_device *wdev, u64 length);
+
+struct wmi_driver {
+ struct device_driver driver;
+ const struct wmi_device_id *id_table;
+ bool no_notify_data;
+
+ int (*probe)(struct wmi_device *wdev, const void *context);
+ void (*remove)(struct wmi_device *wdev);
+ void (*notify)(struct wmi_device *device, union acpi_object *data);
+ long (*filter_callback)(struct wmi_device *wdev, unsigned int cmd,
+ struct wmi_ioctl_buffer *arg);
+};
+
+extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
+ struct module *owner);
+extern void wmi_driver_unregister(struct wmi_driver *driver);
+#define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
+
+#define module_wmi_driver(__wmi_driver) \
+ module_driver(__wmi_driver, wmi_driver_register, \
+ wmi_driver_unregister)
+
+#endif