Lines Matching +full:toggle +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0-or-later
7 * Most stuff taken over from hp-wmi
14 #include <linux/input/sparse-keymap.h>
25 #define DRV_NAME "msi-wmi"
27 #define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45"
28 #define MSIWMI_MSI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
29 #define MSIWMI_WIND_EVENT_GUID "5B3CC38A-40D9-7245-8AE6-1145B751BE3F"
43 WIND_KEY_TOUCHPAD = 0x08, /* Fn+F3 touchpad toggle */
44 WIND_KEY_BLUETOOTH = 0x56, /* Fn+F11 Bluetooth toggle */
45 WIND_KEY_CAMERA, /* Fn+F6 webcam toggle */
46 WIND_KEY_WLAN = 0x5f, /* Fn+F11 Wi-Fi toggle */
47 WIND_KEY_TURBO, /* Fn+F10 turbo mode toggle */
48 WIND_KEY_ECO = 0x69, /* Fn+F10 ECO mode toggle */
100 return -EIO; in msi_wmi_query_block()
104 if (!obj || obj->type != ACPI_TYPE_INTEGER) { in msi_wmi_query_block()
107 "type: %d - buffer length:%d\n", obj->type, in msi_wmi_query_block()
108 obj->type == ACPI_TYPE_BUFFER ? in msi_wmi_query_block()
109 obj->buffer.length : 0); in msi_wmi_query_block()
112 return -EINVAL; in msi_wmi_query_block()
114 *ret = obj->integer.value; in msi_wmi_query_block()
125 pr_debug("Going to set block of instance: %d - value: %d\n", in msi_wmi_set_block()
141 return -EINVAL; in bl_get()
146 pr_debug("Current backlight level: 0x%X - index: %d\n", in bl_get()
153 return -EINVAL; in bl_get()
160 int bright = bd->props.brightness; in bl_set_status()
162 return -EINVAL; in bl_set_status()
177 if (obj && obj->type == ACPI_TYPE_INTEGER) { in msi_wmi_notify()
178 int eventcode = obj->integer.value; in msi_wmi_notify()
183 pr_info("Unknown key pressed - %x\n", eventcode); in msi_wmi_notify()
187 if (event_wmi->quirk_last_pressed) { in msi_wmi_notify()
191 timeframe -> Key press may result in 10-20 GPEs */ in msi_wmi_notify()
193 pr_debug("Suppressed key event 0x%X - " in msi_wmi_notify()
195 key->code, ktime_to_us(diff)); in msi_wmi_notify()
201 if (key->type == KE_KEY && in msi_wmi_notify()
204 (key->code != MSI_KEY_BRIGHTNESSUP && in msi_wmi_notify()
205 key->code != MSI_KEY_BRIGHTNESSDOWN))) { in msi_wmi_notify()
206 pr_debug("Send key: 0x%X - Input layer keycode: %d\n", in msi_wmi_notify()
207 key->code, key->keycode); in msi_wmi_notify()
222 props.max_brightness = ARRAY_SIZE(backlight_map) - 1; in msi_wmi_backlight_setup()
235 backlight->props.brightness = err; in msi_wmi_backlight_setup()
246 return -ENOMEM; in msi_wmi_input_setup()
248 msi_wmi_input_dev->name = "MSI WMI hotkeys"; in msi_wmi_input_setup()
249 msi_wmi_input_dev->phys = "wmi/input0"; in msi_wmi_input_setup()
250 msi_wmi_input_dev->id.bustype = BUS_HOST; in msi_wmi_input_setup()
308 pr_err("This machine doesn't have neither MSI-hotkeys nor backlight through WMI\n"); in msi_wmi_init()
309 return -ENODEV; in msi_wmi_init()
316 wmi_remove_notify_handler(event_wmi->guid); in msi_wmi_init()
326 wmi_remove_notify_handler(event_wmi->guid); in msi_wmi_exit()