This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am437x resistive touch screen driver

Dear All,

Now I develop on am437x with ti-linux 3.12.10. And need the four-wire resistive touch in our design.

I added the touch screen configure in device tree by the following code:

&tscadc {
    status = "okay";

    tsc {
        ti,wires = <4>;
        ti,x-plate-resistance = <200>;
        ti,coordiante-readouts = <5>;
        ti,wire-config = <0x00 0x11 0x22 0x33>;
	ti,charge-delay = <400>;
    };
};

The driver(ti_am335x_tsc.c) and device registered fine, then I ran "ts_calibrate" to calibrate and  ran "ts_test" command for testing.

root@am437x-evm ~# ts_test
..............
946687272.940749:     11     41    324
946687272.942632:     11     41    320
946687272.944515:     11     41    314
946687272.946398:     12     41    306
946687272.948281:     12     42    295
946687272.950453:     18    459      0 # INCORRECT coordinate
..............
946687451.347583:     34     52    311
946687451.349466:     34     52    308
946687451.351349:     33     52    305
946687451.353232:     32     52    301
946687451.355116:     31     52    297
946687451.356999:     31     52    294
946687451.358883:     30     52    282
946687451.360767:     31     53    271
946687451.362938:    309    282      0 # INCORRECT coordinate
..............
946687574.954707:     13     29    279
946687574.956591:     13     28    274
946687574.958475:     13     28    272
946687574.960359:     13     28    265
946687574.962517:     13     28      0 # CORRECT coordinate
...............
946687575.848747:     11     31    296
946687575.850630:     11     31    289
946687575.852513:     11     31    276
946687575.854671:     11     31      0 # CORRECT coordinate
...............

946687576.396289:      7     30    300
946687576.398173:      8     30    291
946687576.400057:      8     31    288
946687576.403823:     14     48    251
946687576.403823:     14     48    251
946687576.405994:     49    452      0 # INCORRECT coordinate

As the above info, some times I couldn't get the correct coordinate when I released the touch but some times I got.

I had checked the driver(ti_am335x_tsc.c) but can not find any problem, and this touchscreen works OK on our am335x board (with Linux 3.2.0).

Can anyone provide some helps? All advices would be appreciated.

Warm Regards,

Kinly

  • Hi Kinly,

    Do you see the same issues with the latest AM437X Linux SDK: http://software-dl.ti.com/sitara_linux/esd/AM437xSDK/latest/index_FDS.html ?

  • Hello Biser,


    Thanks for your reply!

    Now I use the driver from Linux 3.14.26 (from SDK 08.0), but there are new issues: some times even I released touch, the touch interrupts still be occurred!

    As following show:

    root@am437x-evm ~# ts_test
    ...................
    946686157.499373:     31     44    132
    946686157.501077:     31     43    132
    946686157.502779:     31     43    133
    946686157.504481:     31     44    133
    946686157.506184:     32     44    133
    946686157.507887:     32     44    136
    946686157.509589:     34     44    140 # CORRECT coordinate
    946686157.512995:    836     92    256 # INCORRECT coordinate
    946686157.514697:    837    443    256
    946686157.516400:    668    447    256
    946686157.518103:    605    455    256
    946686157.519806:    550    465    256
    946686157.521508:    681    475    256
    946686157.523211:    816    455    256
    946686157.524915:    837    457    256
    946686157.526616:    837    454    256
    946686157.526616:    837    453    256
    946686157.530021:    837    452    256
    946686157.531724:    837    451    256
    946686157.533427:    837    449      0 # INCORRECT coordinate, release touch here
    946686157.536832:    776    447    256 # The touch was released, but still occur touch interrupts
    946686157.538535:    633    449    256
    946686157.540238:    577    458    256
    946686157.541940:    713    468    256
    946686157.543643:    837    452    256
    946686157.543643:    837    452    256
    946686157.545345:    837    452    256
    946686157.547053:    837    452      0
    946686157.550453:    837    452    256
    946686157.552155:    837    450    256
    946686157.555562:    809    447    256
    946686157.557264:    769    447    256
    946686157.558967:    754    456    256
    946686157.560669:    635    458    256
    946686157.562372:    803    459    256
    946686157.564075:    837    453    256
    946686157.564075:    837    453    256
    946686157.565777:    837    453    256
    946686157.567480:    837    453    256
    946686157.569183:    837    453    256
    ................
    946686157.570888:    837    453    256
    946686157.572588:    837    452    256
    946686157.575993:    800    444    256 # Stop 
    

    Would you have any ideas?

    Thanks and Best Regards,

    Kinly

  • Hi Kinly,

    I'm curious if this is a variation of a bug I fixed earlier in the 3.14 release. . However, the abnormal value i always saw was the touch down/move event right before the touchup event.

    Really when a touch up event happens there is no such thing as an x and y value. What I recommend is that you do the same test but instead use ts_print_raw.  This will give you the exact values the touchscreen driver is sending to userspace. You will notice when you lift your finger you will see 0,0,0.  Once you provide those results we can hopefully figure out what is really going on since the issue your seeing isn't something I would expect.

  • Hi Franklin,

    Thanks for your reply very much!

    I had tried to use the touch screen driver from Linux 3.14.26, which is same as the driver that you committed in

    This driver can solve the touchup issue, but it brings the new issue: in most cases, the touch event still occur even I remove my touch, but some times it works fine.

    root@am437x-evm ~# ts_test
    946684820.576123:    214    175    119
    946684820.577818:    214    173    117
    946684820.579523:    214    174    116
    946684820.581225:    214    173    117
    946684820.582926:    215    173    116
    946684820.584629:    214    174    116
    946684820.586331:    215    174    117
    946684820.588034:    215    174    117
    946684820.591439:    216    174    118
    946684820.593142:    216    172    120 # I release my touch here, but the touch event still occurred 
    946684820.596547:    837    258    256 # until I remove ti_am335x_tsc.ko by "rmmod ti_am335x_tsc.ko" command
    946684820.598250:    837    216    256
    946684820.599953:    837    279    256
    946684820.601655:    823    248    256
    946684820.603358:    837    220    256
    946684820.603358:    837    220    256
    946684820.606763:    837    283    256
    946684820.608465:    837    249    256
    946684820.610169:    837    221    256
    946684820.610169:    837    221    256
    946684820.611871:    837    221    256
    946684820.615276:    837    220    256
    946684820.618681:    837    219    256
    946684820.623790:    837    221    256
    946684820.625492:    837    220    256
    946684820.625492:    837    219    256
    946684820.627195:    837    220    255
    946684820.628898:    837    219    255
    946684820.632303:    837    219    255
    946684820.635708:    837    218    255
    946684820.637411:    837    219    256
    946684820.640816:    837    219    256
    946684820.642519:    837    219    256
    946684820.647628:    837    252    256
    946684820.647628:    837    252    256
    946684820.651032:    837    251    256
    946684820.656140:    797    219      5
    946684820.657843:    837    222    256
    946684820.657843:    837    222    256
    946684820.662951:    837    249    256
    


    The output of ts_print_raw:

    root@RicoBoard ~# ts_print_raw 
    946684821.526279:   1652   1537     95
    946684821.527976:   1633   1601    104
    946684821.529676:   1633   1762     92
    946684821.531379:   1625   1763     91
    946684821.533081:   1642   1777     92
    946684821.534784:   1631   1765     91
    946684821.536486:   1639   1776     92
    946684821.538189:   1635   1767     92
    946684821.539891:   1641   1785     92
    946684821.541594:   1630   1772     92
    946684821.543297:   1635   1775     93
    946684821.544999:   1624   1760     91
    946684821.546703:   1635   1771     93
    946684821.548406:   1640   1760     92
    946684821.550108:   1627   1780     93
    946684821.551811:   1630   1776     92
    946684821.553513:   1627   1765     94
    946684821.555216:   1631   1766     93
    946684821.556918:   1637   1781     93
    946684821.558621:   1629   1762     93
    946684821.560324:   1636   1768     96
    946684821.562026:   1633   1760     97
    946684821.563730:   1643   1756    101
    946684821.565432:   1799   1762     94 # Lift my finger here. touch event still be occured
    946684821.567139:   4095   2451    256
    946684821.568837:   4095   1959    256
    946684821.570540:   4095   1979    256
    946684821.572242:   4095   1976    256
    946684821.573945:   4095   1982    256
    946684821.575648:   4095   2220    256
    946684821.577350:   4095   1964    256
    946684821.579054:   4095   1970    256
    946684821.580756:   4095   1961    256
    946684821.582459:   4095   1969    256
    946684821.584160:   4095   1990    256
    946684821.585864:   4095   1959    256
    946684821.587567:   4095   2204    256
    946684821.589269:   4095   1972    256
    946684821.590972:   4095   1951    256
    946684821.592675:   4095   1977    256
    946684821.594386:   4095   1956    256
    946684821.596079:   4095   2222    256
    946684821.597783:   4095   2227    256
    946684821.599485:   4095   1976    256
    946684821.601188:   4095   1989    256
    946684821.602891:   4095   2209    256
    946684821.604593:   4094   1985    256
    ...............

    Would your have any ideas?

    Best Regards,

    Jakebo

  • Maybe this issue was caused by hardware, it is not reappear on our new LCD module.