Hi joe:
Just yesterday I ended an user-space device driver for gslx680. It has
the advantage of being able to do scrolling and zoom in X by emulating
the mouse wheel, and also allows to do a "right click". Just in case
someone wants to play with it...
https://github.com/rastersoft/gsl1680
El 27/08/13 21:14, joe.a.bu...@gmail.com escribi�:
Hi joe:
Just yesterday I ended an user-space device driver for gslx680. It has
the advantage of being able to do scrolling and zoom in X by emulating
the mouse wheel, and also allows to do a "right click". Just in case
someone wants to play with it...
https://github.com/rastersoft/gsl1680
El 27/08/13 21:14, joe.a.bu...@gmail.com escribi�:
--
You received this message because you are subscribed to a topic in the Google Groups "linux-sunxi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/linux-sunxi/SZGxiTQcFyY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to linux-sunxi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The incomplete xfer is not 0x20 so the twi_id is 1 and adapter address correct.
Not sure what the 0xf8 / 0xff codes are but
I'm guessing something is being read sequentially from START. I think it wants early suspend in the kernel source so the touchscreen is idle in low powered state.
Still trying.
*****************************************************************
[ 3.131863] [DISP] ***
[ 3.135430] [DISP] *** LCD Panel Parameter Check
[ 3.136756] [DISP] ***
[ 3.140323] [DISP] *** by dulianping
[ 3.141642] [DISP] ***
[ 3.148328] [DISP] *****************************************************************
[ 3.149653] [DISP] ***
[ 3.151747] [DISP] *** Interface:
[ 3.154621] [DISP] *** Parallel HV Panel
[ 3.157507] [DISP] *** Lcd Frm to RGB666
[ 3.158822] [DISP] ***
[ 3.160828] [DISP] *** Timing:
[ 3.163529] [DISP] *** lcd_x: 480
[ 3.166229] [DISP] *** lcd_y: 272
[ 3.168944] [DISP] *** lcd_ht: 525
[ 3.171472] [DISP] *** lcd_hbp: 2
[ 3.174173] [DISP] *** lcd_vt: 572
[ 3.176708] [DISP] *** lcd_vbp: 2
[ 3.179236] [DISP] *** lcd_hspw: 0
[ 3.181768] [DISP] *** lcd_vspw: 0
[ 3.184902] [DISP] *** lcd_frame_frq: 79Hz
[ 3.186224] [DISP] ***
[ 3.190659] [DISP] *** WRN03: Recommend "lcd_dclk_frq = 9"
[ 3.191979] [DISP] ***
[ 3.195892] [DISP] *** LCD Panel Parameter Check End
[ 3.202590] [DISP] *****************************************************************
I still have no idea why it disagrees about module_layout and perhaps a manual hex edit is needed. I have compiled the driver against my kernel so that should not be there.
Cracked open the tablet just to make sure it is using a GSL chip. It is: 1680E
Added this to script.fex
[gpio_para]
gpio_used = 1
gpio_num = 1
gpio_pin_1 = port:PB03<1><default><default><1>
gpio-sunxi loads successfully in /sys/devices/
Thought the rtc was tying up the bus, disabled it in kernel, but still no go.
Loaded this driver in linaro, i2cdetect showed that address 0x40 was in use 'UU' and that's good so far.
I did notice something about the original android gslx680.ko driver from the 420TPC. It loads multiple firmwares so the fw_extractor tool basically took all of them including the 420TPC which will be invalid firmware data.
Contains 14 chip firmwares for the motherboards:
1. GSL1680E_FW_86VS_INET
2. GSL1680E_FW_86VSH_INET
3. GSL1680E_FW_66V_M4302_INET_V2 <--- this is the one for 420TPC
4. GSL3680_FW_shenghexiang0072
5. GSL1680D_FW_86VSH_INET
6. GSL1680D_FW_86VS_INET
7. GSLx680_FW_85V_M501V
8. GSL1680_FW_newdingshengwei_1
9. GSLx680_FW_86FV_M728_TOPSUN_C0801
10. GSLx680_FW_NEWDINGSHENGWEI_OGS_4
11. GSL1680_FW_newdingshengwei_5
12. GSL1680_FW_TOPSUN_OGS_G7009
13. GSLX680_FW_86V_TOPSUN_OGS
14. GSL1680_FW_haina
Well now we know it's nothing to do with mix of kernel build.
Not that easy.
Can you send me that Android gslx680 driver? I sort out the extractor.
Assuming the firmware is cut correctly, next would be check the state of the device. Did you comment out the Android specific code? Maybe that suspend code is broken and the gslx680 is asleep. I've never play with Android part but didn't scope out that old code.
Joe
Interesting you mention about the build. I changed the kernel from 3.4 to 3.0.76 (and there are many of them)
and the android drivers inet_ctp and gslx680 force modprobed without kpanic.
The only thing is now it's no longer reporting STOP or i2c state not idle, but
instead incomplete xfer (0x20) and incomplete xfer (0x48) right after a blurb
ctp_init_platform_resource: tp_reset request gpio failed!
It however did read the script.bin parameters correctly like ctp_exchange_x_y_flag etc.
The error 0x48 is about wakeup. Device probably didn't wake so nothing got sent.
If this passes, then the touchscreen should be active and the following incomplete xfer (0x20) <-- tons of these messages might actually send legit data over the bus. I think those xfers were to download the firmware.
So gonna enable some debugging on the i2c and pinpoint this.
Then if this works, try out the linux driver compilation and see how it differs in output.
TPC 10 point touch firmware 1280x800:
https://www.dropbox.com/meta_dl/eyJzdWJfcGF0aCI6ICIiLCAidGVzdF9saW5rIjogZmFsc2UsICJzZXJ2ZXIiOiAiZGwuZHJvcGJveHVzZXJjb250ZW50LmNvbSIsICJpdGVtX2lkIjogbnVsbCwgImlzX2RpciI6IGZhbHNlLCAidGtleSI6ICIzNGs1ajN1MDhvZzJmc2QifQ/AAKoqqQ6bWxc0Sa-m6CO0Z4J3REyDthtO-HmK2lZusscWA?dl=1
I do not believe there are 7 firmwares, because from my understanding a firmware footer visually ends with many 0xFFFFFFF so if I counted correctly, there are only 2 and the rest of the data is configuration. After extracting just those two, I get 2 different screen resolutions and more parameters like 10 point touch, 1280x800 for the bigger screen of course.
The end footer in this case is 7C 00 00 00 16 FF FF FF {0x7c,0xFFFFFF16}
In a hex editor, I scanned instances of 0xC0FFA5A5 (Common object file format) as this seems to be a marker. It does start with 0xF0 and 0x03 but it's read in reverse so "F0 00 00 00 03 00 00 00 00 00 00 00 C0 FF A5 A5". In the android driver when I dmesg in android not linux, the driver looks for those bytes during the firmware download process and outputs them to screen.
So it appears that it uses an 800x480 touch screen resolution on an LDPI 480x272 screen resolution which is actually 1024x768 in script.bin's screen_output_mode parameter.
By the way 3.4 removed early_suspend and 3.0.76 has it.
Could early_suspend have anything to do with this?
So after you cut the fw, 14 blocks? Hmmm, this is almost a go.
I'll try out fw_extractor and fw_info again and see which file makes it work. Other source code I've seen needs firmware + config.
The 3.4 kernel continued to bug out and state i2c not idle so scrapped it and went 3.0.76. Interesting is that enabling/disabling early_suspend in this kernel doesn't make much difference other than the fact that early_suspend had in the past corrupted many of my SDCARDs! This kernel seems to behave well and load android/linux compiled drivers no problem. 8188eu wifi is messed, but that's another story and different prob.
Compiled the driver and it registered an input device!
After that, it went on to the firmware download process, lagged a bit because of the large file being passed (wrong firmware) and I am betting
if the right file is passed this will work and should see output with "cat /dev/input/event3"
The original script.bin contained other touch firmware ctp names.
In android, the init basically loads all those drivers until the right one just works. The inet_ctp module does nothing more than check for the right ctp_name because the gslx680 was ctp12_name in the script.bin and it's usually just ctp_name. inet_ctp isn't needed, it doesn't contain any firmware.
It works! Backwards... Basically the board was the 3rd in that list (INET_66V), but that's an easy fix in the script.bin with the x y order.
Here's the firmware for 420TPC:
https://www.dropbox.com/s/7fz9i74l8rp70pk/420TPC.fw
Thank you for this amazing tool and driver port!
Stay tuned as I'll be dd'ing an SDCARD image very soon once other drivers sorted out and distro deemed ready.
I also have a suggestion: With A20, I think you should remove "IRQF_TRIGGER_FALLING |".
WITH ORIGINAL SOURCE CODE, dmesg shows the error with irq:
[ 23.424864] ===========================gslx680_ts_init=====================
[ 23.432022] _fetch_sysconfig_para.
[ 23.442333] gslx680 firmware gslX680.fw.
[ 23.456662] _fetch_sysconfig_para: after: ctp_twi_addr is 0x40, dirty_addr_buf: 0x40. dirty_addr_buf[1]: 0xfffe
[ 23.467703] _fetch_sysconfig_para: ctp_twi_id is 2.
[ 23.472789] _fetch_sysconfig_para: screen_max_x = 1024.
[ 23.477010] _fetch_sysconfig_para: screen_max_y = 600.
[ 23.483917] _fetch_sysconfig_para: revert_x_flag = 0.
[ 23.489023] _fetch_sysconfig_para: revert_y_flag = 0.
[ 23.496604] _fetch_sysconfig_para: exchange_x_y_flag = 0.
[ 23.505517] _init_platform_resource: tp_io request gpio fail!
[ 23.513521] i2c-core: driver [gslx680] using legacy suspend method
[ 23.522049] i2c-core: driver [gslx680] using legacy resume method
[ 23.525090] incomplete xfer (0x20)
[ 23.528837] incomplete xfer (0x20)
[ 23.534765] ctp_detect: Detected chip gslx680 at adapter 2, address 0x40
[ 23.540658] ====gslx680_ts_probe begin=====.
[ 23.555247] ==kzalloc success=
[ 23.558058] [GSLX680] Enter gsl_ts_init_ts
[ 23.562263] ctp_set_irq_mode: config gpio to int mode.
[ 23.568908] ctp_set_irq_mode, 854: gpio_int_info, port = 8, port_num = 21.
[ 23.572230] INTERRUPT CONFIG
[ 23.579844] input: gslx680 as /devices/platform/sunxi-i2c.2/i2c-2/2-0040/input/input1
[ 23.667193] =============gsl_load_fw start==============
[ 25.466695] =============gsl_load_fw end==============
[ 25.779206] setting trigger mode 2 for irq 60 failed (gic_set_type+0x0/0xd8)
[ 25.791386] gslx680 2-0040: gslx680_ts probe: request irq failed
[ 25.801959] gslx680: probe of 2-0040 failed with error -22
SOURCE CODE REMOVED "IRQF_TRIGGER_FALLING |", dmesg shows:
[ 23.312732] ===========================gslx680_ts_init=====================
[ 23.317943] _fetch_sysconfig_para.
[ 23.320942] gslx680 firmware gslX680.fw.
[ 23.330076] _fetch_sysconfig_para: after: ctp_twi_addr is 0x40, dirty_addr_buf: 0x40. dirty_addr_buf[1]: 0xfffe
[ 23.337726] _fetch_sysconfig_para: ctp_twi_id is 2.
[ 23.343156] _fetch_sysconfig_para: screen_max_x = 1024.
[ 23.373210] _fetch_sysconfig_para: screen_max_y = 600.
[ 23.383419] _fetch_sysconfig_para: revert_x_flag = 0.
[ 23.387623] _fetch_sysconfig_para: revert_y_flag = 0.
[ 23.392110] _fetch_sysconfig_para: exchange_x_y_flag = 0.
[ 23.396943] _init_platform_resource: tp_io request gpio fail!
[ 23.420559] i2c-core: driver [gslx680] using legacy suspend method
[ 23.425636] i2c-core: driver [gslx680] using legacy resume method
[ 23.430995] incomplete xfer (0x20)
[ 23.433508] incomplete xfer (0x20)
[ 23.445736] ctp_detect: Detected chip gslx680 at adapter 2, address 0x40
[ 23.459730] ====gslx680_ts_probe begin=====.
[ 23.461769] ==kzalloc success=
[ 23.464620] [GSLX680] Enter gsl_ts_init_ts
[ 23.494149] ctp_set_irq_mode: config gpio to int mode.
[ 23.518132] ctp_set_irq_mode, 854: gpio_int_info, port = 8, port_num = 21.
[ 23.522062] INTERRUPT CONFIG
[ 23.537085] input: gslx680 as /devices/platform/sunxi-i2c.2/i2c-2/2-0040/input/input1
[ 23.627277] =============gsl_load_fw start==============
[ 25.653621] =============gsl_load_fw end==============
[ 25.965873] ==gslx680_ts_probe over =
It seems to be initialized successfully. But my touchscreen does not work anyway. I'm still debugging it. If you have any idea about this, please let me know. Thank you so much!
Just yesterday i found out that 3.4.90 kernel has bugs with i2c devices since they changes i2c transfer speed from 200khz to standard 100khz. Changed back to 200 khz and the complaining about incomplete xfer dissapeared. The driver load successfully but i still can't get output. Maybe just firmware problem since fw extractor give me strange output.. it's split fw by 20 or more files.
tried check every fw with fw_info and the result every fw files not given information by fw_info. Any suggestion?