aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorinput/ultrainputreport.h
blob: 3e6a52f4b6bf82b299962e4fd81386cb84db4d67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 * NON INFRINGEMENT.  See the GNU General Public License for more
 * details.
 */

#ifndef __SPAR_ULTRAINPUTREPORT_H__
#define __SPAR_ULTRAINPUTREPORT_H__

#include <linux/types.h>

#include "ultrainputreport.h"

/* Identifies mouse and keyboard activity which is specified by the firmware to
 *  the host using the cmsimpleinput protocol.  @ingroup coretypes
 */
enum ultra_inputaction {
	inputaction_none = 0,
	inputaction_xy_motion = 1,	/* only motion; arg1=x, arg2=y */
	inputaction_mouse_button_down = 2, /* arg1: 1=left,2=center,3=right */
	inputaction_mouse_button_up = 3, /* arg1: 1=left,2=center,3=right */
	inputaction_mouse_button_click = 4, /* arg1: 1=left,2=center,3=right */
	inputaction_mouse_button_dclick = 5, /* arg1: 1=left,2=center,
						3=right */
	inputaction_wheel_rotate_away = 6, /* arg1: wheel rotation away from
					      user */
	inputaction_wheel_rotate_toward = 7, /* arg1: wheel rotation toward
						user */
	inputaction_set_max_xy = 8,	/* set screen maxXY; arg1=x, arg2=y */
	inputaction_key_down = 64,	/* arg1: scancode, as follows:
					   If arg1 <= 0xff, it's a 1-byte
					   scancode and arg1 is that scancode.
					   If arg1 > 0xff, it's a 2-byte
					   scanecode, with the 1st byte in the
					   low 8 bits, and the 2nd byte in the
					   high 8 bits.  E.g., the right ALT key
					   would appear as x'38e0'. */
	inputaction_key_up = 65,	/* arg1: scancode (in same format as
					   inputaction_keyDown) */
	inputaction_set_locking_key_state = 66,
					/* arg1: scancode (in same format
						 as inputaction_keyDown);
						 MUST refer to one of the
						 locking keys, like capslock,
						 numlock, or scrolllock
					   arg2: 1 iff locking key should be
						 in the LOCKED position
						 (e.g., light is ON) */
	inputaction_key_down_up = 67,	/* arg1: scancode (in same format
						 as inputaction_keyDown) */
	inputaction_last
};

struct ultra_inputactivity {
	u16 action;
	u16 arg1;
	u16 arg2;
	u16 arg3;
} __packed;

struct ultra_inputreport {
	u64 seq_no;
	struct ultra_inputactivity activity;
} __packed;

#endif