Lines Matching +full:0 +full:ms

22 #define MS_HIDINPUT		BIT(0)
41 #define ENABLE_WEAK BIT(0)
62 struct ms_data *ms = hid_get_drvdata(hdev); in ms_report_fixup() local
63 unsigned long quirks = ms->quirks; in ms_report_fixup()
69 if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 && in ms_report_fixup()
70 rdesc[559] == 0x29) { in ms_report_fixup()
72 rdesc[557] = 0x35; in ms_report_fixup()
73 rdesc[559] = 0x45; in ms_report_fixup()
89 * the MS office kb labelled "Office Home" and "Task Pane". in ms_ergonomy_kb_quirk()
91 case 0x29d: in ms_ergonomy_kb_quirk()
94 case 0x29e: in ms_ergonomy_kb_quirk()
98 return 0; in ms_ergonomy_kb_quirk()
102 return 0; in ms_ergonomy_kb_quirk()
105 case 0xfd06: ms_map_key_clear(KEY_CHAT); break; in ms_ergonomy_kb_quirk()
106 case 0xfd07: ms_map_key_clear(KEY_PHONE); break; in ms_ergonomy_kb_quirk()
107 case 0xff00: in ms_ergonomy_kb_quirk()
113 case 0xff01: in ms_ergonomy_kb_quirk()
117 case 0xff02: in ms_ergonomy_kb_quirk()
120 * standard hid keyboard report, as send by interface 0 in ms_ergonomy_kb_quirk()
127 case 0xff05: in ms_ergonomy_kb_quirk()
137 return 0; in ms_ergonomy_kb_quirk()
146 return 0; in ms_presenter_8k_quirk()
150 case 0xfd08: ms_map_key_clear(KEY_FORWARD); break; in ms_presenter_8k_quirk()
151 case 0xfd09: ms_map_key_clear(KEY_BACK); break; in ms_presenter_8k_quirk()
152 case 0xfd0b: ms_map_key_clear(KEY_PLAYPAUSE); break; in ms_presenter_8k_quirk()
153 case 0xfd0e: ms_map_key_clear(KEY_CLOSE); break; in ms_presenter_8k_quirk()
154 case 0xfd0f: ms_map_key_clear(KEY_PLAY); break; in ms_presenter_8k_quirk()
156 return 0; in ms_presenter_8k_quirk()
165 case 0xff070000: in ms_surface_dial_quirk()
179 return 0; in ms_surface_dial_quirk()
186 struct ms_data *ms = hid_get_drvdata(hdev); in ms_input_mapping() local
187 unsigned long quirks = ms->quirks; in ms_input_mapping()
206 return 0; in ms_input_mapping()
213 struct ms_data *ms = hid_get_drvdata(hdev); in ms_input_mapped() local
214 unsigned long quirks = ms->quirks; in ms_input_mapped()
219 return 0; in ms_input_mapped()
225 struct ms_data *ms = hid_get_drvdata(hdev); in ms_event() local
226 unsigned long quirks = ms->quirks; in ms_event()
231 return 0; in ms_event()
235 /* Handling MS keyboards special buttons */ in ms_event()
236 if (quirks & MS_ERGONOMY && usage->hid == (HID_UP_MSVENDOR | 0xff00)) { in ms_event()
238 input_report_key(input, KEY_KPEQUAL, value & 0x01); in ms_event()
239 input_report_key(input, KEY_KPLEFTPAREN, value & 0x02); in ms_event()
240 input_report_key(input, KEY_KPRIGHTPAREN, value & 0x04); in ms_event()
244 if (quirks & MS_ERGONOMY && usage->hid == (HID_UP_MSVENDOR | 0xff01)) { in ms_event()
246 int step = ((value & 0x60) >> 5) + 1; in ms_event()
248 switch (value & 0x1f) { in ms_event()
249 case 0x01: in ms_event()
252 case 0x1f: in ms_event()
259 if (quirks & MS_ERGONOMY && usage->hid == (HID_UP_MSVENDOR | 0xff05)) { in ms_event()
260 static unsigned int last_key = 0; in ms_event()
261 unsigned int key = 0; in ms_event()
263 case 0x01: key = KEY_F14; break; in ms_event()
264 case 0x02: key = KEY_F15; break; in ms_event()
265 case 0x04: key = KEY_F16; break; in ms_event()
266 case 0x08: key = KEY_F17; break; in ms_event()
267 case 0x10: key = KEY_F18; break; in ms_event()
273 input_event(input, usage->type, last_key, 0); in ms_event()
278 return 0; in ms_event()
283 struct ms_data *ms = container_of(work, struct ms_data, ff_worker); in ms_ff_worker() local
284 struct hid_device *hdev = ms->hdev; in ms_ff_worker()
285 struct xb1s_ff_report *r = ms->output_report_dmabuf; in ms_ff_worker()
288 memset(r, 0, sizeof(*r)); in ms_ff_worker()
295 * ms in ms_ff_worker()
299 r->magnitude[MAGNITUDE_STRONG] = ms->strong; /* left actuator */ in ms_ff_worker()
300 r->magnitude[MAGNITUDE_WEAK] = ms->weak; /* right actuator */ in ms_ff_worker()
303 if (ret < 0) in ms_ff_worker()
311 struct ms_data *ms = hid_get_drvdata(hid); in ms_play_effect() local
314 return 0; in ms_play_effect()
317 * Magnitude is 0..100 so scale the 16-bit input here in ms_play_effect()
319 ms->strong = ((u32) effect->u.rumble.strong_magnitude * 100) / U16_MAX; in ms_play_effect()
320 ms->weak = ((u32) effect->u.rumble.weak_magnitude * 100) / U16_MAX; in ms_play_effect()
322 schedule_work(&ms->ff_worker); in ms_play_effect()
323 return 0; in ms_play_effect()
330 struct ms_data *ms = hid_get_drvdata(hdev); in ms_init_ff() local
339 if (!(ms->quirks & MS_QUIRK_FF)) in ms_init_ff()
340 return 0; in ms_init_ff()
342 ms->hdev = hdev; in ms_init_ff()
343 INIT_WORK(&ms->ff_worker, ms_ff_worker); in ms_init_ff()
345 ms->output_report_dmabuf = devm_kzalloc(&hdev->dev, in ms_init_ff()
348 if (ms->output_report_dmabuf == NULL) in ms_init_ff()
357 struct ms_data *ms = hid_get_drvdata(hdev); in ms_remove_ff() local
359 if (!(ms->quirks & MS_QUIRK_FF)) in ms_remove_ff()
362 cancel_work_sync(&ms->ff_worker); in ms_remove_ff()
368 struct ms_data *ms; in ms_probe() local
371 ms = devm_kzalloc(&hdev->dev, sizeof(*ms), GFP_KERNEL); in ms_probe()
372 if (ms == NULL) in ms_probe()
375 ms->quirks = quirks; in ms_probe()
377 hid_set_drvdata(hdev, ms); in ms_probe()
392 HID_CONNECT_HIDINPUT_FORCE : 0)); in ms_probe()
402 return 0; in ms_probe()
447 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, 0x091B),