Skip to content

Commit 53078a7

Browse files
flukejonesJiri Kosina
authored andcommitted
HID: hid-asus: Disable OOBE mode on the ProArt P16
The new ASUS ProArt 16" laptop series come with their keyboards stuck in an Out-Of-Box-Experience mode. While in this mode most functions will not work such as LED control or Fn key combos. The correct init sequence is now done to disable this OOBE. This patch addresses only the ProArt series so far and it is unknown if there may be others, in which case a new quirk may be required. Signed-off-by: Luke D. Jones <luke@ljones.dev> Co-developed-by: Connor Belli <connorbelli2003@gmail.com> Signed-off-by: Connor Belli <connorbelli2003@gmail.com> Tested-by: Jan Schmidt <jan@centricular.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent cc4f952 commit 53078a7

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

drivers/hid/hid-asus.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,26 @@ static int asus_kbd_get_functions(struct hid_device *hdev,
432432
return ret;
433433
}
434434

435+
static int asus_kbd_disable_oobe(struct hid_device *hdev)
436+
{
437+
const u8 init[][6] = {
438+
{ FEATURE_KBD_REPORT_ID, 0x05, 0x20, 0x31, 0x00, 0x08 },
439+
{ FEATURE_KBD_REPORT_ID, 0xBA, 0xC5, 0xC4 },
440+
{ FEATURE_KBD_REPORT_ID, 0xD0, 0x8F, 0x01 },
441+
{ FEATURE_KBD_REPORT_ID, 0xD0, 0x85, 0xFF }
442+
};
443+
int ret;
444+
445+
for (size_t i = 0; i < ARRAY_SIZE(init); i++) {
446+
ret = asus_kbd_set_report(hdev, init[i], sizeof(init[i]));
447+
if (ret < 0)
448+
return ret;
449+
}
450+
451+
hid_info(hdev, "Disabled OOBE for keyboard\n");
452+
return 0;
453+
}
454+
435455
static void asus_schedule_work(struct asus_kbd_leds *led)
436456
{
437457
unsigned long flags;
@@ -534,6 +554,12 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
534554
ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
535555
if (ret < 0)
536556
return ret;
557+
558+
if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
559+
ret = asus_kbd_disable_oobe(hdev);
560+
if (ret < 0)
561+
return ret;
562+
}
537563
} else {
538564
/* Initialize keyboard */
539565
ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);

include/linux/platform_data/x86/asus-wmi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ static const struct dmi_system_id asus_use_hid_led_dmi_ids[] = {
184184
DMI_MATCH(DMI_PRODUCT_FAMILY, "ROG Flow"),
185185
},
186186
},
187+
{
188+
.matches = {
189+
DMI_MATCH(DMI_PRODUCT_FAMILY, "ProArt P16"),
190+
},
191+
},
187192
{
188193
.matches = {
189194
DMI_MATCH(DMI_BOARD_NAME, "GA403U"),

0 commit comments

Comments
 (0)