[CWM] ClockworkMod 6.0.4.0 that will NOT update your touchscreen firmware

xd.bx

Senior Member
May 14, 2011
430
292
0
So I have this new tablet, and knowing all the bugs surrounding the touchscreen, decided not to update it (it came as stock JSS15J). However I still want to be able to use CM on it, so I patched the kernel to never update the touchscreen fw. Here's the compiled recovery from CM-10.2 synced today (october 2th), and then the kernel patch:

https://docs.google.com/file/d/0ByHQWL5Q6bSwYXJpaE9JZ0dnbVE/edit?usp=sharing

Code:
diff --git a/drivers/input/touchscreen/ektf3k.c b/drivers/input/touchscreen/ektf3k.c
index 4b6a7e7..451bcee 100755
--- a/drivers/input/touchscreen/ektf3k.c
+++ b/drivers/input/touchscreen/ektf3k.c
@@ -392,7 +392,7 @@ static int check_fw_version(const unsigned char*firmware, unsigned int size, int
         id = firmware[size - 2*FIRMWARE_PAGE_SIZE + 122] |
                      (firmware[size - 2*FIRMWARE_PAGE_SIZE + 123] << 8);

-        touch_debug(DEBUG_INFO, "The firmware was version 0x%X and id:0x%X\n", version, id);
+        touch_debug(DEBUG_INFO, "The firmware was version 0x%X and id:0x%X, new fw_version: 0x%X\n", version, id, fw_version);

         if (id == 0x3029 && BOOTCODE_VERSION >= 0x6046) {
                /*if the touch firmware was empty, always update firmware*/
@@ -1318,7 +1318,10 @@ static int firmware_update_header(struct i2c_client *client, unsigned char *firm
     unsigned char nb_isp_cmd[4] = {0x45, 0x49, 0x41, 0x50};
     unsigned char *cursor;
     struct elan_ktf3k_ts_data *ts = i2c_get_clientdata(client);
-
+
+    printk("[ektf3k]: firmware_update_header: not updating your firmware, bro\n");
+    return 0;
+
     if(ts == NULL)
         return -1;
I can also upload the kang if anyone needs it. Note my patch has the old/new version swapped (small bug), it says new fw_version, but it's actually the current version.

I tested it with my own device just in case someone is wondering wether it works or not.
 
  • Like
Reactions: TheDarkDefender

xd.bx

Senior Member
May 14, 2011
430
292
0
On a slightly unrelated note, my CM 10.2 kang would not have the Wi-Fi module loading. I had this error in logcat:

Code:
E/WifiHW  (  190): Failed to write wlan fw path param (Operation not permitted)
E/WifiStateMachine(  597): Failed to reload STA firmware java.lang.IllegalStateException: command '6 softap fwreload wlan0 STA' failed with '400 6 SoftAP command has failed'
Digging a bit further led to this error in the kernel log:

Code:
<6>[   69.311614] wlan: loading driver v3.2.2.17B
<3>[   69.314300] wlan: [573:F :HDD] hdd_parse_config_ini: request_firmware failed -2
However the official nightly didn't have this issue. I tracked it down to the lack of a symbolic link, which I had to create manually:

Code:
mount -o remount,rw /dev/block/platform/msm_sdcc.1/by-name/system /system
cd /vendor/firmware/wlan/prima/
ln -s /data/misc/wifi/WCNSS_qcom_cfg.ini WCNSS_qcom_cfg.ini
ln -s /data/misc/wifi/WCNSS_qcom_wlan_nv.bin WCNSS_qcom_wlan_nv.bin
I hope this information will be useful to others. Still not sure why my build has this problem and the official builds don't.
 
  • Like
Reactions: TheDarkDefender