AnsweredAssumed Answered

fsl-arm-yocto-L4.1.15 TSC2046 not work

Question asked by 贾继中 贾继中 on Dec 22, 2016
Latest reply on Dec 25, 2016 by 贾继中 贾继中

fsl-arm-yocto-L4.1.15_2.00/L4.1.15_1.2.0 tsc2046 not work properly.the left-top and right-bottom coordinates is currect only.the device tree works okay on fsl-arm-yocto-L3.14.28

device tree:

&ecspi2 {

fsl,spi-num-chipselects = <1>;
cs-gpios = <&gpio5 29 0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_ecspi2>;
status = "okay";

tsc2046@0 {
reg = <0>; /* CS0 */
compatible = "ti,tsc2046";
interrupt-parent = <&gpio3>;
interrupts = <26 0>;
spi-max-frequency = <1500000>;
pendown-gpio = <&gpio3 26 0>;
ti,penirq-recheck-delay-usecs = <200>;
ti,swap-xy = <1>;
ti,x-min = /bits/ 16 <0>;
ti,x-max = /bits/ 16 <4095>;
ti,y-min = /bits/ 16 <0>;
ti,y-max = /bits/ 16 <4095>;
#if 0
ti,x-min = /bits/ 16 <0>;
ti,x-max = /bits/ 16 <10240>;
ti,y-min = /bits/ 16 <0>;
ti,y-max = /bits/ 16 <7680>;
ti,x-plate-ohms = /bits/ 16 <460>;
ti,y-plate-ohms = /bits/ 16 <360>;
//ti,pressure-max = /bits/ 16 <255>;
ti,debounce-max = /bits/ 16 <30>;
ti,debounce-tol = /bits/ 16 <10>;
ti,debounce-rep = /bits/ 16 <1>;
#endif
linux,wakeup;
};

};

debug logo:

 

Input device name: "ADS7846 Touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 0
Min 0
Max 4095
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 0
Properties:
Testing ... (interrupt to exit)
Event: time 1482392718.447269, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1482392718.447269, type 3 (EV_ABS), code 0 (ABS_X), value 391
Event: time 1482392718.447269, type 3 (EV_ABS), code 1 (ABS_Y), value 3231
Event: time 1482392718.447269, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65261
Event: time 1482392718.447269, -------------- EV_SYN ------------
Event: time 1482392718.457254, type 3 (EV_ABS), code 0 (ABS_X), value 384
Event: time 1482392718.457254, type 3 (EV_ABS), code 1 (ABS_Y), value 3222
Event: time 1482392718.457254, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65274
Event: time 1482392718.457254, -------------- EV_SYN ------------
Event: time 1482392718.467249, type 3 (EV_ABS), code 0 (ABS_X), value 383
Event: time 1482392718.467249, type 3 (EV_ABS), code 1 (ABS_Y), value 3216
Event: time 1482392718.467249, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65277
Event: time 1482392718.467249, -------------- EV_SYN ------------
Event: time 1482392718.477240, type 3 (EV_ABS), code 0 (ABS_X), value 393
Event: time 1482392718.477240, type 3 (EV_ABS), code 1 (ABS_Y), value 3201
Event: time 1482392718.477240, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65253
Event: time 1482392718.477240, -------------- EV_SYN ------------
Event: time 1482392718.487237, type 3 (EV_ABS), code 1 (ABS_Y), value 3209
Event: time 1482392718.487237, -------------- EV_SYN ------------
Event: time 1482392718.497224, type 3 (EV_ABS), code 0 (ABS_X), value 394
Event: time 1482392718.497224, type 3 (EV_ABS), code 1 (ABS_Y), value 3220
Event: time 1482392718.497224, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65254
Event: time 1482392718.497224, -------------- EV_SYN ------------
Event: time 1482392718.507225, type 3 (EV_ABS), code 0 (ABS_X), value 393
Event: time 1482392718.507225, type 3 (EV_ABS), code 1 (ABS_Y), value 3224
Event: time 1482392718.507225, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65257
Event: time 1482392718.507225, -------------- EV_SYN ------------
Event: time 1482392718.517239, type 3 (EV_ABS), code 0 (ABS_X), value 392
Event: time 1482392718.517239, type 3 (EV_ABS), code 1 (ABS_Y), value 3216
Event: time 1482392718.517239, -------------- EV_SYN ------------
Event: time 1482392718.527222, type 3 (EV_ABS), code 0 (ABS_X), value 403
Event: time 1482392718.527222, type 3 (EV_ABS), code 1 (ABS_Y), value 3205
Event: time 1482392718.527222, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65235
Event: time 1482392718.527222, -------------- EV_SYN ------------
Event: time 1482392718.537223, type 3 (EV_ABS), code 0 (ABS_X), value 477
Event: time 1482392718.537223, type 3 (EV_ABS), code 1 (ABS_Y), value 3214
Event: time 1482392718.537223, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65196
Event: time 1482392718.537223, -------------- EV_SYN ------------
Event: time 1482392718.546858, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1482392718.546858, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1482392718.546858, -------------- EV_SYN ------------
Event: time 1482392722.427263, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1482392722.427263, type 3 (EV_ABS), code 0 (ABS_X), value 520
Event: time 1482392722.427263, type 3 (EV_ABS), code 1 (ABS_Y), value 2532
Event: time 1482392722.427263, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65188
Event: time 1482392722.427263, -------------- EV_SYN ------------
Event: time 1482392722.437243, type 3 (EV_ABS), code 0 (ABS_X), value 526
Event: time 1482392722.437243, type 3 (EV_ABS), code 1 (ABS_Y), value 2502
Event: time 1482392722.437243, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65192
Event: time 1482392722.437243, -------------- EV_SYN ------------
Event: time 1482392722.447232, type 3 (EV_ABS), code 0 (ABS_X), value 528
Event: time 1482392722.447232, type 3 (EV_ABS), code 1 (ABS_Y), value 2449
Event: time 1482392722.447232, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65196
Event: t[ 30.293342] random: nonblocking pool is initialized
ime 1482392722.447232, -------------- EV_SYN ------------
Event: time 1482392722.457230, type 3 (EV_ABS), code 0 (ABS_X), value 535
Event: time 1482392722.457230, type 3 (EV_ABS), code 1 (ABS_Y), value 2411
Event: time 1482392722.457230, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65199
Event: time 1482392722.457230, -------------- EV_SYN ------------
Event: time 1482392722.467229, type 3 (EV_ABS), code 0 (ABS_X), value 538
Event: time 1482392722.467229, type 3 (EV_ABS), code 1 (ABS_Y), value 2400
Event: time 1482392722.467229, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65200
Event: time 1482392722.467229, -------------- EV_SYN ------------
Event: time 1482392722.477229, type 3 (EV_ABS), code 1 (ABS_Y), value 2399
Event: time 1482392722.477229, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65195
Event: time 1482392722.477229, -------------- EV_SYN ------------
Event: time 1482392722.487221, type 3 (EV_ABS), code 0 (ABS_X), value 532
Event: time 1482392722.487221, type 3 (EV_ABS), code 1 (ABS_Y), value 2383
Event: time 1482392722.487221, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65199
Event: time 1482392722.487221, -------------- EV_SYN ------------
Event: time 1482392722.497230, type 3 (EV_ABS), code 0 (ABS_X), value 528
Event: time 1482392722.497230, type 3 (EV_ABS), code 1 (ABS_Y), value 2400
Event: time 1482392722.497230, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65198
Event: time 1482392722.497230, -------------- EV_SYN ------------
Event: time 1482392722.513087, type 3 (EV_ABS), code 0 (ABS_X), value 525
Event: time 1482392722.513087, type 3 (EV_ABS), code 1 (ABS_Y), value 2436
Event: time 1482392722.513087, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65195
Event: time 1482392722.513087, -------------- EV_SYN ------------
Event: time 1482392722.517220, type 3 (EV_ABS), code 0 (ABS_X), value 516
Event: time 1482392722.517220, type 3 (EV_ABS), code 1 (ABS_Y), value 2470
Event: time 1482392722.517220, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65197
Event: time 1482392722.517220, -------------- EV_SYN ------------
Event: time 1482392722.527246, type 3 (EV_ABS), code 0 (ABS_X), value 509
Event: time 1482392722.527246, type 3 (EV_ABS), code 1 (ABS_Y), value 2515
Event: time 1482392722.527246, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65189
Event: time 1482392722.527246, -------------- EV_SYN ------------
Event: time 1482392722.537235, type 3 (EV_ABS), code 1 (ABS_Y), value 2527
Event: time 1482392722.537235, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65181
Event: time 1482392722.537235, -------------- EV_SYN ------------
Event: time 1482392722.547232, type 3 (EV_ABS), code 0 (ABS_X), value 506
Event: time 1482392722.547232, type 3 (EV_ABS), code 1 (ABS_Y), value 2690
Event: time 1482392722.547232, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65530
Event: time 1482392722.547232, -------------- EV_SYN ------------
Event: time 1482392722.556860, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1482392722.556860, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1482392722.556860, -------------- EV_SYN ------------
Event: time 1482392724.227272, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1482392724.227272, type 3 (EV_ABS), code 0 (ABS_X), value 792
Event: time 1482392724.227272, type 3 (EV_ABS), code 1 (ABS_Y), value 2948
Event: time 1482392724.227272, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65524
Event: time 1482392724.227272, -------------- EV_SYN ------------
Event: time 1482392724.237243, type 3 (EV_ABS), code 0 (ABS_X), value 803
Event: time 1482392724.237243, type 3 (EV_ABS), code 1 (ABS_Y), value 2927
Event: time 1482392724.237243, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65519
Event: time 1482392724.237243, -------------- EV_SYN ------------
Event: time 1482392724.247242, type 3 (EV_ABS), code 0 (ABS_X), value 838
Event: time 1482392724.247242, type 3 (EV_ABS), code 1 (ABS_Y), value 2928
Event: time 1482392724.247242, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65530
Event: time 1482392724.247242, -------------- EV_SYN ------------
Event: time 1482392724.257264, type 3 (EV_ABS), code 0 (ABS_X), value 852
Event: time 1482392724.257264, type 3 (EV_ABS), code 1 (ABS_Y), value 2952
Event: time 1482392724.257264, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65529
Event: time 1482392724.257264, -------------- EV_SYN ------------
Event: time 1482392724.267253, type 3 (EV_ABS), code 0 (ABS_X), value 857
Event: time 1482392724.267253, type 3 (EV_ABS), code 1 (ABS_Y), value 2935
Event: time 1482392724.267253, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65526
Event: time 1482392724.267253, -------------- EV_SYN ------------
Event: time 1482392724.277248, type 3 (EV_ABS), code 0 (ABS_X), value 844
Event: time 1482392724.277248, type 3 (EV_ABS), code 1 (ABS_Y), value 2930
Event: time 1482392724.277248, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65528
Event: time 1482392724.277248, -------------- EV_SYN ------------
Event: time 1482392724.287252, type 3 (EV_ABS), code 0 (ABS_X), value 836
Event: time 1482392724.287252, type 3 (EV_ABS), code 1 (ABS_Y), value 2924
Event: time 1482392724.287252, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65529
Event: time 1482392724.287252, -------------- EV_SYN ------------
Event: time 1482392724.297282, type 3 (EV_ABS), code 0 (ABS_X), value 813
Event: time 1482392724.297282, type 3 (EV_ABS), code 1 (ABS_Y), value 2914
Event: time 1482392724.297282, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65524
Event: time 1482392724.297282, -------------- EV_SYN ------------
Event: time 1482392724.307258, type 3 (EV_ABS), code 0 (ABS_X), value 819
Event: time 1482392724.307258, type 3 (EV_ABS), code 1 (ABS_Y), value 2944
Event: time 1482392724.307258, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65527
Event: time 1482392724.307258, -------------- EV_SYN ------------
Event: time 1482392724.317263, type 3 (EV_ABS), code 0 (ABS_X), value 807
Event: time 1482392724.317263, type 3 (EV_ABS), code 1 (ABS_Y), value 2938
Event: time 1482392724.317263, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65529
Event: time 1482392724.317263, -------------- EV_SYN ------------
Event: time 1482392724.327251, type 3 (EV_ABS), code 0 (ABS_X), value 799
Event: time 1482392724.327251, type 3 (EV_ABS), code 1 (ABS_Y), value 2915
Event: time 1482392724.327251, -------------- EV_SYN ------------
Event: time 1482392724.337256, type 3 (EV_ABS), code 0 (ABS_X), value 795
Event: time 1482392724.337256, type 3 (EV_ABS), code 1 (ABS_Y), value 2920
Event: time 1482392724.337256, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65525
Event: time 1482392724.337256, -------------- EV_SYN ------------
Event: time 1482392724.347275, type 3 (EV_ABS), code 0 (ABS_X), value 791
Event: time 1482392724.347275, type 3 (EV_ABS), code 1 (ABS_Y), value 2915
Event: time 1482392724.347275, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65529
Event: time 1482392724.347275, -------------- EV_SYN ------------
Event: time 1482392724.357260, type 3 (EV_ABS), code 0 (ABS_X), value 773
Event: time 1482392724.357260, type 3 (EV_ABS), code 1 (ABS_Y), value 2937
Event: time 1482392724.357260, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65525
Event: time 1482392724.357260, -------------- EV_SYN ------------
Event: time 1482392724.366859, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1482392724.366859, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1482392724.366859, -------------- EV_SYN ------------
Event: time 1482392725.117270, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1482392725.117270, type 3 (EV_ABS), code 0 (ABS_X), value 459
Event: time 1482392725.117270, type 3 (EV_ABS), code 1 (ABS_Y), value 3282
Event: time 1482392725.117270, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65168
Event: time 1482392725.117270, -------------- EV_SYN ------------
Event: time 1482392725.127250, type 3 (EV_ABS), code 0 (ABS_X), value 400
Event: time 1482392725.127250, type 3 (EV_ABS), code 1 (ABS_Y), value 3295
Event: time 1482392725.127250, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65160
Event: time 1482392725.127250, -------------- EV_SYN ------------
Event: time 1482392725.137259, type 3 (EV_ABS), code 0 (ABS_X), value 386
Event: time 1482392725.137259, type 3 (EV_ABS), code 1 (ABS_Y), value 3287
Event: time 1482392725.137259, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65161
Event: time 1482392725.137259, -------------- EV_SYN ------------
Event: time 1482392725.147253, type 3 (EV_ABS), code 0 (ABS_X), value 374
Event: time 1482392725.147253, type 3 (EV_ABS), code 1 (ABS_Y), value 3289
Event: time 1482392725.147253, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65170
Event: time 1482392725.147253, -------------- EV_SYN ------------
Event: time 1482392725.157244, type 3 (EV_ABS), code 0 (ABS_X), value 376
Event: time 1482392725.157244, type 3 (EV_ABS), code 1 (ABS_Y), value 3308
Event: time 1482392725.157244, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65169
Event: time 1482392725.157244, -------------- EV_SYN ------------
Event: time 1482392725.167257, type 3 (EV_ABS), code 0 (ABS_X), value 375
Event: time 1482392725.167257, type 3 (EV_ABS), code 1 (ABS_Y), value 3328
Event: time 1482392725.167257, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65176
Event: time 1482392725.167257, -------------- EV_SYN ------------
Event: time 1482392725.177258, type 3 (EV_ABS), code 0 (ABS_X), value 378
Event: time 1482392725.177258, type 3 (EV_ABS), code 1 (ABS_Y), value 3317
Event: time 1482392725.177258, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65171
Event: time 1482392725.177258, -------------- EV_SYN ------------
Event: time 1482392725.187254, type 3 (EV_ABS), code 0 (ABS_X), value 357
Event: time 1482392725.187254, type 3 (EV_ABS), code 1 (ABS_Y), value 3323
Event: time 1482392725.187254, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65181
Event: time 1482392725.187254, -------------- EV_SYN ------------
Event: time 1482392725.197254, type 3 (EV_ABS), code 0 (ABS_X), value 369
Event: time 1482392725.197254, type 3 (EV_ABS), code 1 (ABS_Y), value 3291
Event: time 1482392725.197254, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65170
Event: time 1482392725.197254, -------------- EV_SYN ------------
Event: time 1482392725.206858, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1482392725.206858, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1482392725.206858, -------------- EV_SYN ------------

 

root@imx6dlsabresd:~# ts_calibrate
xres = 1024, yres = 768
Took 22 samples...
Top left : X = 367 Y = 3217
[ 31.323482] random: nonblocking pool is initialized
Took 23 samples...
Top right : X = 575 Y = 2175
Took 22 samples...
Bot right : X = 994 Y = 2960
Took 23 samples...
Bot left : X = 353 Y = 3328
Took 17 samples...
Center : X = 479 Y = 3007
1667.015625 1.114505 -0.603251
-1487.714844 0.748165 0.496201
Calibration constants: 109249536 73040 -39534 -97498880 49031 32519 65536

 

on L3.14.28 ts_calibrate shows bigger value

root@imx6dlsabresd:~# ts_calibrate
xres = 1024, yres = 768
Took 22 samples...
Top left : X = 4000+ Y = 7000+
[ 31.323482] random: nonblocking pool is initialized
Took 23 samples...
Top right : X = 7000+ Y = 7000+
Took 22 samples...
Bot right : X = 7000+ Y = 4000+
Took 23 samples...
Bot left : X = 4000+ Y = 7000+
Took 17 samples...
Center : X = 5000+ Y = 5000+
1667.015625 1.114505 -0.603251
-1487.714844 0.748165 0.496201
Calibration constants: 109249536 73040 -39534 -97498880 49031 32519 65536

 

 

I noticed a difference of two drivers

see:2016-12-22 16:59:37的屏幕截图.png

I modified ads7846.c as below,it's still not work properly

see:2016-12-22 16:59:28的屏幕截图.png

I modified x-max to 10240 and y-max to 7680,it's get closer,but still not accurate

Outcomes