Input: synaptics - make InterTouch quirks table driven
Subsystems (2)
PATCH 1/1 Input: synaptics - make InterTouch quirks table driven
Move the device specific InterTouch quirk into a dedicated table to simplify exempting more devices in future.
--- drivers/input/mouse/synaptics.c | 50 ++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-)
drivers/input/mouse/synaptics.c +46 -4
@@ -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);
Signature · 1 line
2.56.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Input: synaptics - unused synaptics_intertouch_blocklist when SMBUS disabled --
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 <[email protected]>
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().
Quoted 14 lines
drivers/input/mouse/synaptics.c +6
-0@@ -214,6 +214,23 @@ static const char * const forcepad_pnp_ids[] = { NULL }; +struct synaptics_intertouch_quirk { +u32 board_id; +const char *pnp_id; +}; + +/*
drivers/input/mouse/synaptics.c static const char * const forcepad_pnp_ids[] = { · line 232
Quoted 10 lines
drivers/input/mouse/synaptics.c +10
-0+* 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()?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Lovekesh,
kernel test robot noticed the following build warnings:
[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v7.4-rc1 next-20261030] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Lovekesh-Solanki/Input-synaptics-make-InterTouch-quirks-table-driven/20261105-095614 base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next patch link: https://lore.kernel.org/r/20261105042614.688312-1-lovekeshsolanki00%40gmail.com patch subject: [PATCH] Input: synaptics - make InterTouch quirks table driven config: csky-defconfig (https://download.01.org/0day-ci/archive/20261105/[email protected]/config) compiler: csky-linux-gcc (GCC) 16.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261105/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/input/mouse/synaptics.c:226:1: warning: 'synaptics_intertouch_blocklist' defined but not used [-Wunused-const-variable=]
226 | synaptics_intertouch_blocklist[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/input.h:19,
from include/linux/input/mt.h:11,
from drivers/input/mouse/synaptics.c:26:
drivers/input/mouse/synaptics.c: In function 'synaptics_init_ps2':
<command-line>: warning: '%s' directive argument is null [-Wformat-overflow=]
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:160:58: note: in expansion of macro 'dev_fmt'
160 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
drivers/input/mouse/psmouse.h:202:9: note: in expansion of macro 'dev_info'
202 | dev_info(&(psmouse)->ps2dev.serio->dev, \
| ^~~~~~~~
drivers/input/mouse/psmouse.h:195:33: note: in expansion of macro 'KBUILD_BASENAME'
195 | #define psmouse_fmt(fmt) KBUILD_BASENAME ": " fmt
| ^~~~~~~~~~~~~~~
drivers/input/mouse/psmouse.h:203:18: note: in expansion of macro 'psmouse_fmt'
203 | psmouse_fmt(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
drivers/input/mouse/synaptics.c:1696:17: note: in expansion of macro 'psmouse_info'
1696 | psmouse_info(psmouse,
| ^~~~~~~~~~~~vim +/synaptics_intertouch_blocklist +226 drivers/input/mouse/synaptics.c
221
222 /*
223 * List of devices with broken board revisions.
224 */
225 static const struct synaptics_intertouch_quirk
> 226 synaptics_intertouch_blocklist[] = { 227 {
228 /* ThinkPad T440p */
229 .board_id = 2722,
230 .pnp_id = "LEN0036",
231 },
232 };
233
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Lovekesh,
kernel test robot noticed the following build warnings:
[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus hid/for-next linus/master v7.3 next-20261030] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Lovekesh-Solanki/Input-synaptics-make-InterTouch-quirks-table-driven/20261105-095614 base: https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next patch link: https://lore.kernel.org/r/20261105042614.688312-1-lovekeshsolanki00%40gmail.com patch subject: [PATCH] Input: synaptics - make InterTouch quirks table driven config: um-defconfig (https://download.01.org/0day-ci/archive/20261105/[email protected]/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 812626a41399a1d464a0d69627ab45c83b8ebfb9) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261105/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/input/mouse/synaptics.c:226:1: warning: unused variable 'synaptics_intertouch_blocklist' [-Wunused-const-variable]
226 | synaptics_intertouch_blocklist[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1 warning generated.
vim +/synaptics_intertouch_blocklist +226 drivers/input/mouse/synaptics.c
221
222 /*
223 * List of devices with broken board revisions.
224 */
225 static const struct synaptics_intertouch_quirk
> 226 synaptics_intertouch_blocklist[] = { 227 {
228 /* ThinkPad T440p */
229 .board_id = 2722,
230 .pnp_id = "LEN0036",
231 },
232 };
233
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
PATCH v2 1/1 Input: synaptics - make InterTouch quirks table driven
In reply to Lovekesh SolankiMove the device specific InterTouch quirk into a dedicated table to simplify exempting more devices in the future.
---
Changes in v2:
- Guard synaptics_intertouch_quirk & synaptics_intertouch_blocklist by #ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS to match its only caller synaptics_intertouch_disabled().
---
drivers/input/mouse/synaptics.c | 52 ++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-)
drivers/input/mouse/synaptics.c +48 -4
@@ -213,6 +213,25 @@ static const char * const forcepad_pnp_ids[] = { NULL }; +#ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS +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" , + }, +}; +#endif +/* * Send a command to the synaptics touchpad by special commands */
@@ -1814,6 +1833,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 +1886,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);
Signature · 1 line
2.56.0
Hey Dmitry,
Just following up on this patch, it moves the Intertouch quirk into a dedicated table, to make it easier to exempt devices in the future.
Please let me know if there are any concerns or changes are needed.
Thanks,
Lovekesh