Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] Input: synaptics - make InterTouch quirks table driven
@ 2026-11-05  4:26 Lovekesh Solanki
  2026-11-05  4:32 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Lovekesh Solanki @ 2026-11-05  4:26 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, linux-kernel, Lovekesh Solanki

Move the device specific InterTouch quirk into a dedicated table to
simplify exempting more devices in future.

Signed-off-by: Lovekesh Solanki <lovekeshsolanki00@gmail.com>
---
 drivers/input/mouse/synaptics.c | 50 ++++++++++++++++++++++++++++++---
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 1ed9261bff2b..748ade2004c3 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -213,6 +213,23 @@ static const char * const forcepad_pnp_ids[] = {
 	NULL
 };
 
+struct synaptics_intertouch_quirk {
+	u32 board_id;
+	const char *pnp_id;
+};
+
+/*
+ * List of devices with broken board revisions.
+ */
+static const struct synaptics_intertouch_quirk
+synaptics_intertouch_blocklist[] = {
+	{
+		/* ThinkPad T440p */
+		.board_id = 2722,
+		.pnp_id = "LEN0036",
+	},
+};
+
 /*
  * Send a command to the synaptics touchpad by special commands
  */
@@ -1814,6 +1831,33 @@ static int synaptics_create_intertouch(struct psmouse *psmouse,
 				  leave_breadcrumbs);
 }
 
+/*
+ * synaptics_intertouch_disabled - check if InterTouch should be disabled
+ * for a given touchpad based on its board revision.
+ *
+ * Returns true if the touchpad's board ID and PNP ID match a known broken
+ * entry in the synaptics_intertouch_blocklist table.
+ */
+static bool synaptics_intertouch_disabled(struct psmouse *psmouse,
+					  const struct synaptics_device_info *info)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(synaptics_intertouch_blocklist); i++) {
+		const struct synaptics_intertouch_quirk *quirk =
+			&synaptics_intertouch_blocklist[i];
+
+		if (info->board_id == quirk->board_id &&
+		    psmouse_matches_pnp_id(psmouse,
+					   (const char * const []) {
+						   quirk->pnp_id, NULL
+					   }))
+			return true;
+	}
+
+	return false;
+}
+
 /*
  * synaptics_setup_intertouch - called once the PS/2 devices are enumerated
  * and decides to instantiate a SMBus InterTouch device.
@@ -1840,10 +1884,8 @@ static int synaptics_setup_intertouch(struct psmouse *psmouse,
 			return -ENXIO;
 		}
 
-		/* Disable intertouch on known-broken T440p board revisions */
-		if (info->board_id == 2722 &&
-		    psmouse_matches_pnp_id(psmouse,
-					   (const char * const []){"LEN0036", NULL})) {
+		/* Disable intertouch on known-broken board revisions */
+		if (synaptics_intertouch_disabled(psmouse, info)) {
 			psmouse_info(psmouse,
 				     "Disabling intertouch for board id %u\n",
 				     info->board_id);
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: synaptics - make InterTouch quirks table driven
  2026-11-05  4:26 [PATCH] Input: synaptics - make InterTouch quirks table driven Lovekesh Solanki
@ 2026-11-05  4:32 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-05  4:32 UTC (permalink / raw)
  To: Lovekesh Solanki; +Cc: linux-input, dmitry.torokhov

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Input: synaptics - unused synaptics_intertouch_blocklist when SMBUS disabled
--

commit aa71c39dd9b45d27ea00e706a72ba8889d1bd158
Author: Lovekesh Solanki <lovekeshsolanki00@gmail.com>

Input: synaptics - make InterTouch quirks table driven

This commit moves the ThinkPad T440p InterTouch quirk check out of
synaptics_setup_intertouch() into a dedicated synaptics_intertouch_blocklist
table and helper function synaptics_intertouch_disabled().

> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index b007e642ea765..d366fd3398c69 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -214,6 +214,23 @@ static const char * const forcepad_pnp_ids[] = {
>  	NULL
>  };
>  
> +struct synaptics_intertouch_quirk {
> +	u32 board_id;
> +	const char *pnp_id;
> +};
> +
> +/*
> + * List of devices with broken board revisions.
> + */
> +static const struct synaptics_intertouch_quirk
> +synaptics_intertouch_blocklist[] = {
> +	{
> +		/* ThinkPad T440p */
> +		.board_id = 2722,
> +		.pnp_id = "LEN0036",
> +	},
> +};

[Severity: Low]
Will defining synaptics_intertouch_blocklist[] outside of
CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS trigger an unused-const-variable warning when
CONFIG_MOUSE_PS2_SYNAPTICS is enabled and CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is
disabled?

Here synaptics_intertouch_blocklist[] is placed under:

#if defined(CONFIG_MOUSE_PS2_SYNAPTICS) || \
    defined(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)

However, its only caller, synaptics_intertouch_disabled(), is inside the
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS block (similar to how smbus_pnp_ids[]
needed to be guarded by CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS in commit
496b7d2e5b93).

Should struct synaptics_intertouch_quirk and synaptics_intertouch_blocklist[]
be guarded by #ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS or moved down next to
synaptics_intertouch_disabled()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105042614.688312-1-lovekeshsolanki00@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-05  4:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05  4:26 [PATCH] Input: synaptics - make InterTouch quirks table driven Lovekesh Solanki
2026-11-05  4:32 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox