blob: c6eedfd94e7d45756ac31ef91b50403ce0435701 [file] [log] [blame]
Andy Lutomirski844af952015-11-24 19:49:23 -08001/*
2 * wmi.h - ACPI WMI interface
3 *
4 * Copyright (c) 2015 Andrew Lutomirski
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15
16#ifndef _LINUX_WMI_H
17#define _LINUX_WMI_H
18
19#include <linux/device.h>
20#include <linux/acpi.h>
21
22struct wmi_device {
23 struct device dev;
Andy Lutomirskid4fc91a2015-11-25 14:03:43 -080024
25 /*
26 * These are true for data objects that support reads and writes,
27 * respectively.
28 */
29 bool readable, writeable;
Andy Lutomirski844af952015-11-24 19:49:23 -080030};
31
32struct wmi_device_id {
33 const char *guid_string;
34};
35
36struct wmi_driver {
37 struct device_driver driver;
38 const struct wmi_device_id *id_table;
39
40 int (*probe)(struct wmi_device *wdev);
41 int (*remove)(struct wmi_device *wdev);
Andy Lutomirski1686f542015-11-25 17:33:25 -080042 void (*notify)(struct wmi_device *device, union acpi_object *data);
Andy Lutomirski844af952015-11-24 19:49:23 -080043};
44
45extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
46 struct module *owner);
47extern void wmi_driver_unregister(struct wmi_driver *driver);
48#define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
49
50#define module_wmi_driver(__wmi_driver) \
51 module_driver(__wmi_driver, wmi_driver_register, \
52 wmi_driver_unregister)
53
54#endif