wmi.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  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. #ifndef _LINUX_WMI_H
  16. #define _LINUX_WMI_H
  17. #include <linux/device.h>
  18. #include <linux/acpi.h>
  19. struct wmi_device {
  20. struct device dev;
  21. };
  22. struct wmi_device_id {
  23. const char *guid_string;
  24. };
  25. struct wmi_driver {
  26. struct device_driver driver;
  27. const struct wmi_device_id *id_table;
  28. int (*probe)(struct wmi_device *wdev);
  29. int (*remove)(struct wmi_device *wdev);
  30. };
  31. extern int __must_check __wmi_driver_register(struct wmi_driver *driver,
  32. struct module *owner);
  33. extern void wmi_driver_unregister(struct wmi_driver *driver);
  34. #define wmi_driver_register(driver) __wmi_driver_register((driver), THIS_MODULE)
  35. #define module_wmi_driver(__wmi_driver) \
  36. module_driver(__wmi_driver, wmi_driver_register, \
  37. wmi_driver_unregister)
  38. #endif