kernel_optimize_test/include/linux/input/touchscreen.h
Hans de Goede ed7c9870c9 Input: of_touchscreen - add support for inverted / swapped axes
Extend touchscreen_parse_properties() with support for the
touchscreen-inverted-x/y and touchscreen-swapped-x-y properties and
add touchscreen_set_mt_pos() and touchscreen_report_pos() helper
functions for storing coordinates into a input_mt_pos struct, or
directly reporting them, taking these properties into account.

This commit also modifies the existing callers of
touchscreen_parse_properties() to pass in NULL for the new third
argument, keeping the existing behavior.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-07-15 14:50:53 -07:00

36 lines
909 B
C

/*
* Copyright (c) 2014 Sebastian Reichel <sre@kernel.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef _TOUCHSCREEN_H
#define _TOUCHSCREEN_H
struct input_dev;
struct input_mt_pos;
struct touchscreen_properties {
unsigned int max_x;
unsigned int max_y;
bool invert_x;
bool invert_y;
bool swap_x_y;
};
void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
struct touchscreen_properties *prop);
void touchscreen_set_mt_pos(struct input_mt_pos *pos,
const struct touchscreen_properties *prop,
unsigned int x, unsigned int y);
void touchscreen_report_pos(struct input_dev *input,
const struct touchscreen_properties *prop,
unsigned int x, unsigned int y,
bool multitouch);
#endif