asus-wmi.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 <[email protected]>
  7. *
  8. * Portions based on wistron_btns.c:
  9. * Copyright (C) 2005 Miloslav Trmac <[email protected]>
  10. * Copyright (C) 2005 Bernhard Rosenkraenzer <[email protected]>
  11. * Copyright (C) 2005 Dmitry Torokhov <[email protected]>
  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_BRN_DOWN 0x2e
  19. #define ASUS_WMI_BRN_UP 0x2f
  20. struct module;
  21. struct key_entry;
  22. struct asus_wmi;
  23. enum asus_wmi_tablet_switch_mode {
  24. asus_wmi_no_tablet_switch,
  25. asus_wmi_kbd_dock_devid,
  26. asus_wmi_lid_flip_devid,
  27. asus_wmi_lid_flip_rog_devid,
  28. };
  29. struct quirk_entry {
  30. bool hotplug_wireless;
  31. bool scalar_panel_brightness;
  32. bool store_backlight_power;
  33. bool wmi_backlight_set_devstate;
  34. bool wmi_force_als_set;
  35. bool wmi_ignore_fan;
  36. enum asus_wmi_tablet_switch_mode tablet_switch_mode;
  37. int wapf;
  38. /*
  39. * For machines with AMD graphic chips, it will send out WMI event
  40. * and ACPI interrupt at the same time while hitting the hotkey.
  41. * To simplify the problem, we just have to ignore the WMI event,
  42. * and let the ACPI interrupt to send out the key event.
  43. */
  44. int no_display_toggle;
  45. u32 xusb2pr;
  46. bool (*i8042_filter)(unsigned char data, unsigned char str,
  47. struct serio *serio);
  48. };
  49. struct asus_wmi_driver {
  50. int brightness;
  51. int panel_power;
  52. int wlan_ctrl_by_user;
  53. const char *name;
  54. struct module *owner;
  55. const char *event_guid;
  56. const struct key_entry *keymap;
  57. const char *input_name;
  58. const char *input_phys;
  59. struct quirk_entry *quirks;
  60. /* Returns new code, value, and autorelease values in arguments.
  61. * Return ASUS_WMI_KEY_IGNORE in code if event should be ignored. */
  62. void (*key_filter) (struct asus_wmi_driver *driver, int *code,
  63. unsigned int *value, bool *autorelease);
  64. int (*probe) (struct platform_device *device);
  65. void (*detect_quirks) (struct asus_wmi_driver *driver);
  66. struct platform_driver platform_driver;
  67. struct platform_device *platform_device;
  68. };
  69. int asus_wmi_register_driver(struct asus_wmi_driver *driver);
  70. void asus_wmi_unregister_driver(struct asus_wmi_driver *driver);
  71. #endif /* !_ASUS_WMI_H_ */