Created attachment 207365 [details]
Patch (Revision 1)
Add PCI IDs for I2C controller for Intel Cannon Lake PCH models. Cannon Lake is used on systems based on platforms like Intel Coffee Lake and Whiskey Lake.
Inspired by Linux commit b418bbff36dd25dc49ed6abbb1e1deedd0d7cff5
Tested on the HP Spectre x360 13-ap0043dx running 13-CURRENT.
Thank you for the report and patch Neel
According to intel-lpss driver, Cannon Lake has a different IC clock rate as compared to Sky Lake, 216MHz vs 120MHz. That means new enum value should be assigned to it.
Created attachment 207680 [details]
Patch (Revision 2)
Thanks for the feedback!
I have added an enum for Cannon Lake. However, it does the same exact thing as Skylake.
However, I do not see any mention of 120 MHz frequency for Skylake I2C on FreeBSD and couldn't include it here. If this code exists in FreeBSD, where is it?
(In reply to Neel Chauhan from comment #3)
> If this code exists in FreeBSD, where is it?
Not in vanilla sources yet. Clock registers in FreeBSD ig4 driver are still tuned to support Mathew Dillon's Haswell? chromebook only but they should be tuned for each controller model separately based on its IC clock rate.
Thanks to separate clock line, I2C bus is not very sensitive to timing deviations and Haswell clock values still works sometimes. Only sometimes, so this part must be improved.
Created attachment 207704 [details]
Now the patch looks good to me, so I included it in my ig4 patchset that I am going to put on phabricator in next few days to further review.
Could you test it, Neel? It requires very recent CURRENT to be applied cleanly but all rejects can be trivially fixed on old CURRENT or 12-STABLE.
(In reply to Vladimir Kondratyev from comment #5)
Sorry for the delay, I was busy.
Your ig4 patchset works well for me.
Created attachment 207864 [details]
dmesg log of the HP Spectre x360 13-p0043dx wulf's iichid patch
(In reply to Neel Chauhan from comment #6)
Never mind this comment, I forgot to reboot when I commented. The touchpad does not work with this patch.
dmesg log is attached.
(In reply to Neel Chauhan from comment #7)
> The touchpad does not work with this patch.
That is strange. I see no attempts to read HID descriptor by your I2C device in dmesg. Such attempts should look like:
iichid0: HID command I2C_HID_CMD_DESCR at 0xXX
Do you observe such a lines in dmesg? They precedes first communication with HID device through I2C so they do not depend on state of the ig4 driver.
Created attachment 207905 [details]
ig4 patchset rev.2
Previous patch required patched iicbus driver
I fixed it and now it works with stock iicbus. Neel, could you try it again?
(In reply to Vladimir Kondratyev from comment #9)
Good news: your new patch works!
(In reply to Neel Chauhan from comment #10)
Would you be willing to add your current dmesg? I'm trying to get the touchpad working on a Dell Latitude 5500 (*not* E5500); I've applied the patchset rev.2 (attachment 207905 [details]) over 13 CURRENT r352911, and I'm trying to figure out what's missing.
Vladimir, I think the ig4 patchset should include newer Intel platforms as well:
* Ice Lake: https://github.com/torvalds/linux/commit/a13c93b3a5db87a173b2cdc6c2f2122d9d677808#diff-0cb73ca5571efd62ddd5a5fc79d3af04
* Cannon Lake: https://github.com/torvalds/linux/commit/dd6629073a97e5ee125eacbd22eea62281891c67#diff-0cb73ca5571efd62ddd5a5fc79d3af04
* Elkhart Lake: https://github.com/torvalds/linux/commit/01e4ecee03aa81ec3565d70c80cd1282088fc5a6#diff-0cb73ca5571efd62ddd5a5fc79d3af04
* Tiger Lake: https://github.com/torvalds/linux/commit/ec65b56046d27a21a5ae02eb7fcb321e1942a541#diff-0cb73ca5571efd62ddd5a5fc79d3af04
Keep in mind that I lack the hardware to test these newer platforms, some of these haven't even been released.
Created attachment 208154 [details]
Dell Latitude Dell Latitude 5500 running FBSD 13 with ig4 patchset 2: dmesg+pciconf+/boot/loader.conf
I'm adding my dmesg and pciconf output in hopes they're useful. Touchpad is not currently functional on this computer with the ig4 patchset v. 2
(In reply to Rick Owens from comment #13)
> Touchpad is not currently functional on this computer with the ig4 patchset v. 2
It is not a driver for touchpad but for I2C controller.
You can find 2 different I2C touchpad drivers (with follow-up discussion) here: https://reviews.freebsd.org/D16698 and try them
Anyway, thanks for testing!
(In reply to Neel Chauhan from comment #12)
> some of these haven't even been released.
I am not sure if we should include support for non-released platforms.
But adding support of released ones is a good idea.
(In reply to Vladimir Kondratyev from comment #14)
Thank you, I'll check it out!
A commit references this bug:
Date: Sun Nov 3 21:16:07 UTC 2019
New revision: 354320
[ig4] Add support for CannonLake controllers
They are clocked at 216MHz rate, much higher than previous models.
Submitted by: Neel Chauhan <firstname.lastname@example.org>