From: Danny Wood Date: Tue, 9 Feb 2021 15:43:46 +0000 (+0000) Subject: universal7580: abov_touchkey: Fix firmware loading of ft1604 devices X-Git-Url: https://git.stricted.de/?p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git;a=commitdiff_plain;h=d78a73afd9cec8a6d7f205519a6ca4eac4ea4443 universal7580: abov_touchkey: Fix firmware loading of ft1604 devices Also fix ft1604 firmware versions of other A510x variants Change-Id: I33004e2f62b5954bf7b4f2ab6337c0ce39907287 --- diff --git a/drivers/input/keyboard/abov_touchkey_ft1804.c b/drivers/input/keyboard/abov_touchkey_ft1804.c index 8a0b6bd859b..490b372dca8 100644 --- a/drivers/input/keyboard/abov_touchkey_ft1804.c +++ b/drivers/input/keyboard/abov_touchkey_ft1804.c @@ -1760,13 +1760,16 @@ static int abov_tk_fw_update(struct abov_tk_info *info, u8 cmd) usleep_range(5 * 1000, 5 * 1000); tk_debug_info(true, &info->client->dev, "%s fw_mode_cmd sended\n", __func__); - if(abov_tk_fw_mode_check(info) != 1) - { - pr_err("%s: err, flash mode is not: %d\n", __func__, ret); - return 0; + if (is_ft1604_chip) { + tk_debug_info(true, &info->client->dev, "%s ft1604: skipping abov_tk_fw_mode_check() and abov_tk_flash_erase()\n", __func__); + } else { + if(abov_tk_fw_mode_check(info) != 1) { + pr_err("%s: err, flash mode is not: %d\n", __func__, ret); + return 0; + } + ret = abov_tk_flash_erase(info); } - ret = abov_tk_flash_erase(info); msleep(1300); tk_debug_info(true, &info->client->dev, "%s fw_write start\n", __func__); @@ -3030,15 +3033,21 @@ static int __init get_bootloader(char *bootloader) { is_ft1604_chip = false; - if (strstr(bootloader, "A510M") || strstr(bootloader, "A510Y")) { + if (strstr(bootloader, "A510M")) { is_ft1604_chip = true; fw_path = "abov/abov_ft1604_a5_ltn.fw"; } + else if (strstr(bootloader, "A510Y") || strstr(bootloader, "A510K") || + strstr(bootloader, "A510L") || strstr(bootloader, "A510S") || + strstr(bootloader, "A5108")) { + is_ft1604_chip = true; + fw_path = "abov/abov_ft1604_a5.fw"; + } else if (strstr(bootloader, "A310N0") || strstr(bootloader, "A310M")) { is_ft1604_chip = true; fw_path = "abov/abov_ft1604_a3.fw"; } - + return 0; } early_param("androidboot.bootloader", get_bootloader);