@@ -101,6 +101,7 @@ static LIST_HEAD(steam_devices);
101
101
#define STEAM_REG_GYRO_MODE 0x30
102
102
#define STEAM_REG_LPAD_CLICK_PRESSURE 0x34
103
103
#define STEAM_REG_RPAD_CLICK_PRESSURE 0x35
104
+ #define STEAM_REG_WATCHDOG_ENABLE 0x47
104
105
105
106
/* Raw event identifiers */
106
107
#define STEAM_EV_INPUT_DATA 0x01
@@ -134,7 +135,6 @@ struct steam_device {
134
135
struct power_supply __rcu * battery ;
135
136
u8 battery_charge ;
136
137
u16 voltage ;
137
- struct delayed_work heartbeat ;
138
138
struct work_struct rumble_work ;
139
139
u16 rumble_left ;
140
140
u16 rumble_right ;
@@ -340,8 +340,6 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
340
340
steam_send_report_byte (steam , STEAM_CMD_DEFAULT_MAPPINGS );
341
341
/* enable mouse */
342
342
steam_send_report_byte (steam , STEAM_CMD_DEFAULT_MOUSE );
343
-
344
- cancel_delayed_work_sync (& steam -> heartbeat );
345
343
} else {
346
344
/* disable esc, enter, cursor */
347
345
steam_send_report_byte (steam , STEAM_CMD_CLEAR_MAPPINGS );
@@ -352,13 +350,8 @@ static void steam_set_lizard_mode(struct steam_device *steam, bool enable)
352
350
STEAM_REG_RPAD_MODE , 0x07 , /* disable mouse */
353
351
STEAM_REG_LPAD_CLICK_PRESSURE , 0xFFFF , /* disable clicky pad */
354
352
STEAM_REG_RPAD_CLICK_PRESSURE , 0xFFFF , /* disable clicky pad */
353
+ STEAM_REG_WATCHDOG_ENABLE , 0 , /* disable watchdog that tests if Steam is active */
355
354
0 );
356
- /*
357
- * The Steam Deck has a watchdog that automatically enables
358
- * lizard mode if it doesn't see any traffic for too long
359
- */
360
- if (!work_busy (& steam -> heartbeat .work ))
361
- schedule_delayed_work (& steam -> heartbeat , 5 * HZ );
362
355
} else {
363
356
steam_write_registers (steam ,
364
357
STEAM_REG_LPAD_MODE , 0x07 , /* disable mouse */
@@ -733,22 +726,6 @@ static bool steam_is_valve_interface(struct hid_device *hdev)
733
726
return !list_empty (& rep_enum -> report_list );
734
727
}
735
728
736
- static void steam_lizard_mode_heartbeat (struct work_struct * work )
737
- {
738
- struct steam_device * steam = container_of (work , struct steam_device ,
739
- heartbeat .work );
740
-
741
- mutex_lock (& steam -> mutex );
742
- if (!steam -> client_opened && steam -> client_hdev ) {
743
- steam_send_report_byte (steam , STEAM_CMD_CLEAR_MAPPINGS );
744
- steam_write_registers (steam ,
745
- STEAM_REG_RPAD_MODE , 0x07 , /* disable mouse */
746
- 0 );
747
- schedule_delayed_work (& steam -> heartbeat , 5 * HZ );
748
- }
749
- mutex_unlock (& steam -> mutex );
750
- }
751
-
752
729
static int steam_client_ll_parse (struct hid_device * hdev )
753
730
{
754
731
struct steam_device * steam = hdev -> driver_data ;
@@ -887,7 +864,6 @@ static int steam_probe(struct hid_device *hdev,
887
864
steam -> quirks = id -> driver_data ;
888
865
INIT_WORK (& steam -> work_connect , steam_work_connect_cb );
889
866
INIT_LIST_HEAD (& steam -> list );
890
- INIT_DEFERRABLE_WORK (& steam -> heartbeat , steam_lizard_mode_heartbeat );
891
867
INIT_WORK (& steam -> rumble_work , steam_haptic_rumble_cb );
892
868
893
869
steam -> client_hdev = steam_create_client_hid (hdev );
@@ -944,7 +920,6 @@ static int steam_probe(struct hid_device *hdev,
944
920
hid_destroy_device (steam -> client_hdev );
945
921
client_hdev_fail :
946
922
cancel_work_sync (& steam -> work_connect );
947
- cancel_delayed_work_sync (& steam -> heartbeat );
948
923
cancel_work_sync (& steam -> rumble_work );
949
924
steam_alloc_fail :
950
925
hid_err (hdev , "%s: failed with error %d\n" ,
@@ -965,7 +940,6 @@ static void steam_remove(struct hid_device *hdev)
965
940
mutex_lock (& steam -> mutex );
966
941
steam -> client_hdev = NULL ;
967
942
steam -> client_opened = false;
968
- cancel_delayed_work_sync (& steam -> heartbeat );
969
943
mutex_unlock (& steam -> mutex );
970
944
cancel_work_sync (& steam -> work_connect );
971
945
if (steam -> quirks & STEAM_QUIRK_WIRELESS ) {
0 commit comments