Add goodix support in 3.14.56 kernel

Discussion in 'Yocto' started by modjo, Dec 13, 2016.

  1. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Hi, i'm actually working on secosbcA62 image to support the new sysA62-10/quad.
    (i have one at work :)) For the moment i have create a patch to modify the specifications of 15 inch screen to adapt at the 10 inch screen here (not a nice solution but it work!). Now i'm trying to support the goodix touchscreen driver, for that i have found on secogit that i need, i adapt it to our layer. It build fine but i have some trouble at boot, see the dmesg under :
    Code:
    [    1.203515] mousedev: PS/2 mouse device common for all mice
    [    1.305814] Goodix-TS 2-005d: ID 928, version: 1040
    [    1.310787] Goodix-TS 2-005d: Direct firmware load failed with error -2
    [    1.317453] Goodix-TS 2-005d: Falling back to user helper
    
    the card boot but i have nothing on /dev/input/ appart mice.
    After approximatively 10 seconds i have this :
    Code:
    [   61.419568] input: Goodix Capacitive TouchScreen as /devices/soc0/soc.0/2100000.aips-bus/21a8000.i2c/i2c-2/2-005d/input/input0
    After that the touchscreen appear on /dev/input like this :
    Code:
    root@secosbca62:/sys/module# ls /dev/input
    by-path  event0  mice  mouse0  touchscreen0
    At this moment the touchscreen work fine (tested on Qt app) but that is strange is that i have input in event0 and touchscreen0 !!!

    I think this a problem with goodix.ko, i don't find it on the card :
    Code:
    root@secosbca62:/lib/modules/3.14.56_1.0.x-udoo+g77702fa/kernel/drivers/input/touchscreen# ls
    st1232.ko  usbtouchscreen.ko
    
    like you see i can find st1232.ko but not goodix.ko !

    To be sure i tried to find it on yocto build A62Build/tmp/work/secosbca62-poky-linux-gnueabi/linux-udooboard/3.14.56-r0/ but i didn't find the goodix.ko :mad:
    If i launch grep -rn "goodix" :
    Code:
    secosbca62-poky-linux-gnueabi/linux-udooboard/3.14.56-r0/image/lib/modules/3.14.56_1.0.x-udoo+g77702fa/modules.builtin:102:kernel/drivers/input/touchscreen/goodix.ko
    
    but if i go on this folder i didn't find the module !

    I'm a beginner on kernel build if someone can help please :rolleyes:
    p.s : i don't know if it's the good thread, perhaps it's better to post it on kernel thread ...
     
  2. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    There is no goodix.ko because it compiled into the kernel

    CONFIG_TOUCHSCREEN_GOODIX=y

    If you want it as module you'll need to use

    CONFIG_TOUCHSCREEN_GOODIX=m

    In your defconfig.
    I would add a new machine instead poking around with the A62 :)

    Related to the delay a complete dmesg output may could help. But I guess you run in some timeouts...
     
  3. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    yes sure, if i build it in module i can see it on the card ... thanks for the tip. Otherwise do this in this way not resolve the problem ... how i can have a "complete dmseg" ?
     
  4. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
  5. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
    You need some "blob firmware file". All firmware files you should have in /lib/firmware/.
    You could check file devices/input/touchscreen/goodix.c in a kernel source code. There are functions which checks a firmware checksums.

    Here you have some firmware : https://github.com/goodix/gt1x_driver_generic/tree/master/firmware. Maybe It will work.
     
    graugans and modjo like this.
  6. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Thanks for this. I'm trying to adapt this but i have a problem when i build the kernel. If the file gt9xx.h i need to define this pin :
    Code:
    // STEP_2(REQUIRED): Customize your I/O ports & I/O operations
    #define GTP_RST_PORT    MX6QDL_PAD_SD2_DAT2__GPIO1_IO13
    #define GTP_INT_PORT    MX6QDL_PAD_SD2_DAT0__GPIO1_IO15
    I added this #include "imx6dl-pinfunc.h" for the define, but i have this error in compile :

    | drivers/input/touchscreen/imx6dl-pinfunc.h:1001:59: error: expected ';' before numeric constant
    | #define MX6QDL_PAD_SD2_DAT2__GPIO1_IO13 0x304 0x6ec 0x000 0x5 0x0

    And i don't know how to resolve this ! Another point, i need to define #define CTP_CFG_GROUP0 in the same file but i don't know where to find this informations ...
     
  7. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    I think the pin mapping should be controlled by device tree and not hard coded

    Gesendet von meinem FP2 mit Tapatalk
     
  8. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Yes, but the googix driver ask for this ....
     
  9. patrykk

    patrykk Member

    Joined:
    Dec 10, 2014
    Messages:
    52
    Likes Received:
    9
  10. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Thanks for your answer but i already add this to dts tree , see here ;) The problem is that to build driver for goodix touchscreen i need to define some code in her file. See this doc
    page 4/5/6 I already build the files and the card boot without error (i don't receive the touch for the moment) but i don't write the good pin number in the file gt9xx.h (take random for build test ...) and i need to define CTP_CFG_GROUP0 page 5 ...
     
  11. graugans

    graugans Administrator Staff Member

    Joined:
    Sep 17, 2015
    Messages:
    328
    Likes Received:
    141
    @modjo I am booked to the limit at the moment. I can take a deeper look into this (and all other UDOO related stuff) after xmas

    Gesendet von meinem FP2 mit Tapatalk
     
    modjo likes this.
  12. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    No problem Graugans, i know that when you have more time you can help more, no problem ! You have already make some effort for the community !
    Otherwise, i saw on udoo kernel that seco adapts the same driver for the new seco sb08 (neo for industrial) but another touch. See here
     
  13. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    I make some progress on the configuration, see under :
    To have the pin number for interrupt pin and reset pin i use this formula :
    NUMBER = 32*(BANK - 1) + NP
    that give for GTP_INT_PORT : 32x(GPIO1-1)+IO15=32x0+15=15
    in device tree this give :
    Code:
            gt928@5d {
           compatible       = "goodix,gt928";
           reg              = <0x5d>;
           pinctrl-names    = "default";
           pinctrl-0        = <&pinctrl_gt928>;
           interrupt-parent = <&gpio1>;
           interrupts       = <13 IRQ_TYPE_LEVEL_LOW>;
           irq-gpio         = <&gpio1 13 GPIO_ACTIVE_LOW>;
           gpios       = <&gpio1 15 GPIO_ACTIVE_LOW>;
                    interrupt-gpio = <13>;
             reset-gpio = <15>;
           ts-max-width = <1280>;
           ts-max-height = <800>;
           ts-max-finger = <1>;
       };
    and on gt9xx.h
    Code:
    #define GTP_RST_PORT    15
    #define GTP_INT_PORT    13
    and now at boot i have this :
    Code:
    [    1.203507] mousedev: PS/2 mouse device common for all mice
    [    1.209282] <<-GTP-INFO->> GTP driver installing...
    [    1.209481] <<-GTP-INFO->> GTP Driver Version: V2.4<2014/11/28>
    [    1.209490] <<-GTP-INFO->> GTP I2C Address: 0x5d
    [    1.209503] <<-GTP-INFO->> Guitar reset
    [    1.335812] <<-GTP-INFO->> IC Version: 928_1040
    [    1.335825] <<-GTP-DEBUG->> [1348]Config Groups' Lengths: 186, 0, 0, 0, 0, 0
    [    1.338667] <<-GTP-INFO->> Sensor_ID: 1
    [    1.338676] <<-GTP-DEBUG->> [1402]Get config data from header file.
    [    1.338684] <<-GTP-INFO->> Config group0 used,length: 186
    [    1.340116] <<-GTP-DEBUG->> [1430]Config Version: 80, 0x50; IC Config Version: 65, 0x41
    [    1.340127] <<-GTP-INFO->> Driver send config.
    [    1.369336] <<-GTP-INFO->> X_MAX: 800, Y_MAX: 480, TRIGGER: 0x00
    [    1.383790] <<-GTP-INFO->> create proc entry gt9xx_config success
    [    1.384011] input: goodix-ts as /devices/virtual/input/input0
    [    1.389941] <<-GTP-DEBUG->> [1746]INT trigger type:0
    [    1.390024] <<-GTP-INFO->> GTP works in interrupt mode.
    [    1.390037] <<-GTP-INFO->> Applied memory size:2562.
    [    1.390044] <<-GTP-INFO->> I2C function: without pre and end cmd!
    [    1.390063] <<-GTP-INFO->> Create proc entry success!
    
    thats good, driver installed, but the dimensions of the screen is bad here 800x480 and we need 1280x800. I think this is define in CTP_CFG_GROUP0. I used the data used by seco for the sb08 card but i think there are not the same screen !
    Code:
    #define CTP_CFG_GROUP0 {\
       0x43,0x20,0x03,0xE0,0x01,0x05,0x3D,0x00,0x02,0x3F,\
       0x19,0x0F,0x6E,0x50,0x03,0x05,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x18,0x1A,0x1E,0x14,0x8C,0x2E,0x0E,\
       0xB3,0xB5,0x7C,0x06,0x00,0x00,0x00,0x20,0x03,0x2D,\
       0x00,0x01,0x00,0x00,0x00,0x00,0x64,0x32,0x00,0x00,\
       0x00,0xAF,0xD2,0x94,0xC5,0x02,0x0E,0x00,0x00,0x04,\
       0x81,0xB2,0x00,0x80,0xB8,0x00,0x81,0xBF,0x00,0x82,\
       0xC6,0x00,0x83,0xCE,0x00,0x83,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,\
       0x12,0x14,0x16,0x18,0x1A,0x1C,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,\
       0x10,0x12,0x13,0x14,0x16,0x18,0x1C,0x1D,0x1E,0x1F,\
       0x20,0x21,0x22,0x24,0x26,0x28,0x29,0x2A,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x76,0x01\
        }
    #endif
    #ifdef  NEW_CFG_CONFIG
    #define CTP_CFG_GROUP0 {\
       0x50,0x20,0x03,0xE0,0x01,0x05,0x3C,0x00,0x01,0x48,\
       0x1B,0x08,0x64,0x50,0x03,0x05,0x00,0x00,0x00,0x00,\
       0x11,0x11,0x00,0x18,0x1B,0x1F,0x14,0x8C,0x2E,0x0E,\
       0x28,0x2A,0x31,0x0D,0x00,0x00,0x00,0x22,0x03,0x2D,\
       0x00,0x01,0x00,0x00,0x00,0x00,0x64,0x32,0x00,0x00,\
       0x00,0x23,0x50,0x94,0xC5,0x02,0x08,0x00,0x00,0x04,\
       0x82,0x26,0x00,0x7B,0x2D,0x00,0x76,0x35,0x00,0x73,\
       0x3E,0x00,0x72,0x49,0x00,0x72,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x10,\
       0x12,0x14,0x16,0x18,0x1A,0x1C,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x02,0x04,0x06,0x08,0x0A,0x0C,0x0F,\
       0x10,0x12,0x13,0x14,0x16,0x18,0x1C,0x1D,0x1E,0x1F,\
       0x20,0x21,0x22,0x24,0x26,0x28,0x29,0x2A,0x00,0x00,\
       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
       0x00,0x00,0x00,0x00,0xA7,0x01\
        }
    if i test the input with :
    Code:
    root@secosbca62:~# cat /dev/input/event0 | hexdump
    i have input !
    Code:
    0000000 db49 5857 fb02 0006 0001 014a 0001 0000
    0000010 db49 5857 fb02 0006 0003 0035 00ff 0000
    0000020 db49 5857 fb02 0006 0003 0036 016a 0000
    0000030 db49 5857 fb02 0006 0003 0030 000e 0000
    but if i launch a qtapp i have the touch but bad configured ... need to find the good CTP_CFG_GROUP0 now !!!
     
  14. Mathan Murugan

    Mathan Murugan New Member

    Joined:
    Feb 5, 2015
    Messages:
    1
    Likes Received:
    1
    Could you please try with this configuration and let me know the result.
    #define CTP_CFG_GROUP0 {\
    0x46,0xD0,0x02,0x00,0x05,0x0A,0x05,0x40,0x01,0x08,\
    0x28,0x0F,0x50,0x32,0x03,0x05,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x8A,0x0A,0x0B,\
    0x2E,0x30,0x31,0x0D,0x00,0x00,0x00,0x02,0x03,0x1D,\
    0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,\
    0x00,0x21,0x41,0x94,0xC5,0x02,0x07,0x00,0x00,0x04,\
    0x9E,0x23,0x00,0x8D,0x28,0x00,0x80,0x2E,0x00,0x74,\
    0x35,0x00,0x69,0x3C,0x00,0x69,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x16,0x14,0x12,0x10,0x0E,0x0C,0x0A,0x08,\
    0x06,0x04,0x02,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
    0x00,0x00,0x16,0x13,0x18,0x12,0x1C,0x10,0x1D,0x0F,\
    0x0A,0x1E,0x00,0x24,0x22,0x02,0x21,0x04,0x20,0x06,\
    0x1F,0x08,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,\
    0x00,0xFB,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\
    0x9F,0xFF,0xFF,0xFF,0x00,0x01\
    }
     
  15. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    Thanks, i will try next week and let you know the result ...
     

Share This Page