Lines Matching +full:touchscreen +full:- +full:max +full:- +full:pressure
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Generic helper functions for touchscreens and other two-dimensional
12 #include <linux/input/touchscreen.h>
35 int min, int max, int fuzz) in touchscreen_set_params() argument
39 if (!test_bit(axis, dev->absbit)) { in touchscreen_set_params()
40 dev_warn(&dev->dev, in touchscreen_set_params()
46 absinfo = &dev->absinfo[axis]; in touchscreen_set_params()
47 absinfo->minimum = min; in touchscreen_set_params()
48 absinfo->maximum = max; in touchscreen_set_params()
49 absinfo->fuzz = fuzz; in touchscreen_set_params()
53 * touchscreen_parse_properties - parse common touchscreen properties
56 * single-touch or multi-touch axes
68 struct device *dev = input->dev.parent; in touchscreen_parse_properties()
75 if (!input->absinfo) in touchscreen_parse_properties()
81 data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", in touchscreen_parse_properties()
84 data_present |= touchscreen_get_prop_u32(dev, "touchscreen-size-x", in touchscreen_parse_properties()
88 data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x", in touchscreen_parse_properties()
92 touchscreen_set_params(input, axis_x, minimum, maximum - 1, fuzz); in touchscreen_parse_properties()
94 data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-y", in touchscreen_parse_properties()
97 data_present |= touchscreen_get_prop_u32(dev, "touchscreen-size-y", in touchscreen_parse_properties()
101 data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y", in touchscreen_parse_properties()
105 touchscreen_set_params(input, axis_y, minimum, maximum - 1, fuzz); in touchscreen_parse_properties()
109 "touchscreen-max-pressure", in touchscreen_parse_properties()
113 "touchscreen-fuzz-pressure", in touchscreen_parse_properties()
122 prop->max_x = input_abs_get_max(input, axis_x); in touchscreen_parse_properties()
123 prop->max_y = input_abs_get_max(input, axis_y); in touchscreen_parse_properties()
125 prop->invert_x = in touchscreen_parse_properties()
126 device_property_read_bool(dev, "touchscreen-inverted-x"); in touchscreen_parse_properties()
127 if (prop->invert_x) { in touchscreen_parse_properties()
128 absinfo = &input->absinfo[axis_x]; in touchscreen_parse_properties()
129 absinfo->maximum -= absinfo->minimum; in touchscreen_parse_properties()
130 absinfo->minimum = 0; in touchscreen_parse_properties()
133 prop->invert_y = in touchscreen_parse_properties()
134 device_property_read_bool(dev, "touchscreen-inverted-y"); in touchscreen_parse_properties()
135 if (prop->invert_y) { in touchscreen_parse_properties()
136 absinfo = &input->absinfo[axis_y]; in touchscreen_parse_properties()
137 absinfo->maximum -= absinfo->minimum; in touchscreen_parse_properties()
138 absinfo->minimum = 0; in touchscreen_parse_properties()
141 prop->swap_x_y = in touchscreen_parse_properties()
142 device_property_read_bool(dev, "touchscreen-swapped-x-y"); in touchscreen_parse_properties()
143 if (prop->swap_x_y) in touchscreen_parse_properties()
144 swap(input->absinfo[axis_x], input->absinfo[axis_y]); in touchscreen_parse_properties()
152 if (prop->invert_x) in touchscreen_apply_prop_to_x_y()
153 *x = prop->max_x - *x; in touchscreen_apply_prop_to_x_y()
155 if (prop->invert_y) in touchscreen_apply_prop_to_x_y()
156 *y = prop->max_y - *y; in touchscreen_apply_prop_to_x_y()
158 if (prop->swap_x_y) in touchscreen_apply_prop_to_x_y()
163 * touchscreen_set_mt_pos - Set input_mt_pos coordinates
178 pos->x = x; in touchscreen_set_mt_pos()
179 pos->y = y; in touchscreen_set_mt_pos()
184 * touchscreen_report_pos - Report touchscreen coordinates
189 * @multitouch: Report coordinates on single-touch or multi-touch axes