@@ -66,41 +66,42 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
66
66
{
67
67
struct device * dev = input -> dev .parent ;
68
68
struct input_absinfo * absinfo ;
69
- unsigned int axis ;
69
+ unsigned int axis , axis_x , axis_y ;
70
70
unsigned int minimum , maximum , fuzz ;
71
71
bool data_present ;
72
72
73
73
input_alloc_absinfo (input );
74
74
if (!input -> absinfo )
75
75
return ;
76
76
77
- axis = multitouch ? ABS_MT_POSITION_X : ABS_X ;
77
+ axis_x = multitouch ? ABS_MT_POSITION_X : ABS_X ;
78
+ axis_y = multitouch ? ABS_MT_POSITION_Y : ABS_Y ;
79
+
78
80
data_present = touchscreen_get_prop_u32 (dev , "touchscreen-min-x" ,
79
- input_abs_get_min (input , axis ),
81
+ input_abs_get_min (input , axis_x ),
80
82
& minimum ) |
81
83
touchscreen_get_prop_u32 (dev , "touchscreen-size-x" ,
82
84
input_abs_get_max (input ,
83
- axis ) + 1 ,
85
+ axis_x ) + 1 ,
84
86
& maximum ) |
85
87
touchscreen_get_prop_u32 (dev , "touchscreen-fuzz-x" ,
86
- input_abs_get_fuzz (input , axis ),
88
+ input_abs_get_fuzz (input , axis_x ),
87
89
& fuzz );
88
90
if (data_present )
89
- touchscreen_set_params (input , axis , minimum , maximum - 1 , fuzz );
91
+ touchscreen_set_params (input , axis_x , minimum , maximum - 1 , fuzz );
90
92
91
- axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y ;
92
93
data_present = touchscreen_get_prop_u32 (dev , "touchscreen-min-y" ,
93
- input_abs_get_min (input , axis ),
94
+ input_abs_get_min (input , axis_y ),
94
95
& minimum ) |
95
96
touchscreen_get_prop_u32 (dev , "touchscreen-size-y" ,
96
97
input_abs_get_max (input ,
97
- axis ) + 1 ,
98
+ axis_y ) + 1 ,
98
99
& maximum ) |
99
100
touchscreen_get_prop_u32 (dev , "touchscreen-fuzz-y" ,
100
- input_abs_get_fuzz (input , axis ),
101
+ input_abs_get_fuzz (input , axis_y ),
101
102
& fuzz );
102
103
if (data_present )
103
- touchscreen_set_params (input , axis , minimum , maximum - 1 , fuzz );
104
+ touchscreen_set_params (input , axis_y , minimum , maximum - 1 , fuzz );
104
105
105
106
axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE ;
106
107
data_present = touchscreen_get_prop_u32 (dev ,
@@ -117,31 +118,29 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
117
118
if (!prop )
118
119
return ;
119
120
120
- axis = multitouch ? ABS_MT_POSITION_X : ABS_X ;
121
-
122
- prop -> max_x = input_abs_get_max (input , axis );
123
- prop -> max_y = input_abs_get_max (input , axis + 1 );
121
+ prop -> max_x = input_abs_get_max (input , axis_x );
122
+ prop -> max_y = input_abs_get_max (input , axis_y );
124
123
125
124
prop -> invert_x =
126
125
device_property_read_bool (dev , "touchscreen-inverted-x" );
127
126
if (prop -> invert_x ) {
128
- absinfo = & input -> absinfo [axis ];
127
+ absinfo = & input -> absinfo [axis_x ];
129
128
absinfo -> maximum -= absinfo -> minimum ;
130
129
absinfo -> minimum = 0 ;
131
130
}
132
131
133
132
prop -> invert_y =
134
133
device_property_read_bool (dev , "touchscreen-inverted-y" );
135
134
if (prop -> invert_y ) {
136
- absinfo = & input -> absinfo [axis + 1 ];
135
+ absinfo = & input -> absinfo [axis_y ];
137
136
absinfo -> maximum -= absinfo -> minimum ;
138
137
absinfo -> minimum = 0 ;
139
138
}
140
139
141
140
prop -> swap_x_y =
142
141
device_property_read_bool (dev , "touchscreen-swapped-x-y" );
143
142
if (prop -> swap_x_y )
144
- swap (input -> absinfo [axis ], input -> absinfo [axis + 1 ]);
143
+ swap (input -> absinfo [axis_x ], input -> absinfo [axis_y ]);
145
144
}
146
145
EXPORT_SYMBOL (touchscreen_parse_properties );
147
146
0 commit comments