Integrating gt911 touchscreen

Started by sqt, September 17, 2014, 01:46:55 PM

Previous topic - Next topic

sqt

I am trying to integrate a goodix gt911 touch screen to android with kernel 3.4 in a20
I have connected the touch screen to UEXT1(twi2) and set up the fex file accordingly. I found a sw_touchscreen folder in the kernel directory which contained gt9xx driver. The driver build and loaded without any error. But the touch screen does not work on connecting.
The touch screen seems to be working as it produces interrupt signals on touch.

Is there any one who have successfully integrated a gt911 touchscreen? Does anyone have a working driver for it? Please help!

Thank you in advance

dave-at-axon

Some of the things I had to do to get touch working might point you in the right direction.

https://axonjakarta.wordpress.com/2014/03/24/7-capacitive-touch-for-a20/

Have you added the INSMOD to the init.sun7i.rc file so that your driver is loaded on startup.

As I found out, make sure the standard driver is not loading. :)

adinu

Hi sqt,

I have a working gt9xx touch panel with a20. I can give you the .ko module. I'll send you a private message :)
Adrian

sqt

As dave-at-axon said there was some problems caused by the ft5x_ts which was automatically loaded on startup. I removed the line that loaded ft5x_ts.ko and now only gt9xx_ts.ko is loaded.

The problem was that when ft5x was loaded first, it utilized the GPIO external interrupt pin. When the gt9xx.ko module loaded after that it showed that GPIO request failed error.

Now on running getevent command, theevents are displayed fine. But nothing happes on the screen. I dont know whats wrong.

Please help.

dave-at-axon

What have you done to setup the IDC file?

This is located in the source in the device/softwinner/olinuxino-a20 directory on my system.

https://github.com/thesawolf/android_device_allwinner_ssa2/blob/master/config/Goodix-TS-board-3.idc

The system uses this to configure the touch panel.

The default with the Android source is called qwerty.idc but I can't find any reference to the name of the file for the gt911.

Lastly. What is the output from dmesg? You can do this over the debug UART or ADB if you have a USB cable connected

dmesg | grep goodix



sqt

I did not set up any .idc file for gt9xx. There is are ft5x_ts.idc and tp.idc files in the device/softwinner/olinuxino-a20 directory.

The following is the dmesg output. I enabled the DEBUG in the source so there is a lot of debugging information.
          .....................................
          .....................................
          .....................................
          .....................................

4>[ 3677.118256] [CTP]:==========------TS Interrupt-----============
<4>[ 3677.130909] [CTP]:==========------TS Interrupt-----============
<7>[ 3677.153709] cpu up:1
<4>[ 3677.157601] IC Version: 911_1050<<-GTP-INFO->> Applied memory size:2562.
<4>[ 3677.167509] <<-GTP-DEBUG->> [154]I2C function: with pre and end cmd!
<4>[ 3677.174637] [CTP]:==========------TS Interrupt-----============
<4>[ 3677.211059] [CTP]:==========------TS Interrupt-----============
<4>[ 3677.227949] CPU1: Booted secondary processor
<4>[ 3677.233357] <<-GTP-INFO->> Create proc entry success!
<4>[ 3677.238484] [CTP]:===enter goodix_ts_work_func===
<4>[ 3677.244731] [CTP]:gt9xx probe success!
<4>[ 3677.249038] [CTP]:pre_touch:00, finger:80.[CTP]:****************************************************************
<4>[ 3677.252773] [CTP]:==========------TS Interrupt-----============
<4>[ 3677.281116] [CTP]:===enter goodix_ts_work_func===
<4>[ 3677.294578] [CTP]:==========------TS Interrupt-----============
<4>[ 3677.294672] [CTP]:===enter goodix_ts_work_func===
<4>[ 3677.307768] [CTP]:pre_touch:00, finger:80.[CTP]:==========------TS Interrupt-----============
<4>[ 3677.336455] [CTP]:===enter goodix_ts_work_func===
<4>[ 3677.337052] [CTP]:pre_touch:00, finger:80.[CTP]:==========------TS Interrupt-----============
<4>[ 3681.563409] [CTP]:==========------TS Interrupt-----============
<4>[ 3681.576062] [CTP]:==========------TS Interrupt-----============
<4>[ 3681.588716] [CTP]:==========------TS Interrupt-----============
          .....................................
          .....................................
          .....................................
          .....................................
          .....................................
<4>[ 3684.854073] [CTP]:==========------TS Interrupt-----============
<4>[ 3684.866728] [CTP]:==========------TS Interrupt-----============
<4>[ 3684.879540] [CTP]:===enter goodix_ts_work_func===
<4>[ 3684.885293] [CTP]:pre_touch:00, finger:81.sw_powernow_set_usb SW_POWERNOW_USBSTAT_INACTIVE
<7>[ 3684.889404] start_powernow :1!
<4>[ 3684.898347] [CTP]:source data:ID:0, X:375, Y:199, W:28
<4>[ 3684.902629] [CTP]:==========------TS Interrupt-----============
<4>[ 3684.916892] [CTP]:report data:ID:0, X:425, Y:281, W:28
<4>[ 3684.923071] [CTP]:===enter goodix_ts_work_func===
<4>[ 3684.944442] [CTP]:==========------TS Interrupt-----============
<4>[ 3684.951090] ==========------TS Interrupt-----============
<4>[ 3684.963058] [CTP]:pre_touch:01, finger:80.[CTP]:Touch Release![CTP]:==========------TS Interrupt-----============
<4>[ 3684.997654] [CTP]:===enter goodix_ts_work_func===
<4>[ 3685.003503] [CTP]:pre_touch:00, finger:80.[CTP]:==========------TS Interrupt-----============
<4>[ 3685.039423] [CTP]:===enter goodix_ts_work_func===
<4>[ 3685.045263] [CTP]:pre_touch:00, finger:80.sw_powernow_set_usb SW_POWERNOW_USBSTAT_ACTIVE
<7>[ 3686.434148] start_powernow :4!
<5>[ 3689.693236] CPU1: shutdown
          .....................................
          .....................................
          .....................................
          .....................................


I rmmod and then insmod the gt9xx_ts module. Hope this is what you asked.

dave-at-axon

Good. That seems to be reporting the position data to the underlying Android OS but I guess you are not seeing any reaction from Android itself?

Did you have a resistive touch connected to your A20 before? Possibly the Olimex one?

If you did, locate this file in the data direcctory and it is called pointercal and delete this file. I found that Android was reporting the wrong position because of this.

sqt

It finally worked  ;D

I did not found any pointercal function in the data folder.
Even after touching for a while, dmesg only reported the last touch point. The debug was flooded with a lot of interrupt. Everything hanged until the debug stopped. So, I disabled the debug produced by GTP in the gt9xx.c file. Now the touch screen works fine.

Thank you for all your help.

dave-at-axon

Good stuff. Interrupts on debug is good for quick testing but it sure can mess things up.

Glad you found the problem.

Not to go back to finding my battery charge issue :)

adinu

Hi sqt,
It's good to hear you got it to work finally :)

As I said, I also have a Goodix touch and it's working fine, except it randomly freezes from time to time and I have to lock and unlock the screen for it to work againg. Please tell me if you have a similar issue.
Any ideas on what could cause this?

Thanks.
Adrian

dave-at-axon

Hi Adrian,

I had a similar issue with a Fusion touch panel.

How are you powering the touch panel?

I was powering from the LCD power line which was being switched off when the screen went to sleep. I changed the design to power it from the incoming 3.3V so that it was always on unless the system went to deep sleep.

A standby to on would init the touch controller so now it works every time.

adinu

Hi Dave,

I'm powering it from UEXT1, pin number 1 (3.3V). It's weird because there is no clear pattern, it freezes randomly, not only when the screen goes to sleep. One thing I did notice is that it never freezes when the board is powered exclusively by battery. It only does so if I connect the 12V adapter. So from this behavior it does seem to be related to the way the panel is powered somehow.
Adrian