Lines Matching +full:touchscreen +full:- +full:min +full:- +full:pressure
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Generic DT helper functions for touchscreen devices
11 #include <linux/input/touchscreen.h>
34 int min, int max, int fuzz) in touchscreen_set_params() argument
38 if (!test_bit(axis, dev->absbit)) { in touchscreen_set_params()
39 dev_warn(&dev->dev, in touchscreen_set_params()
45 absinfo = &dev->absinfo[axis]; in touchscreen_set_params()
46 absinfo->minimum = min; in touchscreen_set_params()
47 absinfo->maximum = max; in touchscreen_set_params()
48 absinfo->fuzz = fuzz; in touchscreen_set_params()
52 * touchscreen_parse_properties - parse common touchscreen DT properties
55 * single-touch or multi-touch axes
67 struct device *dev = input->dev.parent; in touchscreen_parse_properties()
74 if (!input->absinfo) in touchscreen_parse_properties()
80 data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-x", in touchscreen_parse_properties()
83 touchscreen_get_prop_u32(dev, "touchscreen-size-x", in touchscreen_parse_properties()
87 touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x", in touchscreen_parse_properties()
91 touchscreen_set_params(input, axis_x, minimum, maximum - 1, fuzz); in touchscreen_parse_properties()
93 data_present = touchscreen_get_prop_u32(dev, "touchscreen-min-y", in touchscreen_parse_properties()
96 touchscreen_get_prop_u32(dev, "touchscreen-size-y", in touchscreen_parse_properties()
100 touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y", in touchscreen_parse_properties()
104 touchscreen_set_params(input, axis_y, minimum, maximum - 1, fuzz); in touchscreen_parse_properties()
108 "touchscreen-max-pressure", in touchscreen_parse_properties()
112 "touchscreen-fuzz-pressure", in touchscreen_parse_properties()
121 prop->max_x = input_abs_get_max(input, axis_x); in touchscreen_parse_properties()
122 prop->max_y = input_abs_get_max(input, axis_y); in touchscreen_parse_properties()
124 prop->invert_x = in touchscreen_parse_properties()
125 device_property_read_bool(dev, "touchscreen-inverted-x"); in touchscreen_parse_properties()
126 if (prop->invert_x) { in touchscreen_parse_properties()
127 absinfo = &input->absinfo[axis_x]; in touchscreen_parse_properties()
128 absinfo->maximum -= absinfo->minimum; in touchscreen_parse_properties()
129 absinfo->minimum = 0; in touchscreen_parse_properties()
132 prop->invert_y = in touchscreen_parse_properties()
133 device_property_read_bool(dev, "touchscreen-inverted-y"); in touchscreen_parse_properties()
134 if (prop->invert_y) { in touchscreen_parse_properties()
135 absinfo = &input->absinfo[axis_y]; in touchscreen_parse_properties()
136 absinfo->maximum -= absinfo->minimum; in touchscreen_parse_properties()
137 absinfo->minimum = 0; in touchscreen_parse_properties()
140 prop->swap_x_y = in touchscreen_parse_properties()
141 device_property_read_bool(dev, "touchscreen-swapped-x-y"); in touchscreen_parse_properties()
142 if (prop->swap_x_y) in touchscreen_parse_properties()
143 swap(input->absinfo[axis_x], input->absinfo[axis_y]); in touchscreen_parse_properties()
151 if (prop->invert_x) in touchscreen_apply_prop_to_x_y()
152 *x = prop->max_x - *x; in touchscreen_apply_prop_to_x_y()
154 if (prop->invert_y) in touchscreen_apply_prop_to_x_y()
155 *y = prop->max_y - *y; in touchscreen_apply_prop_to_x_y()
157 if (prop->swap_x_y) in touchscreen_apply_prop_to_x_y()
162 * touchscreen_set_mt_pos - Set input_mt_pos coordinates
177 pos->x = x; in touchscreen_set_mt_pos()
178 pos->y = y; in touchscreen_set_mt_pos()
183 * touchscreen_report_pos - Report touchscreen coordinates
188 * @multitouch: Report coordinates on single-touch or multi-touch axes
206 MODULE_DESCRIPTION("Device-tree helpers functions for touchscreen devices");