Oct 7 2019
This driver still has some advantages over mine. It supports 12.0-release, sysmouse(8) protocol and it does not require ig4 patching. So, I would prefer it for non-HID trackpads like some Synaptics models. Al least for now.
Thanks for the remarks. I'd suggest to stop riding a dead horse and make the switch altogether. It has been pointed out previously that the separation of ACPI and HID over I2C code like it was done here, especially the interrupt handling, was ill-conceived.
Abstraction of HID code was initially considered, but not implemented on my part. Since wulf has already done these things and even has the multitouch part working, switching over is the most sensible thing. This code here was intended to be a first draft and has served its purpose.
So with the suggested changes, I'm not able to get very far with the patches in this review. With wulf's code I'm able to get the device probed. With this code, I see the following:
Sep 29 2019
kernel trap 22 with interrupts disabled
panic: spin locks can only use msleep_spin
cpuid = 7 time = 1569790352
KDB: stack backtrace:
#0 0xffffffff805da3fd at kdb_backtrace+0x6d
#1 0xffffffff80594fed at vpanic+0x19d
#2 0xffffffff80594e43 at panic+0x43
#3 0xffffffff8057df32 at unlock_spin+0x12
#4 0xffffffff8053f577 at _cv_wait_sig+0x127
#5 0xffffffff81d1dace at iichid_read+0x8e
#6 0xffffffff804b690a at devfs_read_f+0xda
#7 0xffffffff805f4752 at kern_readv+0x92
#8 0xffffffff805f46b4 at sys_read+0x84
#9 0xffffffff808451d8 at amd64_syscall+0x218
#10 0xffffffff80821270 at fast_syscall_common+0x101
Panic on kldload acpi_iichid in iichid_read()->cv_wait_sig().
FreeBSD 12.1 amd64 @ Asus 505z
Aug 25 2019
I built this on -current and got an insta-panic when trying to lock a null spin lock in attach...
Aug 23 2019
iichid device is a child of acpi bus also, so it can be rephrased as "how to get the acpi stuff to automatically add acpi device with given CID"
(3) How to cope with resume and resets not being quite right for the ig4.
It is not clear which reset is mentioned:
- IG4 controller reset (set designware specific parameters like timing counters and so on)
- iicbus reset - FIFO flushing, setting of symbol speed and slave address
- I2C hid device reset - performed with special I2C command
If it is mentioned in context of @johalun suspend/resume patch, then most probably it misses iicbus reset as it is performed by ig4 driver in a lazy way at a start of next xfer. sc->slave_valid bool variable should be reset to trigger it and I do not see that in @johalun resume method.
Would we make better progress with we split those three issues up into their own reviews?
Aug 22 2019
Aug 12 2019
I wrote iicbus(4) extension which performs ACPI-based enumeration of I2C devices connected to a controller. It is not limited to HID devices and fires at iicbus attach stage.
Jul 29 2019
try to replace 'IG4_CTL_SPEED_STD' string in /usr/src/sys/dev/ichiic/ig4_iic.c file with digit '6' than rebuild and reload ig4.ko .
Jul 28 2019
Updated D16698 builds and runs fine on 12-STABLE though it still lacks resume support.
Jul 27 2019
Jul 23 2019
Jul 22 2019
I enabled debugging output in imt.c so please:
Jul 21 2019
I fixed one bug, so try one more time
it generates nothing with libinput debug-events, and no events in xev.
libinput debug-events is not the right tool to debug evdev. evemu-record from devel/evemu port is better
That is expected as it ignored any touchpads
Jul 20 2019
Jul 19 2019
just unpack it at your $HOME. Than
make && sudo kldload ./iichid.ko
leaving all other modules built from the source of this thread?
drivers from this review should be at least unloaded from kernel. There is no need to revert D16698 patch. Just don't try to kldload both modules in between reboots.
Should I remove evdev support from the kernel?
No need. It links with evdev unconditionally
Can you please share your xorg configuration?
I do not have any specific xorg.conf options. Any evdev-awared autoconfiguration backend should work out of box. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196678 for example.
Jul 18 2019
OS driver or userland applications just do not have enough information as finger coords or count to support doublefinger scroll or multifinger taps.
I wrote a simple util to dump report descriptor from I2C HID device.
It accepts 3 input parameters: iic device path, i2c bus address and i2c HID register and prints report descriptor of given I2C device on stdout. This report descriptor can be further analyzed with any tool (e.g. web-based http://eleccelerator.com/usbdescreqparser/) to examine HID device capabilities.
hm. EVDEV_SUPPORT enables evdev in "legacy" drivers like psm, ums, ukbd etc. I'm not sure why @johalun added ifdefs for that here, this is a new driver :)