asus-wmi.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Asus PC WMI hotkey driver
  4. *
  5. * Copyright(C) 2010 Intel Corporation.
  6. * Copyright(C) 2010-2011 Corentin Chary <corentin.chary@gmail.com>
  7. *
  8. * Portions based on wistron_btns.c:
  9. * Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
  10. * Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
  11. * Copyright (C) 2005 Dmitry Torokhov <dtor@mail.ru>
  12. */
  13. #ifndef _ASUS_WMI_H_
  14. #define _ASUS_WMI_H_
  15. #include <linux/platform_device.h>
  16. #include <linux/i8042.h>
  17. #define ASUS_WMI_KEY_IGNORE (-1)
  18. #define ASUS_WMI_KEY_ARMOURY 0xffff01
  19. #define ASUS_WMI_BRN_DOWN 0x2e
  20. #define ASUS_WMI_BRN_UP 0x2f
  21. struct module;
  22. struct key_entry;
  23. struct asus_wmi;
  24. enum asus_wmi_tablet_switch_mode {
  25. asus_wmi_no_tablet_switch,
  26. asus_wmi_kbd_dock_devid,
  27. asus_wmi_lid_flip_devid,
  28. asus_wmi_lid_flip_rog_devid,
  29. };
  30. struct quirk_entry {
  31. bool hotplug_wireless;
  32. bool scalar_panel_brightness;
  33. bool store_backlight_power;
  34. bool wmi_backlight_set_devstate;
  35. bool wmi_force_als_set;
  36. bool wmi_ignore_fan;
  37. bool filter_i8042_e1_extended_codes;
  38. int key_wlan_event;
  39. enum asus_wmi_tablet_switch_mode tablet_switch_mode;
  40. int wapf;
  41. /*
  42. * For machines with AMD graphic chips, it will send out WMI event
  43. * and ACPI interrupt at the same time while hitting the hotkey.
  44. * To simplify the problem, we just have to ignore the WMI event,
  45. * and let the ACPI interrupt to send out the key event.
  46. */
  47. int no_display_toggle;
  48. u32 xusb2pr;
  49. };
  50. struct asus_wmi_driver {
  51. int brightness;
  52. int panel_power;
  53. int screenpad_brightness;
  54. int wlan_ctrl_by_user;
  55. const char *name;
  56. struct module *owner;
  57. const char *event_guid;
  58. const struct key_entry *keymap;
  59. const char *input_name;
  60. const char *input_phys;
  61. struct quirk_entry *quirks;
  62. /* Returns new code, value, and autorelease values in arguments.
  63. * Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
  64. void (*key_filter) (struct asus_wmi_driver *driver, int *code,
  65. unsigned int *value, bool *autorelease);
  66. /* Optional standard i8042 filter */
  67. i8042_filter_t i8042_filter;
  68. int (*probe) (struct platform_device *device);
  69. void (*detect_quirks) (struct asus_wmi_driver *driver);
  70. struct platform_driver platform_driver;
  71. struct platform_device *platform_device;
  72. };
  73. int asus_wmi_register_driver(struct asus_wmi_driver *driver);
  74. void asus_wmi_unregister_driver(struct asus_wmi_driver *driver);
  75. #endif /* !_ASUS_WMI_H_ */