diff options
-rw-r--r-- | chip/stm32/usb_hid_keyboard.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chip/stm32/usb_hid_keyboard.c b/chip/stm32/usb_hid_keyboard.c index ab529b27b3..defe39e845 100644 --- a/chip/stm32/usb_hid_keyboard.c +++ b/chip/stm32/usb_hid_keyboard.c @@ -226,15 +226,17 @@ const struct usb_endpoint_descriptor USB_EP_DESC(USB_IFACE_HID_KEYBOARD, 02) = { 0x09, 0xCD, /* Play / Pause (0xCD) */ \ 0x09, 0xB5, /* Scan Next Track (0xB5) */ \ 0x09, 0xB6, /* Scan Previous Track (0xB6) */ \ + 0x09, 0x7C, /* Keyboard Backlight OOC (0x7C) */ \ + 0x0B, 0x2F, 0x00, 0x0B, 0x00, /* Phone Mute (Page 0xB, Usage 0x2F) */ \ 0x09, 0x32, /* Sleep (0x32) */ \ 0x15, 0x00, /* Logical Minimum (0) */ \ 0x25, 0x01, /* Logical Maximum (1) */ \ 0x75, 0x01, /* Report Size (1) */ \ - 0x95, 0x12, /* Report Count (18) */ \ + 0x95, 0x14, /* Report Count (20) */ \ 0x81, 0x02, /* Input (Data, Variable, Absolute), ;Modifier byte */ \ \ - /* 14-bit padding */ \ - 0x95, 0x0E, /* Report Count (14) */ \ + /* 12-bit padding */ \ + 0x95, 0x0C, /* Report Count (12) */ \ 0x75, 0x01, /* Report Size (1) */ \ 0x81, 0x01, /* Input (Constant), ;1-bit padding */ @@ -509,8 +511,12 @@ static const struct action_key_config action_key[] = { [TK_PLAY_PAUSE] = { .mask = BIT(14), .usage = 0x000C00CD }, [TK_NEXT_TRACK] = { .mask = BIT(15), .usage = 0x000C00B5 }, [TK_PREV_TRACK] = { .mask = BIT(16), .usage = 0x000C00B6 }, + [TK_KBD_BKLIGHT_TOGGLE] = { .mask = BIT(17), .usage = 0x000C007C }, + [TK_MICMUTE] = { .mask = BIT(18), .usage = 0x000B002F }, }; +static const int SLEEP_KEY_MASK = BIT(ARRAY_SIZE(action_key)); + #ifdef CONFIG_USB_HID_KEYBOARD_VIVALDI static uint32_t feature_report[CONFIG_USB_HID_KB_NUM_TOP_ROW_KEYS]; @@ -639,7 +645,7 @@ static uint32_t maybe_convert_function_key(int keycode) /* convert F13 to Sleep */ if (index == 12 && (config->capabilities & KEYBD_CAP_SCRNLOCK_KEY)) - return BIT(17); + return SLEEP_KEY_MASK; if (index >= config->num_top_row_keys || config->action_keys[index] == TK_ABSENT) |