xref: /OK3568_Linux_fs/kernel/include/linux/input/touchscreen.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (c) 2014 Sebastian Reichel <sre@kernel.org>
4*4882a593Smuzhiyun  */
5*4882a593Smuzhiyun 
6*4882a593Smuzhiyun #ifndef _TOUCHSCREEN_H
7*4882a593Smuzhiyun #define _TOUCHSCREEN_H
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun struct input_dev;
10*4882a593Smuzhiyun struct input_mt_pos;
11*4882a593Smuzhiyun 
12*4882a593Smuzhiyun struct touchscreen_properties {
13*4882a593Smuzhiyun 	unsigned int max_x;
14*4882a593Smuzhiyun 	unsigned int max_y;
15*4882a593Smuzhiyun 	bool invert_x;
16*4882a593Smuzhiyun 	bool invert_y;
17*4882a593Smuzhiyun 	bool swap_x_y;
18*4882a593Smuzhiyun };
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
21*4882a593Smuzhiyun 				  struct touchscreen_properties *prop);
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun void touchscreen_set_mt_pos(struct input_mt_pos *pos,
24*4882a593Smuzhiyun 			    const struct touchscreen_properties *prop,
25*4882a593Smuzhiyun 			    unsigned int x, unsigned int y);
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun void touchscreen_report_pos(struct input_dev *input,
28*4882a593Smuzhiyun 			    const struct touchscreen_properties *prop,
29*4882a593Smuzhiyun 			    unsigned int x, unsigned int y,
30*4882a593Smuzhiyun 			    bool multitouch);
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #endif
33