• Dmitry Torokhov's avatar
    HID: i2c: let RMI devices decide what constitutes wakeup event · 9984fbf5
    Dmitry Torokhov authored
    HID-RMI is special in the sense that it does not carry HID events
    directly, but rather uses HID protocol as a wrapper/transport for RMI
    protocol.  Therefore we should not assume that all data coming from the
    device via interrupt is associated with user activity and report wakeup
    event indiscriminately, but rather let HID-RMI do that when appropriate.
    
    HID-RMI devices tag responses to the commands issued by the host as
    RMI_READ_DATA_REPORT_ID whereas motion and other input events from the
    device are tagged as RMI_ATTN_REPORT_ID. Change hid-rmi to report wakeup
    events when receiving the latter packets. This allows ChromeOS to
    accurately identify wakeup source and make correct decision on the mode
    of the resume the system should take ("dark" where the display stays off
    vs normal one).
    
    Fixes: d951ae1c ("HID: i2c-hid: Report wakeup events")
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    9984fbf5
hid-rmi.c 18.9 KB