From owner-freebsd-mobile@freebsd.org Wed Mar 9 01:32:08 2016 Return-Path: Delivered-To: freebsd-mobile@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C46AC8A0B for ; Wed, 9 Mar 2016 01:32:08 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 8407CD7F for ; Wed, 9 Mar 2016 01:32:08 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from [192.168.42.104] (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3F1D51C56 for ; Wed, 9 Mar 2016 01:32:08 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) From: "Jonathan Anderson" To: freebsd-mobile@freebsd.org Subject: HID over I2C Date: Tue, 08 Mar 2016 21:52:06 -0330 Message-ID: <0F2F1CD4-1327-4B72-BF6D-1358EEF03516@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailer: MailMate (1.9.3r5187) X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 01:32:08 -0000 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.htm= l [2] https://bugzilla.kernel.org/show_bug.cgi?id=3D108581 [3] = https://download.01.org/future-platform-configuration-hub/skylake/registe= r-definitions/332219-002.pdf -- Jonathan Anderson jonathan@FreeBSD.org