Lines Matching +full:x +full:- +full:axis
37 unsigned long axis, in touchscreen_set_params() argument
42 if (!test_bit(axis, dev->absbit)) { in touchscreen_set_params()
43 dev_warn(&dev->dev, in touchscreen_set_params()
44 "DT specifies parameters but the axis %lu is not set up\n", in touchscreen_set_params()
45 axis); in touchscreen_set_params()
49 absinfo = &dev->absinfo[axis]; in touchscreen_set_params()
50 absinfo->maximum = max; in touchscreen_set_params()
51 absinfo->fuzz = fuzz; in touchscreen_set_params()
55 * touchscreen_parse_properties - parse common touchscreen DT properties
58 * single-touch or multi-touch axes
60 * axis swap and invert info for use with touchscreen_report_x_y();
70 struct device *dev = input->dev.parent; in touchscreen_parse_properties()
71 unsigned int axis; in touchscreen_parse_properties() local
76 if (!input->absinfo) in touchscreen_parse_properties()
79 axis = multitouch ? ABS_MT_POSITION_X : ABS_X; in touchscreen_parse_properties()
80 data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x", in touchscreen_parse_properties()
82 axis) + 1, in touchscreen_parse_properties()
84 touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x", in touchscreen_parse_properties()
85 input_abs_get_fuzz(input, axis), in touchscreen_parse_properties()
88 touchscreen_set_params(input, axis, maximum - 1, fuzz); in touchscreen_parse_properties()
90 axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y; in touchscreen_parse_properties()
91 data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y", in touchscreen_parse_properties()
93 axis) + 1, in touchscreen_parse_properties()
95 touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y", in touchscreen_parse_properties()
96 input_abs_get_fuzz(input, axis), in touchscreen_parse_properties()
99 touchscreen_set_params(input, axis, maximum - 1, fuzz); in touchscreen_parse_properties()
101 axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE; in touchscreen_parse_properties()
103 "touchscreen-max-pressure", in touchscreen_parse_properties()
104 input_abs_get_max(input, axis), in touchscreen_parse_properties()
107 "touchscreen-fuzz-pressure", in touchscreen_parse_properties()
108 input_abs_get_fuzz(input, axis), in touchscreen_parse_properties()
111 touchscreen_set_params(input, axis, maximum, fuzz); in touchscreen_parse_properties()
116 axis = multitouch ? ABS_MT_POSITION_X : ABS_X; in touchscreen_parse_properties()
118 prop->max_x = input_abs_get_max(input, axis); in touchscreen_parse_properties()
119 prop->max_y = input_abs_get_max(input, axis + 1); in touchscreen_parse_properties()
120 prop->invert_x = in touchscreen_parse_properties()
121 device_property_read_bool(dev, "touchscreen-inverted-x"); in touchscreen_parse_properties()
122 prop->invert_y = in touchscreen_parse_properties()
123 device_property_read_bool(dev, "touchscreen-inverted-y"); in touchscreen_parse_properties()
124 prop->swap_x_y = in touchscreen_parse_properties()
125 device_property_read_bool(dev, "touchscreen-swapped-x-y"); in touchscreen_parse_properties()
127 if (prop->swap_x_y) in touchscreen_parse_properties()
128 swap(input->absinfo[axis], input->absinfo[axis + 1]); in touchscreen_parse_properties()
134 unsigned int *x, unsigned int *y) in touchscreen_apply_prop_to_x_y() argument
136 if (prop->invert_x) in touchscreen_apply_prop_to_x_y()
137 *x = prop->max_x - *x; in touchscreen_apply_prop_to_x_y()
139 if (prop->invert_y) in touchscreen_apply_prop_to_x_y()
140 *y = prop->max_y - *y; in touchscreen_apply_prop_to_x_y()
142 if (prop->swap_x_y) in touchscreen_apply_prop_to_x_y()
143 swap(*x, *y); in touchscreen_apply_prop_to_x_y()
147 * touchscreen_set_mt_pos - Set input_mt_pos coordinates
150 * @x: X coordinate to store in pos
153 * Adjust the passed in x and y values applying any axis inversion and
159 unsigned int x, unsigned int y) in touchscreen_set_mt_pos() argument
161 touchscreen_apply_prop_to_x_y(prop, &x, &y); in touchscreen_set_mt_pos()
162 pos->x = x; in touchscreen_set_mt_pos()
163 pos->y = y; in touchscreen_set_mt_pos()
168 * touchscreen_report_pos - Report touchscreen coordinates
171 * @x: X coordinate to report
173 * @multitouch: Report coordinates on single-touch or multi-touch axes
175 * Adjust the passed in x and y values applying any axis inversion and
177 * report the resulting coordinates on the input_dev's x and y axis.
181 unsigned int x, unsigned int y, in touchscreen_report_pos() argument
184 touchscreen_apply_prop_to_x_y(prop, &x, &y); in touchscreen_report_pos()
185 input_report_abs(input, multitouch ? ABS_MT_POSITION_X : ABS_X, x); in touchscreen_report_pos()
191 MODULE_DESCRIPTION("Device-tree helpers functions for touchscreen devices");