2019-05-27 09:55:21 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2015-11-25 06:49:23 +03:00
|
|
|
/*
|
|
|
|
* 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>
|
2019-02-19 22:59:49 +03:00
|
|
|
#include <linux/mod_devicetable.h>
|
2017-11-01 22:25:35 +03:00
|
|
|
#include <uapi/linux/wmi.h>
|
2015-11-25 06:49:23 +03:00
|
|
|
|
|
|
|
struct wmi_device {
|
|
|
|
struct device dev;
|
2015-11-26 01:03:43 +03:00
|
|
|
|
2017-05-20 05:28:36 +03:00
|
|
|
/* True for data blocks implementing the Set Control Method */
|
|
|
|
bool setable;
|
2015-11-25 06:49:23 +03:00
|
|
|
};
|
|
|
|
|
2017-11-01 22:25:23 +03:00
|
|
|
/* 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);
|
|
|
|
|
2015-11-26 05:19:26 +03:00
|
|
|
/* Caller must kfree the result. */
|
|
|
|
extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
|
|
|
|
u8 instance);
|
|
|
|
|
2017-11-01 22:25:35 +03:00
|
|
|
extern int set_required_buffer_size(struct wmi_device *wdev, u64 length);
|
|
|
|
|
2015-11-25 06:49:23 +03:00
|
|
|
struct wmi_driver {
|
|
|
|
struct device_driver driver;
|
|
|
|
const struct wmi_device_id *id_table;
|
2021-11-28 22:00:29 +03:00
|
|
|
bool no_notify_data;
|
2015-11-25 06:49:23 +03:00
|
|
|
|
2019-05-27 19:21:30 +03:00
|
|
|
int (*probe)(struct wmi_device *wdev, const void *context);
|
2021-03-01 19:04:04 +03:00
|
|
|
void (*remove)(struct wmi_device *wdev);
|
2015-11-26 04:33:25 +03:00
|
|
|
void (*notify)(struct wmi_device *device, union acpi_object *data);
|
2017-11-01 22:25:35 +03:00
|
|
|
long (*filter_callback)(struct wmi_device *wdev, unsigned int cmd,
|
|
|
|
struct wmi_ioctl_buffer *arg);
|
2015-11-25 06:49:23 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|