Bug 220056 - PixArt touchpad not detected due to wrong pinctrl
Summary: PixArt touchpad not detected due to wrong pinctrl
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: GPIO/Pin Control (show other bugs)
Hardware: Intel Linux
: P3 high
Assignee: GPIO/Pin Control virtual assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-25 18:20 UTC by Guido Trentalancia
Modified: 2025-04-27 20:00 UTC (History)
4 users (show)

See Also:
Kernel Version: at least since 6.0.8
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Attached a patch that adds missing I2C pin definitions for Alder Lake. Needs testing on real hardware. (1.62 KB, patch)
2025-04-26 19:57 UTC, Ariel Simulevski
Details | Diff
Proposed patch with correct pin numbering and comment (1.69 KB, patch)
2025-04-26 21:45 UTC, Guido Trentalancia
Details | Diff
Second revision of the patch with an example on how to correct the structure bounds (2.42 KB, patch)
2025-04-26 22:37 UTC, Guido Trentalancia
Details | Diff
Revised v2 patch: add missing I2C2/I2C3/I2C4 pins and update community structures (2.39 KB, patch)
2025-04-26 22:59 UTC, Ariel Simulevski
Details | Diff

Description Guido Trentalancia 2025-04-25 18:20:25 UTC
The I2C PixArt touchpad (PIXA3848) found on some laptops using the Intel Alderlake chipset, including several Acer laptops and the Framework Laptop 13 is not detected due to a bug in the pinctrl module: to use the touchpad it is necessary to use CONFIGURE_PINCTRL_TIGERLAKE in the kernel configuration, even though the laptop uses the newer Alderlake chipset (CONFIGURE_PINCTRL_ALDERLAKE).

See: PixArt touchpad: https://linux-hardware.org/?id=ps/2:3848-3848-pixa3848-00-093a-touchpad

See: Framework laptop configuration on Gentoo wiki: https://wiki.gentoo.org/wiki/Framework_Laptop_13
Comment 1 Ariel Simulevski 2025-04-26 19:57:02 UTC
Created attachment 308024 [details]
Attached a patch that adds missing I2C pin definitions for Alder Lake. Needs testing on real hardware.

Hey! I tried fixing this as my first attempt at kernel hacking.
I added missing I2C2/I2C3/I2C4 pin definitions based on the Tiger Lake mappings.
This should definitely be tested on real hardware to verify if it resolves the touchpad detection issue.
Comment 2 Guido Trentalancia 2025-04-26 20:35:22 UTC
I confirm that the proposed patch resolves the issue. Thanks.
Comment 3 Guido Trentalancia 2025-04-26 21:45:43 UTC
Created attachment 308025 [details]
Proposed patch with correct pin numbering and comment

Revised patch which does at least introduce the new pins with an acceptable numbering
Comment 4 Guido Trentalancia 2025-04-26 21:47:43 UTC
Please see the attached revised patch: the comment has been improved and the new pins are introduced with at least an acceptable numbering, if you want to avoid reordering the whole list.
Comment 5 Ariel Simulevski 2025-04-26 22:02:34 UTC
Awesome, thanks!
Do you want to submit the patch or shall I?
As I'm learning, I'd like to give it a shot :)
Comment 6 Guido Trentalancia 2025-04-26 22:37:04 UTC
Created attachment 308026 [details]
Second revision of the patch with an example on how to correct the structure bounds

Correct the community structure bounds.
Comment 7 Guido Trentalancia 2025-04-26 22:39:01 UTC
If you submit the patch as it is, it will probably be rejected even if it resolves the issue.

I don't have the Intel specifications, therefore I am not sure how to proceed. 

But please consider that the pin definitions are grouped in communities.

So, the structures at the bottom of the file also need to be updated...

Please see the latest revised patch on how in principle the bounds of the structure definitions need to be updated.
Comment 8 Ariel Simulevski 2025-04-26 22:59:06 UTC
Created attachment 308027 [details]
Revised v2 patch: add missing I2C2/I2C3/I2C4 pins and update community structures

Hi Guido,

Thanks again for the feedback.

I have uploaded a revised v2 patch that corrects both the pin definitions and the community structures as you suggested.

Would appreciate your review before I send it upstream. Thanks!
Comment 9 Andy Shevchenko 2025-04-27 08:56:35 UTC
Folks, I don't know what's going on here, but using the Tiger Lake driver is the correct approach. So, what's the problem?
Comment 10 Andy Shevchenko 2025-04-27 09:23:12 UTC
Note, the patch without shuffling the ACPI IDs does basically nothing, it adds random pins to random driver. I'm utterly confused on how it may solve anything, but adding problems.
Comment 11 Ariel Simulevski 2025-04-27 11:37:16 UTC
Thanks Andy for the clarification.

I'm still learning and don't fully understand all the platform details here yet, but I appreciate you explaining why patching the Alder Lake driver isn't the right approach.

Thanks again for taking the time to review this!
Comment 12 Guido Trentalancia 2025-04-27 12:11:16 UTC
How can using the pinctrl driver for another chipset be the right approach ?

An user which configures the kernel for a machine based on the Intel Alder Lake chipset cannot figure out that the pinctrl driver for another chipset needs to be used.

I have tried searching for the official Intel PCH specification, but it seems that no specifications are available:

https://www.intel.com/content/www/us/en/products/platforms/details/alder-lake-p/docs.html

I agree that the current patch from Ariel does not respect the proper grouping and ordering of communities (which need to be based on official specifications) and that therefore it is not ready for merging, but the solution in my opinion is to fix the patch so that the Alder Lake pinctrl module correctly defines the I2C pins.
Comment 13 Guido Trentalancia 2025-04-27 14:53:49 UTC
Marking it as REOPENED because the issue has not been resolved nor the specifications to resolve it have been provided.
Comment 14 Ariel Simulevski 2025-04-27 16:27:49 UTC
Yeah as it stands, this grouping is based on observation, not official documentation (I think I even wrote that in a comment in my first patch). As I don’t have access to the Intel PCH documentation (and am still getting into Kernel Hacking), these were more or less educated guesses.

Andy if you prefer, I am happy to withdraw the patch and instead suggest documenting the need to use CONFIG_PINCTRL_TIGERLAKE for affected systems.

I do agree with Guido tho that the status quo is sort of confusing.
Comment 15 Andy Shevchenko 2025-04-27 18:55:29 UTC
(In reply to Guido Trentalancia from comment #12)

TL;DR: Yes, we probably need to amend the help texts for the kernel configuration options, no code seem need to be fixed.

> How can using the pinctrl driver for another chipset be the right approach ?

This is the big misunderstanding here. Linux is NOT a Windows in a sense of the device driver model and what the approach is used for the supported platforms. Besides that the granularity of the platform is not a *chipset*, it's *an IP*. And this makes a lot of differences here. The whatever chipset or hardware in a sense may use and re-use the same IP blocks over and over. That's why one driver can span over several generations of the hardware. This approach applies to many vendors and much more hardware IPs than just this case. I suggest you to study this more (in case you want to go deep with it).
Comment 16 Andy Shevchenko 2025-04-27 18:57:50 UTC
(In reply to Guido Trentalancia from comment #13)
> Marking it as REOPENED because the issue has not been resolved nor the
> specifications to resolve it have been provided.

What *issue*?! The provided patch does NOT solve *anything*. It makes things worse. Please, try to explain the issue here, as I am completely out on what's going on here. Currently it's all red herring.
Comment 17 Andy Shevchenko 2025-04-27 19:01:22 UTC
(In reply to Ariel Simulevski from comment #14)
> Yeah as it stands, this grouping is based on observation, not official
> documentation (I think I even wrote that in a comment in my first patch). As
> I don’t have access to the Intel PCH documentation (and am still getting
> into Kernel Hacking), these were more or less educated guesses.
> 
> Andy if you prefer, I am happy to withdraw the patch and instead suggest
> documenting the need to use CONFIG_PINCTRL_TIGERLAKE for affected systems.
> 
> I do agree with Guido tho that the status quo is sort of confusing.

To understand the issue, I need to hear how you reproduce it and how this patch makes it different. The drivers are bound to the devices based on ID tables (ACPI ID table in this case). Your change doesn't alter that and hence it can't be involved in anything related to this case, it can't *fix* anything.
Comment 18 Guido Trentalancia 2025-04-27 20:00:34 UTC
Andy, the patch that Ariel provided did sort the issue of I2C PIXA touchpad detection, although it's pretty clear that it uses duplicated pin numbering that needs proper grouping and ordering within the existing communities.

So Ariel intuition sounds correct to me, in that the pin definitions for I2C SDA and SCL lines are missing in the Alder Lake pinctrl driver.

From an end-user point of view it's illogical and not intuitive that one has to use a kernel module targeting another chipset in order for I2C device detection to work properly.

Steps to reproduce:

 - grab an Intel Alder Lake based laptop using the PixArt touchpad from the list 
   provided at:
   https://linux-hardware.org/?id=ps/2:3848-3848-pixa3848-00-093a-touchpad

 - build a kernel with the pinctrl-alderlake module using the
   CONFIG_PINCTRL_ALDERLAKE kernel configuration option: this is what a normal
   end user does

 - install the newly built kernel and reboot

 - start an X session and realize that the touchpad is not working or otherwise
   use "dmesg | grep -i input" to realize from the kernel log that the I2C
   touchpad has not been detected

Steps to resolve the issue:

 - apply any of the patches provided in this bug report

 - rebuild the kernel, install it and reboot

 - start an X session or type "dmesg | grep -i input" and realize that the I2C
   PixArt touchpad is not detected, as the Alder Lake pinctrl driver now
   includes the definitions for the I2C SDA and SCL lines that were missing in
   the original version of the kernel Alder Lake pinctrl module

Steps that might possibly lead to the creation of a proper patch:

 - edit the drivers/pinctrl/intel/pinctrl-alderlake.c kernel module source code

 - ask Intel to kindly provide the official documentation for the Alder Lake PCH

 - add the definition for the 4 I2C SDA and SCL lines in the proper group and
   community: for example in the Tiger Lake driver that was group GPP_H and
   community 1

 - modify the bounds in the structures at the bottom of the kernel module source
   code in order to account for the newly added I2C SDA and SCL lines

I believe marking this as RESOLVED INVALID is not the way forward.

Note You need to log in before you can comment on or make changes to this bug.