Lines Matching +full:- +full:- +full:mode +full:- +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Fixes the HID report descriptor by removing a non-existent axis and
7 * clearing the constant bit on the input reports for buttons and d-pad.
8 * (This module is based on "hid-ortek".)
12 * Fixes the mode button which cycles through three constantly pressed
25 #include "hid-ids.h"
33 int mode; member
39 unsigned long quirks = id->driver_data; in saitek_probe()
43 ssc = devm_kzalloc(&hdev->dev, sizeof(*ssc), GFP_KERNEL); in saitek_probe()
46 return -ENOMEM; in saitek_probe()
49 ssc->quirks = quirks; in saitek_probe()
50 ssc->mode = -1; in saitek_probe()
74 if ((ssc->quirks & SAITEK_FIX_PS1000) && *rsize == 137 && in saitek_report_fixup()
85 /* clear constant bit on buttons and d-pad */ in saitek_report_fixup()
98 if (ssc->quirks & SAITEK_RELEASE_MODE_RAT7 && size == 7) { in saitek_raw_event()
99 /* R.A.T.7 uses bits 13, 14, 15 for the mode */ in saitek_raw_event()
100 int mode = -1; in saitek_raw_event() local
102 mode = 0; in saitek_raw_event()
104 mode = 1; in saitek_raw_event()
106 mode = 2; in saitek_raw_event()
108 /* clear mode bits */ in saitek_raw_event()
111 if (mode != ssc->mode) { in saitek_raw_event()
112 hid_dbg(hdev, "entered mode %d\n", mode); in saitek_raw_event()
113 if (ssc->mode != -1) { in saitek_raw_event()
114 /* use bit 13 as the mode button */ in saitek_raw_event()
117 ssc->mode = mode; in saitek_raw_event()
119 } else if (ssc->quirks & SAITEK_RELEASE_MODE_MMO7 && size == 8) { in saitek_raw_event()
121 /* M.M.O.7 uses bits 8, 22, 23 for the mode */ in saitek_raw_event()
122 int mode = -1; in saitek_raw_event() local
124 mode = 0; in saitek_raw_event()
126 mode = 1; in saitek_raw_event()
128 mode = 2; in saitek_raw_event()
130 /* clear mode bits */ in saitek_raw_event()
134 if (mode != ssc->mode) { in saitek_raw_event()
135 hid_dbg(hdev, "entered mode %d\n", mode); in saitek_raw_event()
136 if (ssc->mode != -1) { in saitek_raw_event()
137 /* use bit 8 as the mode button, bits 22 in saitek_raw_event()
143 ssc->mode = mode; in saitek_raw_event()
154 struct input_dev *input = field->hidinput->input; in saitek_event()
156 if (usage->type == EV_KEY && value && in saitek_event()
157 (((ssc->quirks & SAITEK_RELEASE_MODE_RAT7) && in saitek_event()
158 usage->code - BTN_MOUSE == 10) || in saitek_event()
159 ((ssc->quirks & SAITEK_RELEASE_MODE_MMO7) && in saitek_event()
160 usage->code - BTN_MOUSE == 15))) { in saitek_event()
162 input_report_key(input, usage->code, 1); in saitek_event()
165 input_report_key(input, usage->code, 0); in saitek_event()