GNU Linux-libre 4.14.259-gnu1
[releases.git] / drivers / staging / unisys / visorinput / ultrainputreport.h
1 /*
2  * Copyright (C) 2010 - 2015 UNISYS CORPORATION
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  * NON INFRINGEMENT.  See the GNU General Public License for more
13  * details.
14  */
15
16 #ifndef __SPAR_ULTRAINPUTREPORT_H__
17 #define __SPAR_ULTRAINPUTREPORT_H__
18
19 #include <linux/types.h>
20
21 /* These defines identify mouse and keyboard activity which is specified by the
22  * firmware to the host using the cmsimpleinput protocol.  @ingroup coretypes
23  */
24         /* only motion; arg1=x, arg2=y */
25 #define INPUTACTION_XY_MOTION 1
26 /* arg1: 1=left,2=center,3=right */
27 #define INPUTACTION_MOUSE_BUTTON_DOWN 2
28 /* arg1: 1=left,2=center,3=right */
29 #define INPUTACTION_MOUSE_BUTTON_UP 3
30 /* arg1: 1=left,2=center,3=right */
31 #define INPUTACTION_MOUSE_BUTTON_CLICK 4
32 /* arg1: 1=left,2=center 3=right */
33 #define INPUTACTION_MOUSE_BUTTON_DCLICK 5
34 /* arg1: wheel rotation away from user */
35 #define INPUTACTION_WHEEL_ROTATE_AWAY 6
36 /* arg1: wheel rotation toward user */
37 #define INPUTACTION_WHEEL_ROTATE_TOWARD 7
38 /* arg1: scancode, as follows: If arg1 <= 0xff, it's a 1-byte scancode and arg1
39  *       is that scancode. If arg1 > 0xff, it's a 2-byte scanecode, with the 1st
40  *       byte in the low 8 bits, and the 2nd byte in the high 8 bits.
41  *       E.g., the right ALT key would appear as x'38e0'.
42  */
43 #define INPUTACTION_KEY_DOWN 64
44 /* arg1: scancode (in same format as inputaction_keyDown) */
45 #define INPUTACTION_KEY_UP 65
46 /* arg1: scancode (in same format as inputaction_keyDown); MUST refer to one of
47  *       the locking keys, like capslock, numlock, or scrolllock.
48  * arg2: 1 iff locking key should be in the LOCKED position (e.g., light is ON)
49  */
50 #define INPUTACTION_SET_LOCKING_KEY_STATE 66
51 /* arg1: scancode (in same format as inputaction_keyDown */
52 #define INPUTACTION_KEY_DOWN_UP 67
53
54 struct visor_inputactivity {
55         u16 action;
56         u16 arg1;
57         u16 arg2;
58         u16 arg3;
59 } __packed;
60
61 struct visor_inputreport {
62         u64 seq_no;
63         struct visor_inputactivity activity;
64 } __packed;
65
66 #endif