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