Commit 29a3381a2f609653b5c6933706a8d0449e4b7600
1 parent
5a9a1b1828
Exists in
master
and in
2 other branches
touch - tsc2007 수정
Showing
4 changed files
with
93 additions
and
2 deletions
Show diff stats
kernel/linux-imx6_3.14.28/arch/arm/boot/dts/imx6qdl-prime-oven.dtsi
kernel/linux-imx6_3.14.28/drivers/input/touchscreen/tsc2007.c
| ... | ... | @@ -170,13 +170,14 @@ static bool tsc2007_is_pen_down(struct tsc2007 *ts) |
| 170 | 170 | return ts->get_pendown_state(&ts->client->dev); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | +#if 0 // Org [FALINUX] 2017.10.11 tsheaven@falinux.com | |
| 173 | 174 | static irqreturn_t tsc2007_soft_irq(int irq, void *handle) |
| 174 | 175 | { |
| 175 | 176 | struct tsc2007 *ts = handle; |
| 176 | 177 | struct input_dev *input = ts->input; |
| 177 | 178 | struct ts_event tc; |
| 178 | 179 | u32 rt; |
| 179 | - | |
| 180 | + | |
| 180 | 181 | while (!ts->stopped && tsc2007_is_pen_down(ts)) { |
| 181 | 182 | |
| 182 | 183 | /* pen is down, continue with the measurement */ |
| ... | ... | @@ -212,6 +213,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) |
| 212 | 213 | * repeat at least once more the measurement. |
| 213 | 214 | */ |
| 214 | 215 | dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); |
| 216 | + printk("-DOWN point(%4d,%4d), pressure (%4u), ts->max_rt(%d)\n", | |
| 217 | + tc.x, tc.y, rt, ts->max_rt); | |
| 215 | 218 | } |
| 216 | 219 | |
| 217 | 220 | wait_event_timeout(ts->wait, ts->stopped, |
| ... | ... | @@ -229,6 +232,93 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) |
| 229 | 232 | |
| 230 | 233 | return IRQ_HANDLED; |
| 231 | 234 | } |
| 235 | +#else // [FALINUX] 2017.10.11 tsheaven@falinux.com | |
| 236 | +static irqreturn_t tsc2007_soft_irq(int irq, void *handle) | |
| 237 | +{ | |
| 238 | + struct tsc2007 *ts = handle; | |
| 239 | + struct input_dev *input = ts->input; | |
| 240 | + struct ts_event tc; | |
| 241 | + struct ts_event tmp_tc; | |
| 242 | + u32 rt; | |
| 243 | + char first_read = 0; | |
| 244 | + | |
| 245 | + while (!ts->stopped && tsc2007_is_pen_down(ts)) { | |
| 246 | + | |
| 247 | + /* pen is down, continue with the measurement */ | |
| 248 | + tsc2007_read_values(ts, &tc); | |
| 249 | + | |
| 250 | + rt = tsc2007_calculate_pressure(ts, &tc); | |
| 251 | + | |
| 252 | + switch ( first_read ) { | |
| 253 | + case 0 : first_read = 1; | |
| 254 | + continue; | |
| 255 | + case 1 : first_read = 2; | |
| 256 | + continue; | |
| 257 | + case 2 : tmp_tc.x = tc.x; | |
| 258 | + tmp_tc.y = tc.y; | |
| 259 | + first_read = 3; | |
| 260 | + break; | |
| 261 | + case 3 : if( (rt < 150) || (rt > 700) ) { | |
| 262 | + continue; | |
| 263 | + } | |
| 264 | + if( (abs(tmp_tc.x - tc.x) > 200) || (abs(tmp_tc.y - tc.y) > 200) ) { | |
| 265 | + first_read = 0; | |
| 266 | + continue; | |
| 267 | + } | |
| 268 | + break; | |
| 269 | + } | |
| 270 | + | |
| 271 | + if (!rt && !ts->get_pendown_state) { | |
| 272 | + /* | |
| 273 | + * If pressure reported is 0 and we don't have | |
| 274 | + * callback to check pendown state, we have to | |
| 275 | + * assume that pen was lifted up. | |
| 276 | + */ | |
| 277 | + break; | |
| 278 | + } | |
| 279 | + | |
| 280 | + if (rt <= ts->max_rt) { | |
| 281 | + dev_dbg(&ts->client->dev, | |
| 282 | + "DOWN point(%4d,%4d), pressure (%4u)\n", | |
| 283 | + tc.x, tc.y, rt); | |
| 284 | + | |
| 285 | + input_report_key(input, BTN_TOUCH, 1); | |
| 286 | + input_report_abs(input, ABS_X, tc.x); | |
| 287 | + input_report_abs(input, ABS_Y, tc.y); | |
| 288 | + input_report_abs(input, ABS_PRESSURE, rt); | |
| 289 | + | |
| 290 | + input_sync(input); | |
| 291 | + | |
| 292 | + } else { | |
| 293 | + /* | |
| 294 | + * Sample found inconsistent by debouncing or pressure is | |
| 295 | + * beyond the maximum. Don't report it to user space, | |
| 296 | + * repeat at least once more the measurement. | |
| 297 | + */ | |
| 298 | + dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); | |
| 299 | + printk("-DOWN point(%4d,%4d), pressure (%4u), ts->max_rt(%d)\n", | |
| 300 | + tc.x, tc.y, rt, ts->max_rt); | |
| 301 | + } | |
| 302 | + | |
| 303 | + tmp_tc.x = tc.x; | |
| 304 | + tmp_tc.y = tc.y; | |
| 305 | + | |
| 306 | + wait_event_timeout(ts->wait, ts->stopped, | |
| 307 | + msecs_to_jiffies(ts->poll_period)); | |
| 308 | + } | |
| 309 | + | |
| 310 | + dev_dbg(&ts->client->dev, "UP\n"); | |
| 311 | + | |
| 312 | + input_report_key(input, BTN_TOUCH, 0); | |
| 313 | + input_report_abs(input, ABS_PRESSURE, 0); | |
| 314 | + input_sync(input); | |
| 315 | + | |
| 316 | + if (ts->clear_penirq) | |
| 317 | + ts->clear_penirq(); | |
| 318 | + | |
| 319 | + return IRQ_HANDLED; | |
| 320 | +} | |
| 321 | +#endif | |
| 232 | 322 | |
| 233 | 323 | static irqreturn_t tsc2007_hard_irq(int irq, void *handle) |
| 234 | 324 | { | ... | ... |
release/imx6s-prime-oven.dtb
No preview for this file type
release/uImage
No preview for this file type