AM335x touchscreen issues
Greetings,
I have been porting Linux to a new AM3554 based SoM and have found issues with the touchscreen reporting touch releases repeatedly to userspace without actually touching the screen when running ts_calibrate, ts_test or other graphical touchscreen applications.
This started happening after updating pulling recent changes.
It has also been confirmed to be happening on the beagle bone black:
http://www.spinics.net/lists/linux-iio/msg18580.html
If you look further into this thread you will see a workaround patch that I came up with:
http://www.spinics.net/lists/linux-iio/msg18583.html
Though this fix stops the reported events in userspace, interrupts are still occuring repeatedly.
Does anyone have any suggestions beyond what I have done to remedy this issue?
Regards,
Michael
Hi,
Quoted 8 lines · Michael Welling
Greetings,
I have been porting Linux to a new AM3554 based SoM and have found issues with the touchscreen reporting touch releases repeatedly to userspace without actually touching the screen when running
ts_calibrate,ts_testor other graphical touchscreen applications.This started happening after updating pulling recent changes.
Can you bisect and find the offending commit ? Which recent changes are you talking about ?
Quoted 7 lines
It has also been confirmed to be happening on the beagle bone black:
http://www.spinics.net/lists/linux-iio/msg18580.htmlIf you look further into this thread you will see a workaround patch that I came up with:
http://www.spinics.net/lists/linux-iio/msg18583.html
Quoted 5 lines
Though this fix stops the reported events in userspace, interrupts are still occuring repeatedly.
Does anyone have any suggestions beyond what I have done to remedy this issue?
yeah, it sounds similar to what Franklin has been working on.
Franklin, any comments ?
Signature · 1 line
balbi
Quoted 10 lines · Felipe Balbi
Hi,
Quoted 7 lines · Michael Welling
Greetings,
I have been porting Linux to a new AM3554 based SoM and have found issues with the touchscreen reporting touch releases repeatedly to userspace without actually touching the screen when running
ts_calibrate,ts_testor other graphical touchscreen applications.
Quoted 4 lines
Quoted 1 line
This started happening after updating pulling recent changes.
Can you bisect and find the offending commit ? Which recent changes are you talking about ?
Sorry that it took so long to find the offending commit, it appears that the issue occurs on my 4.3" display but not on my 7" display. I first performed the git bisect on the 7" display which ended up being fruitless.
Then I switched over the the 4.3" display and found the commit which starts having the issue.
michael@deathray:~/projects/linux/linux-torvalds$ git bisect start HEAD v3.18 -- drivers/input/touchscreen/ti_am335x_tsc.c . . michael@deathray:~/projects/linux/linux-torvalds$ git bisect bad 344d635b9a41b19837ccf8083a99ea688027019c is the first bad commit commit 344d635b9a41b19837ccf8083a99ea688027019c Author: Brad Griffis <[email protected]> Date: Tue Feb 3 11:44:12 2015 -0800
Input: ti_am335x_tsc - remove udelay in interrupt handler
TSC interrupt handler had udelay to avoid reporting of false pen-up interrupt to user space. This patch implements workaround suggesting in Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay and touchscreen lag. This also improves performance of touchscreen and eliminates sudden jump of cursor at touch release.
IDLECONFIG and CHARGECONFIG registers are to be configured with same values in order to eliminate false pen-up events. This workaround may result in false pen-down to be detected, hence considerable charge step delay needs to be added. The charge delay is set to 0xB000 (in terms of ADC clock cycles) by default.
TSC steps are disabled at the end of every sampling cycle and EOS bit is set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin next sampling cycle.
Hope this sheds some light.
Quoted 20 lines
Quoted 8 lines
It has also been confirmed to be happening on the beagle bone black:
http://www.spinics.net/lists/linux-iio/msg18580.htmlIf you look further into this thread you will see a workaround patch that I came up with:
http://www.spinics.net/lists/linux-iio/msg18583.htmlQuoted 5 lines
Though this fix stops the reported events in userspace, interrupts are still occuring repeatedly.
Does anyone have any suggestions beyond what I have done to remedy this issue?
yeah, it sounds similar to what Franklin has been working on.
Franklin, any comments ?
Signature · 1 line
balbi
Quoted 23 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 3:53 PM
To: Balbi, Felipe
Cc: Cooper Jr., Franklin; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issues
=20Quoted 10 lines · Felipe Balbi
Hi,
Quoted 7 lines · Michael Welling
Greetings,
I have been porting Linux to a new AM3554 based SoM and have found issues with the touchscreen reporting touch releases repeatedly to userspace without actually touching the screen when running
ts_calibrate,ts_testor other graphical touchscreen applications.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
This started happening after updating pulling recent changes.
Can you bisect and find the offending commit ? Which recent changes are you talking about ?
=20
Sorry that it took so long to find the offending commit, it appears that =
the
Quoted 1 line
issue occurs on my 4.3" display but not on my 7" display. I first perform=
ed the
Quoted 3 lines
git bisect on the 7" display which ended up being fruitless. =20
Then I switched over the the 4.3" display and found the commit which star=
ts
Quoted 16 lines
having the issue.
=20michael@deathray:~/projects/linux/linux-torvalds$ git bisect start HEAD v3.18 -- drivers/input/touchscreen/ti_am335x_tsc.c . . michael@deathray:~/projects/linux/linux-torvalds$ git bisect bad 344d635b9a41b19837ccf8083a99ea688027019c is the first bad commit commit 344d635b9a41b19837ccf8083a99ea688027019c Author: Brad Griffis <[email protected]> Date: Tue Feb 3 11:44:12 2015 -0800 =20 Input: ti_am335x_tsc - remove udelay in interrupt handler =20 TSC interrupt handler had udelay to avoid reporting of false pen-up interrupt to user space. This patch implements workaround suggesting =
in
Quoted 1 line
Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay=
and
Quoted 6 lines
touchscreen lag. This also improves performance of touchscreen and eliminates sudden jump of cursor at touch release.
=20
IDLECONFIG and CHARGECONFIG registers are to be configured with same
values
in order to eliminate false pen-up events. This workaround may result=
in
Quoted 6 lines
false pen-down to be detected, hence considerable charge step delay
needs
to be added. The charge delay is set to0xB000(in terms of ADC clock cycles) by default.
=20
TSC steps are disabled at the end of every sampling cycle and EOS bit=
is
Quoted 1 line
set. Once the EOS bit is set, the TSC steps need to be re-enabled to =
begin
Quoted 26 lines
next sampling cycle.
=20Signed-off-by Brad Griffis <[email protected]>[[email protected]: Ported the patch from v3.12 to v3.19rc1]Signed-off-by Vignesh R <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>=20
Hope this sheds some light.
=20Quoted 17 lines
Quoted 8 lines
It has also been confirmed to be happening on the beagle bone black:
http://www.spinics.net/lists/linux-iio/msg18580.htmlIf you look further into this thread you will see a workaround patch that I came up with:
http://www.spinics.net/lists/linux-iio/msg18583.htmlQuoted 5 lines
Though this fix stops the reported events in userspace, interrupts are still occuring repeatedly.
Does anyone have any suggestions beyond what I have done to remedy this issue?
yeah, it sounds similar to what Franklin has been working on.
Franklin, any comments ?
[Franklin]
Michael,
Can you send me the output of ts_test_raw after you done a 5 or so touch do= wn and touch up events? In the output let me know at which point in the log=
that the issue you observed has occurred. Please try to avoid moving your =
finger since I want to see the full output of that program but I'm not inte= rested any unnecessary pen down events.
I recently encountered several touchscreen problems that I am working on su= bmitting to mainline. Below are the variety of issues I discovered and fixe= d but its currently based on 3.14 kernel.
1. The x and y location right before a penup event is usually incorrect. Vi= sibly the causes the cursor to jump right before a touchup. So I implemente= d a way to ignore that incorrect event.
2. I discovered that for some reason a series of touch up events are sent b= ack to back. So I added something to ignore consecutive pen up events.
3. Sometimes a pen down event is reported with a pressure of 0. I noticed a= pplications like ts_lib looked at the pressure and thought a pressure of 0 = means a finger was lifted. So I added a patch that ignored 0 pressure pen d= own events. This prevented premature touchups.
4. I added debouncing. Essentially the driver didn't report any touch event= s for a user specified number of ms after a pen up occured. It was noticed = especially during touchscreen calibration that after a person lifted their = finger after touching the screen a combination of pen up and pen down event= s were incorrectly detected.
Most likely a combination of 2-4 is your problem. I think the udelay acted = like an unintentional debounce which is probably why it wasn't discovered s= ooner.
Quoted 4 lines
Quoted 3 lines
--
balbi=20
Quoted 4 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touch down and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Oddly the repeated pen up and down events do not occur when running ts_print_raw:
root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0
Here is what the output of ts_test looks like without even touching the screen:
root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0 1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0 . .
Quoted 13 lines
I recently encountered several touchscreen problems that I am working on submitting to mainline. Below are the variety of issues I discovered and fixed but its currently based on 3.14 kernel.
1. The x and y location right before a penup event is usually incorrect. Visibly the causes the cursor to jump right before a touchup. So I implemented a way to ignore that incorrect event.
2. I discovered that for some reason a series of touch up events are sent back to back. So I added something to ignore consecutive pen up events.
3. Sometimes a pen down event is reported with a pressure of 0. I noticed applications likets_liblooked at the pressure and thought a pressure of 0 means a finger was lifted. So I added a patch that ignored 0 pressure pen down events. This prevented premature touchups.
4. I added debouncing. Essentially the driver didn't report any touch events for a user specified number of ms after a pen up occured. It was noticed especially during touchscreen calibration that after a person lifted their finger after touching the screen a combination of pen up and pen down events were incorrectly detected.Most likely a combination of 2-4 is your problem. I think the udelay acted like an unintentional debounce which is probably why it wasn't discovered sooner.
Quoted 4 lines
Quoted 3 lines
--
balbi
Quoted 16 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issues
=20Quoted 3 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touc=
h
Quoted 2 lines
down and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving =
your
Quoted 75 lines
finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Quoted 1 line
=20
Oddly the repeated pen up and down events do not occur when runningts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0 =20 Here is what the output of ts_test looks like without even touching the screen: root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0
Quoted 8 lines
1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0
[Franklin] So your saying the above ts_test is being ran and you never touc= hed the screen? Looking at the mailing list post you sent earlier it seems = like the goal is for the ADC to be used at the same time. Is that the case = when you ran both ts_test and ts_print_raw?
Quoted 4 lines
.
.
=20Quoted 1 line
I recently encountered several touchscreen problems that I am working o=
n
Quoted 1 line
submitting to mainline. Below are the variety of issues I discovered and =
fixed
Quoted 3 lines
but its currently based on 3.14 kernel.
Quoted 2 lines
1. The x and y location right before a penup event is usually incorrect=
.
Quoted 3 lines
Visibly the causes the cursor to jump right before a touchup. So I implemented a way to ignore that incorrect event.
Quoted 1 line
2. I discovered that for some reason a series of touch up events are se=
nt
Quoted 2 lines
back to back. So I added something to ignore consecutive pen up events.
Quoted 1 line
3. Sometimes a pen down event is reported with a pressure of 0. I notic=
ed
Quoted 1 line
applications like
ts_liblooked at the pressure and thought a pressure of=
0
Quoted 3 lines
means a finger was lifted. So I added a patch that ignored 0 pressure pen down events. This prevented premature touchups.
Quoted 1 line
4. I added debouncing. Essentially the driver didn't report any touch e=
vents
Quoted 2 lines
for a user specified number of ms after a pen up occured. It was noticed especially during touchscreen calibration that after a person lifted thei=
r finger
Quoted 4 lines
after touching the screen a combination of pen up and pen down events were incorrectly detected.
Quoted 2 lines
Most likely a combination of 2-4 is your problem. I think the udelay ac=
ted
Quoted 7 lines
like an unintentional debounce which is probably why it wasn't discovered sooner.
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
--
balbi
Quoted 105 lines
-----Original Message-----
From: Cooper Jr., FranklinQuoted 94 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesQuoted 4 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Quoted 1 line
Oddly the repeated pen up and down events do not occur when running
ts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0Here is what the output of
ts_testlooks like without even touching the
screen:root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0Quoted 8 lines
1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0
Quoted 2 lines
[Franklin] So your saying the above
ts_testis being ran and you never touched the screen? Looking at the mailing list post you sent earlier it =
seems
Quoted 1 line
like the goal is for the ADC to be used at the same time. Is that the cas=
e when
Quoted 1 line
you ran both
ts_testandts_print_raw?
I was also wondering if this relates to raw ADC samples being captured. Th= e TSCADC should not be capturing anything at all if the screen is not touch= ed. You need the pen-down event to initiate the capture sequence. I'm cur= ious what the state of the pins is during this occurrence, i.e. are we actu= ally seeing some kind of event on the lines? I suspect that something is m= isconfigured somewhere, perhaps resulting in a change of state in the pins = that registers as a pen-down.
Quoted 105 lines · Brad
Quoted 105 lines
-----Original Message-----
From: Cooper Jr., FranklinQuoted 102 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesQuoted 4 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Quoted 1 line
Oddly the repeated pen up and down events do not occur when running
ts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0Here is what the output of
ts_testlooks like without even touching the
screen:root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0 1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0
Quoted 6 lines
Quoted 4 lines
[Franklin] So your saying the above
ts_testis being ran and you never touched the screen? Looking at the mailing list post you sent earlier it seems like the goal is for the ADC to be used at the same time. Is that the case when you ran bothts_testandts_print_raw?I was also wondering if this relates to raw ADC samples being captured. The TSCADC should not be capturing anything at all if the screen is not touched. You need the pen-down event to initiate the capture sequence. I'm curious what the state of the pins is during this occurrence, i.e. are we actually seeing some kind of event on the lines? I suspect that something is misconfigured somewhere, perhaps resulting in a change of state in the pins that registers as a pen-down.
Then why would reverting a commit make the problem go away?
It seems to have something to do with the characteristic of the touchscreen as this does not happen on my 7" display.
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
Quoted 5 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
=20
It seems to have something to do with the characteristic of the touchscre=
en
Quoted 7 lines
as this does not happen on my 7" display.
=20
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
=20
http://www.ti.com/lit/ds/symlink/am3354.pdf
page 20
Let me please re-ask a previously asked question just to be certain we're o= n the same page, because I think it is an extremely important question.
As background, the analog pins you mention belong to the "TSCADC" periphera= l. This peripheral, as the name suggests, has two purposes:
1. It's a touchscreen controller. For example, you might use 4 of the 8 an= alog inputs for the purpose of a touchscreen.
2. It's a general purpose A/D converter. The remaining unused analog input= s can be used for general purposes such as checking a battery voltage, read= ing a thermistor, etc.
What I would like to know is how many of those 8 pins are being used. Are = you only using 4 pins for a resistive touchscreen, or are some other pins b= eing used for general purpose ADC?
Let me also provide more background on why I'm asking... The patch set I c= reated was originally developed on a 3.12 kernel. On the 3.14 kernel there=
were some pretty major changes done with regard to how the general purpose= ADC samples are collected. So far, all the problematic areas I've bumped =
into with respect to integrating these patches in newer kernels have been i= n scenarios where there is ADC collection happening simultaneously. So I'm=
trying to understand if your issue falls into that bucket or is something =
completely different.
It would be useful to probe the touchscreen signals during your test, parti= cularly AIN0 which controls the pen-down interrupt. Fundamentally I want t=
o understand how it's possible that you're getting a pen-down interrupt whe= n nothing is touching the screen. I agree it's odd that you don't see the = issue without my patch, though if you want to get to the heart of the issue= we will need to make some observations to understand what's happening. I'=
m afraid we're moving in the wrong direction by just adding extra checks an= d filters into the kernel code. In other words, I think that's a more of a=
workaround than a solution, but it's hard to know for sure without some ad=
ditional data points.
Quoted 13 lines · Brad
Quoted 4 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael WellingQuoted 8 lines
It seems to have something to do with the characteristic of the touchscreen as this does not happen on my 7" display.
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
Quoted 9 lines
Let me please re-ask a previously asked question just to be certain we're on the same page, because I think it is an extremely important question.
As background, the analog pins you mention belong to the "TSCADC" peripheral. This peripheral, as the name suggests, has two purposes:
1. It's a touchscreen controller. For example, you might use 4 of the 8 analog inputs for the purpose of a touchscreen.
2. It's a general purpose A/D converter. The remaining unused analog inputs can be used for general purposes such as checking a battery voltage, reading a thermistor, etc.What I would like to know is how many of those 8 pins are being used. Are you only using 4 pins for a resistive touchscreen, or are some other pins being used for general purpose ADC?
Here is my device tree registration:
&tscadc {
status = "okay";
tsc {
ti,wires = <4>;
ti,x-plate-resistance = <200>;
ti,coordinate-readouts = <5>;
ti,wire-config = <0x00 0x11 0x22 0x33>;
ti,charge-delay = <0x4000>;
};
adc {
ti,adc-channels = <4 5 6 7>;
};
};The adc channel are not being sampled but they are being configured in the device tree.
I commented out the adc section and it had no effect on the behavior.
Quoted 2 lines
Let me also provide more background on why I'm asking... The patch set I created was originally developed on a 3.12 kernel. On the 3.14 kernel there were some pretty major changes done with regard to how the general purpose ADC samples are collected. So far, all the problematic areas I've bumped into with respect to integrating these patches in newer kernels have been in scenarios where there is ADC collection happening simultaneously. So I'm trying to understand if your issue falls into that bucket or is something completely different.
I am not sampling the ADCs.
Quoted 1 line
It would be useful to probe the touchscreen signals during your test, particularly AIN0 which controls the pen-down interrupt. Fundamentally I want to understand how it's possible that you're getting a pen-down interrupt when nothing is touching the screen. I agree it's odd that you don't see the issue without my patch, though if you want to get to the heart of the issue we will need to make some observations to understand what's happening. I'm afraid we're moving in the wrong direction by just adding extra checks and filters into the kernel code. In other words, I think that's a more of a workaround than a solution, but it's hard to know for sure without some additional data points.
I am travelling and do not have my oscilloscope with me. It will be next week before I can make any measurements.
Quoted 28 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:51 PM
To: Griffis, Brad
Cc: Cooper Jr., Franklin; Balbi, Felipe; [email protected]; R, Vignesh; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issues
=20Quoted 15 lines · Brad
Quoted 15 lines
-----Original Message-----
From: Cooper Jr., FranklinQuoted 12 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesOn Tue, May 26, 2015 at 09:15:53PM +0000, Cooper Jr., Franklin wrot=
e:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events=
.
Quoted 88 lines
Quoted 88 lines
Quoted 87 lines
Quoted 75 lines
Quoted 1 line
Oddly the repeated pen up and down events do not occur when running
ts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0Here is what the output of
ts_testlooks like without even touching the
screen:root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0Quoted 8 lines
1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0[Franklin] So your saying the above
ts_testis being ran and you never touched the screen? Looking at the mailing list post you sent earlier it seems like the goal is for the ADC to be used at the same time. Is that the case when you ran bothts_testandts_print_raw?
Quoted 4 lines
Quoted 1 line
I was also wondering if this relates to raw ADC samples being captured.
The TSCADC should not be capturing anything at all if the screen is not touched. You need the pen-down event to initiate the capture sequence. I'm curious what the state of the pins is during this occurrence, i.e. ar=
e we
Quoted 1 line
actually seeing some kind of event on the lines? I suspect that somethin=
g is
Quoted 1 line
misconfigured somewhere, perhaps resulting in a change of state in the pi=
ns
Quoted 5 lines
that registers as a pen-down.
=20
Then why would reverting a commit make the problem go away? =20
It seems to have something to do with the characteristic of the touchscre=
en
Quoted 7 lines
as this does not happen on my 7" display.
=20
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
=20
http://www.ti.com/lit/ds/symlink/am3354.pdf
page 20
[Franklin] The general purpose ADC and touchscreen are handled by the same = piece of IP (http://processors.wiki.ti.com/index.php/Sitara_ADC/Touchscreen=_Overview) . So the ADC and touchscreen ISR will both trigger when a hardwa= re interrupt is fired. The appropriate driver ISR should return immediately=
if it determines that the interrupt isn't meant for it. For the touchscree=
n that means either FIFO0 (only used by the touchscreen) is met or a pen up=
event has occurred.=20
So like Brad mention nothing on the touchscreen side should randomly trigge= r and interrupted other than pen up and a FIFO0 threshold being met. To me = it sounds like maybe some noise is hitting the touchscreen pins. However, i= t doesn't make sense that you don't see this issue with ts_print_raw. Ts_pr= int_raw should output the raw values that the touchscreen driver is sending=
to userspace ignoring any kind of calibration. Instead of running ts_test =
what do you see when you run ts_print? Do you see those ghost touch events = still? If so the difference between ts_print and ts_print_raw is that ts_pr= int incorporated calibration and I believe filtering values via ts_lib to t= he touchscreen events it receives.
The constant X value and pretty consistent pressure of 58/59 alternating wi= th 0 makes things even more suspicious especially if your saying that you'r= e not running the standalone adc.=20
Quoted 140 lines · Franklin
Quoted 140 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:51 PM
To: Griffis, Brad
Cc: Cooper Jr., Franklin; Balbi, Felipe; [email protected]; R, Vignesh; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesQuoted 106 lines · Brad
Quoted 106 lines
-----Original Message-----
From: Cooper Jr., FranklinQuoted 103 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesQuoted 4 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Quoted 1 line
Oddly the repeated pen up and down events do not occur when running
ts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0Here is what the output of
ts_testlooks like without even touching the
screen:root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0 1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0Quoted 6 lines
Quoted 4 lines
[Franklin] So your saying the above
ts_testis being ran and you never touched the screen? Looking at the mailing list post you sent earlier it seems like the goal is for the ADC to be used at the same time. Is that the case when you ran bothts_testandts_print_raw?I was also wondering if this relates to raw ADC samples being captured.
The TSCADC should not be capturing anything at all if the screen is not touched. You need the pen-down event to initiate the capture sequence. I'm curious what the state of the pins is during this occurrence, i.e. are we actually seeing some kind of event on the lines? I suspect that something is misconfigured somewhere, perhaps resulting in a change of state in the pins that registers as a pen-down.
Then why would reverting a commit make the problem go away?
It seems to have something to do with the characteristic of the touchscreen as this does not happen on my 7" display.
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
Quoted 7 lines
Quoted 2 lines
[Franklin] The general purpose ADC and touchscreen are handled by the same piece of IP (http://processors.wiki.ti.com/index.php/Sitara_ADC/Touchscreen_Overview) . So the ADC and touchscreen ISR will both trigger when a hardware interrupt is fired. The appropriate driver ISR should return immediately if it determines that the interrupt isn't meant for it. For the touchscreen that means either FIFO0 (only used by the touchscreen) is met or a pen up event has occurred.
So like Brad mention nothing on the touchscreen side should randomly trigger and interrupted other than pen up and a FIFO0 threshold being met. To me it sounds like maybe some noise is hitting the touchscreen pins. However, it doesn't make sense that you don't see this issue with
ts_print_raw.Ts_print_rawshould output the raw values that the touchscreen driver is sending to userspace ignoring any kind of calibration. Instead of runningts_testwhat do you see when you runts_print? Do you see those ghost touch events still? If so the difference betweents_printandts_print_rawis thatts_printincorporated calibration and I believe filtering values viats_libto the touchscreen events it receives.
The problem only occurs when using the graphical apps: ts_calibrate and ts_test
ts_print does not present the ghost touch events.
Perhaps there is coupling between the LCD lines and the ADC lines?
Quoted 1 line
The constant X value and pretty consistent pressure of 58/59 alternating with 0 makes things even more suspicious especially if your saying that you're not running the standalone adc.
Quoted 10 lines · Michael Welling
=20
Quoted 5 lines · Franklin
=20
=20Quoted 2 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michae=
l
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Welling
Sent: Tuesday, May 26, 2015 4:51 PM
To: Griffis, Brad
Cc: Cooper Jr., Franklin; Balbi, Felipe; [email protected]; R, Vignesh; [email protected]; [email protected]; linux- [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issues
=20Quoted 15 lines · Brad
=20
Quoted 13 lines
-----Original Message-----
From: Cooper Jr., FranklinQuoted 11 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issues
=20
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
On Tue, May 26, 2015 at 09:15:53PM +0000, Cooper Jr., Franklin wrot=
e:
Quoted 90 lines
Quoted 90 lines
Quoted 90 lines
Quoted 90 lines
Quoted 90 lines
Quoted 90 lines
Quoted 4 lines
Michael,
=20
Can you send me the output ofts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events. =20
Oddly the repeated pen up and down events do not occur when runningts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0 =20 Here is what the output of ts_test looks like without even touching the screen: root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0 1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
[Franklin] So your saying the above
ts_testis being ran and you never touched the screen? Looking at the mailing list post you sent earlier it seems like the goal is for the ADC to be used at the same time. Is that the case when you ran bothts_testandts_print_raw?=20
I was also wondering if this relates to raw ADC samples being captured=
.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
The TSCADC should not be capturing anything at all if the screen is not touched. You need the pen-down event to initiate the capture sequence. I'm curious what the state of the pins is during this occurrence, i.e. =
are we
Quoted 1 line
Quoted 1 line
Quoted 1 line
actually seeing some kind of event on the lines? I suspect that someth=
ing is
Quoted 1 line
Quoted 1 line
Quoted 1 line
misconfigured somewhere, perhaps resulting in a change of state in the =
pins
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
that registers as a pen-down.
=20
Then why would reverting a commit make the problem go away? =20
It seems to have something to do with the characteristic of the touchsc=
reen
Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
as this does not happen on my 7" display.
=20
Looking at the datasheet these pin are dedicated analogs and cannot be MUX'd otherwise.
=20
http://www.ti.com/lit/ds/symlink/am3354.pdf
page 20=20
[Franklin] The general purpose ADC and touchscreen are handled by the sa=
me piece of IP (http://processors.wiki.ti.com/index.php/Sitara_ADC/Touchscr=een_Overview) . So the ADC and touchscreen ISR will both trigger when a har= dware interrupt is fired. The appropriate driver ISR should return immediat= ely if it determines that the interrupt isn't meant for it. For the touchsc= reen that means either FIFO0 (only used by the touchscreen) is met or a pen=
up event has occurred.=20
Quoted 2 lines
Quoted 2 lines
=20
So like Brad mention nothing on the touchscreen side should randomly tri=
gger and interrupted other than pen up and a FIFO0 threshold being met. To = me it sounds like maybe some noise is hitting the touchscreen pins. However= , it doesn't make sense that you don't see this issue with ts_print_raw. Ts= _print_raw should output the raw values that the touchscreen driver is send= ing to userspace ignoring any kind of calibration. Instead of running ts_te= st what do you see when you run ts_print? Do you see those ghost touch even= ts still? If so the difference between ts_print and ts_print_raw is that ts= _print incorporated calibration and I believe filtering values via ts_lib t=
o the touchscreen events it receives.
Quoted 2 lines
=20
The problem only occurs when using the graphical apps:ts_calibrateand t=
s_test
Quoted 4 lines
=20
ts_printdoes not present the ghost touch events.
=20
Perhaps there is coupling between the LCD lines and the ADC lines?
Sounds like something else is going on since from the driver perspective th= ere should be no difference between ts_print and ts_test.
So technically if your getting these ghost events they should be occurring = all the time not only when tslib apps are running
What I would do is add trace_printks and print something anytime the driver=
is getting a pen up or pen down event.
For the pen down event make sure you also print the x,y and pressure.
Also are you running the same steps for each of your test?
I would recommend doing the following for each test.
Power down the board.
Power it on
after the board is booted for 30 sec or so log=20
the output of trace_printk
Delete whatever the saved ts calibration file is called
Run program xxx
Touch the 5 points on the screen mimicking calibration
Clear trace_printk buffer
Let the board sit for another 30 sec and log the output of trace_printk.
I would do this for both ts_print,ts_calibrate. Compare the output.
If your test procedure is the same then the tslib app being ran shouldn't m= atter.
Quoted 2 lines
=20
Quoted 1 line
The constant X value and pretty consistent pressure of 58/59 alternating=
with 0 makes things even more suspicious especially if your saying that yo=
u're not running the standalone adc.=20
Hi Michael,
Quoted 2 lines · Michael Welling
Quoted 1 line · Franklin
[snip]
Quoted 2 lines
Perhaps there is coupling between the LCD lines and the ADC lines?
On Beaglebone Black with BB-View 4.3" Cape from Farnell, the LCD lines and TSCADC lines are placed close to one another, hence the analog signals are affected by digital LCD signals, leading to above issue.
This was reported when I submitted the patches in question. Please see
http://thread.gmane.org/gmane.linux.kernel.iio/14710/focus=121321
http://thread.gmane.org/gmane.linux.kernel.iio/14710/focus=15242
I did document this in my cover letter. Please see
http://thread.gmane.org/gmane.linux.kernel.iio/15583
I think its the same issue that you are facing.
Regards
Vignesh
Quoted 15 lines · Vignesh R
Hi Michael,
Quoted 2 lines · Michael Welling
Quoted 1 line · Franklin
[snip]
Quoted 2 lines
Perhaps there is coupling between the LCD lines and the ADC lines?
On Beaglebone Black with BB-View 4.3" Cape from Farnell, the LCD lines and TSCADC lines are placed close to one another, hence the analog signals are affected by digital LCD signals, leading to above issue.
Quoted 8 lines
This was reported when I submitted the patches in question. Please see
http://thread.gmane.org/gmane.linux.kernel.iio/14710/focus=121321
http://thread.gmane.org/gmane.linux.kernel.iio/14710/focus=15242I did document this in my cover letter. Please see
http://thread.gmane.org/gmane.linux.kernel.iio/15583I think its the same issue that you are facing.
Sounds like it.
The threads above mention adding decoupling capacitors to the ADC lines.
Is this the suggested workaround for the workaround?
Isn't the capacitor only needed on the ADC0 line to avoid the unwanted trigger?
Please advise.
I wish I saw this before spending a whole bunch of time debugging. Perhaps some annotation in the driver would help people in the future.
Quoted 3 lines
Regards
Vignesh
Quoted 101 lines · Franklin
Quoted 93 lines
-----Original Message-----
From: Michael Welling [mailto:[email protected]] On Behalf Of Michael Welling
Sent: Tuesday, May 26, 2015 4:29 PM
To: Cooper Jr., Franklin
Cc: Balbi, Felipe; [email protected]; R, Vignesh; Griffis, Brad; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: AM335x touchscreen issuesQuoted 3 lines · Franklin
Michael,
Can you send me the output of
ts_test_rawafter you done a 5 or so touchdown and touch up events? In the output let me know at which point in the log that the issue you observed has occurred. Please try to avoid moving your finger since I want to see the full output of that program but I'm not interested any unnecessary pen down events.
Quoted 1 line
Oddly the repeated pen up and down events do not occur when running
ts_print_raw:root@som3517-som200:~# ts_print_raw 1418169393.147827: 1648 2075 206 1418169393.229976: 1725 1983 240 1418169393.312154: 1731 1980 240 1418169393.394333: 1706 2043 239 1418169393.476523: 1703 2028 241 1418169393.558708: 1714 2041 240 1418169393.640888: 1704 2041 240 1418169393.721556: 0 0 0 1418169395.283096: 2889 2512 192 1418169395.365236: 2947 2486 210 1418169395.447413: 2949 2470 211 1418169395.529606: 2943 2497 211 1418169395.611759: 2922 2506 211 1418169395.693935: 2866 2474 213 1418169395.776135: 2858 2481 214 1418169395.858305: 2861 2451 213 1418169395.938972: 0 0 0 1418169397.482867: 1083 1981 236 1418169397.565026: 1157 1832 254 1418169397.647217: 1161 1856 256 1418169397.729412: 1158 1883 255 1418169397.811583: 1159 1841 255 1418169397.893760: 1159 1864 256 1418169397.975947: 1158 1893 256 1418169398.056605: 0 0 0 1418169399.690290: 2299 2372 178 1418169399.772432: 2388 2160 221 1418169399.854611: 2391 2190 223 1418169399.936802: 2379 2207 223 1418169400.018966: 2389 2184 223 1418169400.101146: 2383 2208 224 1418169400.183338: 2381 2203 223 1418169400.264012: 0 0 0 1418169402.073266: 1230 2381 212 1418169402.155413: 1301 2097 247 1418169402.237590: 1313 2077 248 1418169402.319772: 1307 2126 248 1418169402.401948: 1304 2096 248 1418169402.484127: 4078 2155 58 1418169402.564801: 0 0 0Here is what the output of
ts_testlooks like without even touching the screen:root@som3517-som200:~# ts_test 1418169549.722957: 816 17 58 1418169549.803604: 816 17 0 1418169549.817757: 816 25 58 1418169549.898411: 816 25 0 1418169549.912828: 816 41 59 1418169549.993463: 816 41 0 1418169550.007771: 816 28 58 1418169550.088404: 816 28 0 1418169550.102828: 816 33 58 1418169550.183486: 816 33 0 1418169550.197767: 816 42 59 1418169550.278401: 816 42 0 1418169550.292970: 816 23 58 1418169550.373604: 816 23 0 1418169550.387773: 816 28 58 1418169550.468404: 816 28 0 1418169550.482955: 816 32 59 1418169550.563600: 816 32 0 1418169550.577773: 816 25 58 1418169550.658406: 816 25 0 1418169550.672827: 816 35 59 1418169550.753464: 816 35 0 1418169550.767761: 816 42 59 1418169550.848407: 816 42 0Quoted 8 lines
1418169550.862826: 816 41 59 1418169550.943462: 816 41 0 1418169550.958013: 816 37 59 1418169551.038655: 816 37 0 1418169551.052824: 816 41 59 1418169551.133475: 816 41 0 1418169551.147774: 816 28 58 1418169551.228406: 816 28 0
Quoted 1 line
[Franklin] So your saying the above
ts_testis being ran and you never touched the screen?
Yes.
Quoted 2 lines
Looking at the mailing list post you sent earlier it seems like the goal is for the ADC to be used at the same time. Is that the case when you ran both
ts_testandts_print_raw?
No. I am not sampling the ADC.
This happening without any interaction with the screen.
Quoted 32 lines
Quoted 32 lines
.
.Quoted 1 line
I recently encountered several touchscreen problems that I am working on
submitting to mainline. Below are the variety of issues I discovered and fixed but its currently based on 3.14 kernel.
Quoted 2 lines
1. The x and y location right before a penup event is usually incorrect.
Visibly the causes the cursor to jump right before a touchup. So I implemented a way to ignore that incorrect event.
Quoted 1 line
2. I discovered that for some reason a series of touch up events are sent
back to back. So I added something to ignore consecutive pen up events.
Quoted 1 line
3. Sometimes a pen down event is reported with a pressure of 0. I noticed
applications like
ts_liblooked at the pressure and thought a pressure of 0 means a finger was lifted. So I added a patch that ignored 0 pressure pen down events. This prevented premature touchups.Quoted 1 line
4. I added debouncing. Essentially the driver didn't report any touch events
for a user specified number of ms after a pen up occured. It was noticed especially during touchscreen calibration that after a person lifted their finger after touching the screen a combination of pen up and pen down events were incorrectly detected.
Quoted 2 lines
Most likely a combination of 2-4 is your problem. I think the udelay acted
like an unintentional debounce which is probably why it wasn't discovered sooner.
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
--
balbi