sysctl: move some boundary constants from sysctl.c to sysctl_vals
[linux-block.git] / include / linux / wmi.h
CommitLineData
1802d0be 1/* SPDX-License-Identifier: GPL-2.0-only */
844af950
AL
2/*
3 * wmi.h - ACPI WMI interface
4 *
5 * Copyright (c) 2015 Andrew Lutomirski
844af950
AL
6 */
7
8#ifndef _LINUX_WMI_H
9#define _LINUX_WMI_H
10
11#include <linux/device.h>
12#include <linux/acpi.h>
eacc95ea 13#include <linux/mod_devicetable.h>
44b6b766 14#include <uapi/linux/wmi.h>
844af950
AL
15
16struct wmi_device {
17 struct device dev;
d4fc91ad 18
fd70da6a
DHV
19 /* True for data blocks implementing the Set Control Method */
20 bool setable;
844af950
AL
21};
22
722c856d
ML
23/* evaluate the ACPI method associated with this device */
24extern acpi_status wmidev_evaluate_method(struct wmi_device *wdev,
25 u8 instance, u32 method_id,
26 const struct acpi_buffer *in,
27 struct acpi_buffer *out);
28
56a37025
AL
29/* Caller must kfree the result. */
30extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
31 u8 instance);
32
44b6b766
ML
33extern int set_required_buffer_size(struct wmi_device *wdev, u64 length);
34
844af950
AL
35struct wmi_driver {
36 struct device_driver driver;
37 const struct wmi_device_id *id_table;
8c33915d 38 bool no_notify_data;
844af950 39
440c4983 40 int (*probe)(struct wmi_device *wdev, const void *context);
2b329f56 41 void (*remove)(struct wmi_device *wdev);
1686f544 42 void (*notify)(struct wmi_device *device, union acpi_object *data);
44b6b766
ML
43 long (*filter_callback)(struct wmi_device *wdev, unsigned int cmd,
44 struct wmi_ioctl_buffer *arg);
844af950
AL
45};
46
47extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
48 struct module *owner);
49extern void wmi_driver_unregister(struct wmi_driver *driver);
50#define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
51
52#define module_wmi_driver(__wmi_driver) \
53 module_driver(__wmi_driver, wmi_driver_register, \
54 wmi_driver_unregister)
55
56#endif