HID over I2C

Jonathan Anderson jonathan at FreeBSD.org
Wed Mar 9 01:32:08 UTC 2016


Hi all,

I have a shiny new notebook to run FreeBSD on (the ASUS Zenbook 
UX305CA). I wasn't expecting accelerated graphics to work, so I'm happy 
enough to get the native HD resolution with the scfb driver. The 
wireless mostly works, too, with one known caveat [1] that isn't too 
annoying. However, of all things, the touchpad doesn't work!

It turns out that this notebook's touchpad is connected using HID over 
I2C. This seems to be a pattern of increasing prevalence, so I'm hoping 
that FreeBSD either has some support for it or else somebody is working 
on it. However, besides the HID-over-I2C bit, I also need updated I2C 
parts.

I see that FreeBSD has the 'ig4' module (imported from Dragonfly) for 
Haswell I2C, but I believe that there are some further changes with 
Skylake (at least the Linux folks needed some changes [2]). I'm slightly 
confused about the difference between SMBus and I2C... I believe they're 
compatible, but they seem to be exposed as difference PCI devices [3]. 
Is this because one is used with host-as-master only and the other 
supports the multi-master mode for async transfer? I've tried simple 
things like adding the Skylake PCI IDs to `ichsmb`, which causes a 
`/dev/smb0` to be created, but when I try to use `consolehm` I get lots 
of "Device not configured" errors. At any rate, it seems like I need to 
be worried about I2C and not SMBus.

So, I really have two questions for the list:

1. Where is the right place to make I2C changes?

We have the 'ig4' module for the fourth-generation Intel PCH... are we 
going to go down the road of creating an 'ig5', 'ig6', etc.? Should 
'ig4' be renamed to align with its path in the source tree 
('sys/dev/ichiic') and be extended to support more recent generations of 
hardware too?

2. What else is required to support HID over I2C?

Once I have a working Skylake I2C bus, how do I connect an input device 
to it? We have code for dealing with HID over USB, but that seems pretty 
tied into USB ('sys/dev/usb/input/uhid.c' and 'sys/dev/usb/usb_hid.c'). 
Now, it's only ~1500 lines of code, so it mightn't be too hard to 
re-implement the protocol, but ideally one wouldn't have to. If the 
touchpad can be exposed directly as a device, can X itself speak the HID 
protocol? Alternatively, if we get I2C working correctly, will psm 
magically start to work with the touchpad?

Thanks for your patience,


Jon

[1] 
http://lists.freebsd.org/pipermail/freebsd-wireless/2016-March/006530.html
[2] https://bugzilla.kernel.org/show_bug.cgi?id=108581
[3] 
https://download.01.org/future-platform-configuration-hub/skylake/register-definitions/332219-002.pdf

--
Jonathan Anderson
jonathan at FreeBSD.org


More information about the freebsd-mobile mailing list