From owner-freebsd-current@freebsd.org Mon Oct 10 20:02:39 2016 Return-Path: Delivered-To: freebsd-current@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 67452C0C2DF for ; Mon, 10 Oct 2016 20:02:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 7D124380; Mon, 10 Oct 2016 20:02:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA21457; Mon, 10 Oct 2016 23:02:36 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1btgmS-000FfU-1l; Mon, 10 Oct 2016 23:02:36 +0300 Subject: Re: [request for testing] isl, cyapa on chromebooks To: Michael Gmelin , Matthias Apitz References: <20161008180742.GA1912@c720-r292778-amd64> <846bf31f-a757-2be0-a293-8c4ce3d42a2f@FreeBSD.org> <20161009015324.007a7b42@bsd64.grem.de> <20161009065423.GA2012@c720-r292778-amd64> <23c6b4f0-77e9-fe90-0eed-9d0125e7624b@FreeBSD.org> <20161010134610.32120b55@bsd64.grem.de> <20161010182710.GA1956@c720-r292778-amd64> <63DC842D-48EC-4A5F-938F-AF8CE1E37BF8@freebsd.org> Cc: Warner Losh , FreeBSD Current From: Andriy Gapon Message-ID: Date: Mon, 10 Oct 2016 23:01:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <63DC842D-48EC-4A5F-938F-AF8CE1E37BF8@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 20:02:39 -0000 On 10/10/2016 21:45, Michael Gmelin wrote: > I see three tasks here: - Andriy finishes his change, moving things from > smbus to iicbus, adding some workaround to keep the user experience like it > is - Someone else implements the device table mechanism for auto detection - > Someone else ports HDI over I2C to allow implementing drivers for devices > like the elan touchpad Matthias is referring to > > Makes sense? It does to me. Also, I can suggest another task related to SMBus / I2C. Looking at the code in the Linux chromeos_laptop driver I see that on some models some sensors are actually attached to SMBus rather that to I2C. And, for example, cyapa can be attached to either bus. But there is a quirk. cyapa won't work over a standard SMBus, it needs some extensions that are typically provided by Intel chipsets. I specifically mean the so called "I2C Block Read" and the transaction that results from the Block Write command when the I2C bit is set in the SMBus controller's configuration register. Neither of these modes is supported by our ichsmb(4) driver. But on Linux they are both supported and exposed as I2C_SMBUS_I2C_BLOCK_DATA transaction type. For one reference please see Mobile 4th Generation IntelĀ® CoreTM Processor Family I/O Datasheet, section 5.21.1.1. And, just in case, ig4(4) is about the controllers described in section 5.22 of that document. Perhaps, I2C_SMBUS_I2C_BLOCK_DATA served as an inspiration (and perhaps a source of confusion) for Matt when he added smbus_trans(). Right now I do not have any good suggestion on how to expose that 90% SMBus, 10% I2C functionality in the FreeBSD model. -- Andriy Gapon