Skip to content

Commit 65fcf7d

Browse files
matte-schwartzNeroReflex
authored andcommitted
[NOT-FOR-UPSTREAM] hid-asus-ally: disable wakeup attribute on N-Key device
With the current ROG Ally patchset, the MCU will send spurious events when the ROG Ally is in s2idle while plugged in, which can cause the system to wake unexpectedly. There's really no reason the N-Key needs wakeup enabled, so just disable the capability for now. This can be dropped when the issue is root caused and fixed within the standard ROG Ally patchset. Closes: ValveSoftware/SteamOS#2119 Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
1 parent f96cea2 commit 65fcf7d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/hid/hid-asus-ally.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,23 @@ static int ally_hid_init(struct hid_device *hdev)
20102010
return ret;
20112011
}
20122012

2013+
static void ally_disable_nkey_wakeup(struct hid_device *hdev)
2014+
{
2015+
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
2016+
struct usb_device *udev;
2017+
2018+
if (!intf)
2019+
return;
2020+
2021+
udev = interface_to_usbdev(intf);
2022+
if (!udev)
2023+
return;
2024+
2025+
/* HACK: Mark Ally N-Key as incapable of wakeup */
2026+
device_set_wakeup_enable(&udev->dev, false);
2027+
hid_info(hdev, "Disabled wakeup capability on %s\n", dev_name(&udev->dev));
2028+
}
2029+
20132030
static int ally_hid_probe(struct hid_device *hdev, const struct hid_device_id *_id)
20142031
{
20152032
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
@@ -2054,6 +2071,7 @@ static int ally_hid_probe(struct hid_device *hdev, const struct hid_device_id *_
20542071
/* This should almost always exist */
20552072
if (ep == ROG_ALLY_CFG_INTF_IN) {
20562073
validate_mcu_fw_version(hdev, idProduct);
2074+
ally_disable_nkey_wakeup(hdev);
20572075

20582076
drvdata.led_rgb_dev = ally_rgb_create(hdev);
20592077
if (IS_ERR(drvdata.led_rgb_dev))

0 commit comments

Comments
 (0)