mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Johnny Chuang <johnny.chuang.emc@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Sasha Levin <sashal@kernel.org>,
	digetx@gmail.com, mirq-linux@rere.qmqm.pl, tiwai@suse.de,
	benjamin.tissoires@redhat.com, hdegoede@redhat.com,
	jpoimboe@redhat.com, caihuoqing@baidu.com,
	linux-input@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 18/26] Input: elants_i2c - do not check Remark ID on eKTH3900/eKTH5312
Date: Mon, 27 Dec 2021 14:03:19 -0500	[thread overview]
Message-ID: <20211227190327.1042326-18-sashal@kernel.org> (raw)
In-Reply-To: <20211227190327.1042326-1-sashal@kernel.org>

From: Johnny Chuang <johnny.chuang.emc@gmail.com>

[ Upstream commit 4ebfee2bbc1a9c343dd50565ba5ae249fac32267 ]

The eKTH3900/eKTH5312 series do not support the firmware update rules of
Remark ID. Exclude these two series from checking it when updating the
firmware in touch controllers.

Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
Link: https://lore.kernel.org/r/1639619603-20616-1-git-send-email-johnny.chuang.emc@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/input/touchscreen/elants_i2c.c | 46 +++++++++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 68f542bb809f4..b9e2219efbb8f 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -117,6 +117,19 @@
 #define ELAN_POWERON_DELAY_USEC	500
 #define ELAN_RESET_DELAY_MSEC	20
 
+/* FW boot code version */
+#define BC_VER_H_BYTE_FOR_EKTH3900x1_I2C        0x72
+#define BC_VER_H_BYTE_FOR_EKTH3900x2_I2C        0x82
+#define BC_VER_H_BYTE_FOR_EKTH3900x3_I2C        0x92
+#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C        0x6D
+#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C        0x6E
+#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C       0x77
+#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C       0x78
+#define BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB    0x67
+#define BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB    0x68
+#define BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB   0x74
+#define BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB   0x75
+
 enum elants_chip_id {
 	EKTH3500,
 	EKTF3624,
@@ -736,6 +749,37 @@ static int elants_i2c_validate_remark_id(struct elants_data *ts,
 	return 0;
 }
 
+static bool elants_i2c_should_check_remark_id(struct elants_data *ts)
+{
+	struct i2c_client *client = ts->client;
+	const u8 bootcode_version = ts->iap_version;
+	bool check;
+
+	/* I2C eKTH3900 and eKTH5312 are NOT support Remark ID */
+	if ((bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x1_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x2_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH3900x3_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x1_I2C_USB) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312x2_I2C_USB) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx1_I2C_USB) ||
+	    (bootcode_version == BC_VER_H_BYTE_FOR_EKTH5312cx2_I2C_USB)) {
+		dev_dbg(&client->dev,
+			"eKTH3900/eKTH5312(0x%02x) are not support remark id\n",
+			bootcode_version);
+		check = false;
+	} else if (bootcode_version >= 0x60) {
+		check = true;
+	} else {
+		check = false;
+	}
+
+	return check;
+}
+
 static int elants_i2c_do_update_firmware(struct i2c_client *client,
 					 const struct firmware *fw,
 					 bool force)
@@ -749,7 +793,7 @@ static int elants_i2c_do_update_firmware(struct i2c_client *client,
 	u16 send_id;
 	int page, n_fw_pages;
 	int error;
-	bool check_remark_id = ts->iap_version >= 0x60;
+	bool check_remark_id = elants_i2c_should_check_remark_id(ts);
 
 	/* Recovery mode detection! */
 	if (force) {
-- 
2.34.1


  parent reply	other threads:[~2021-12-27 19:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 19:03 [PATCH AUTOSEL 5.15 01/26] pinctrl: mediatek: fix global-out-of-bounds issue Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 02/26] Input: i8042 - add deferred probe support Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 03/26] Input: iqs626a - prohibit inlining of channel parsing functions Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 04/26] ASoC: SOF: Intel: pci-tgl: add ADL-N support Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 05/26] ASoC: SOF: Intel: pci-tgl: add new ADL-P variant Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 06/26] Input: i8042 - enable deferred probe quirk for ASUS UM325UA Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 07/26] Input: goodix - add id->model mapping for the "9111" model Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 08/26] hwmon: (lm90) Do not report 'busy' status bit as alarm Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 09/26] ASoC: rt5682: fix the wrong jack type detected Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 10/26] ASoC: tas2770: Fix setting of high sample rates Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 11/26] Revert "x86/boot: Pull up cmdline preparation and early param parsing" Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 12/26] tomoyo: Check exceeded quota early in tomoyo_domain_quota_is_ok() Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 13/26] tomoyo: use hwight16() " Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 14/26] x86/boot: Move EFI range reservation after cmdline parsing Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 15/26] net/sched: Extend qdisc control block with tc control block Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 16/26] tun: avoid double free in tun_free_netdev Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 17/26] ax25: NPD bug when detaching AX25 device Sasha Levin
2021-12-27 19:03 ` Sasha Levin [this message]
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 19/26] phonet/pep: refuse to enable an unbound pipe Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 20/26] parisc: Clear stale IIR value on instruction access rights trap Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 21/26] platform/mellanox: mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 22/26] platform/x86: apple-gmux: use resource_size() with res Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 23/26] memblock: fix memblock_phys_alloc() section mismatch error Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 24/26] ALSA: hda: intel-sdw-acpi: harden detection of controller Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 25/26] ALSA: hda: intel-sdw-acpi: go through HDAS ACPI at max depth of 2 Sasha Levin
2021-12-27 19:03 ` [PATCH AUTOSEL 5.15 26/26] r8152: sync ocp base Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211227190327.1042326-18-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=caihuoqing@baidu.com \
    --cc=digetx@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=johnny.chuang.emc@gmail.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®