From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758763AbdADJ1N (ORCPT ); Wed, 4 Jan 2017 04:27:13 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:32920 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965582AbdADJ1H (ORCPT ); Wed, 4 Jan 2017 04:27:07 -0500 Date: Wed, 4 Jan 2017 10:25:39 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Benjamin Tissoires Cc: Dmitry Torokhov , =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= , Jean Delvare , Wolfram Sang , Steven Honeyman , Valdis.Kletnieks@vt.edu, Jochen Eisinger , Gabriele Mazzotta , Andy Lutomirski , Mario_Limonciello@dell.com, Alex Hung , Takashi Iwai , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH] i2c: i801: Register optional lis3lv02d i2c device on Dell machines Message-ID: <20170104092539.GC3499@pali> References: <1482843136-12838-1-git-send-email-pali.rohar@gmail.com> <20170103090641.GH5767@mail.corp.redhat.com> <20170103183843.GA16032@dtor-ws> <201701031950.17389@pali> <20170103194812.GD16032@dtor-ws> <20170103212934.GK5767@mail.corp.redhat.com> <20170104063642.GA20545@dtor-ws> <20170104091338.GO5767@mail.corp.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170104091338.GO5767@mail.corp.redhat.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 04 January 2017 10:13:38 Benjamin Tissoires wrote: > On Jan 03 2017 or thereabouts, Dmitry Torokhov wrote: > > On Tue, Jan 03, 2017 at 10:29:34PM +0100, Benjamin Tissoires wrote: > > > On Jan 03 2017 or thereabouts, Dmitry Torokhov wrote: > > > > > > > Yet another option: can we add a new flag to i2c_board_info controlling > > > > whether we want to enable/disable wiring up host notify interrupt? > > > > > > That should be fairly easy to implement. For now, given that only Elan > > > and Synaptics are the one in need for Host Notify, it could be better to > > > request the Host Notify IRQ instead of disabling it unconditionally > > > (which would make the current yet 8 years old lis3lv02d driver happy > > > again). > > > > I like that we have it done in i2c core instead of having drivers > > implementing it individually. Since you are saying that handling host > > notify is property of the slave/driver maybe we should be adding a flag > > to the *i2c_driver* structure to let i2c core that we want to have host > > notify mapped as interrupt if "native" interrupt is not supplied by the > > platform code? > > I don't think this is a good idea. It's still a property of the I2C > device, not the driver. It's crappy under Windows, but that doesn't > prevent us to do the right thing. > > I think the idea of having it at the i2c_board_info level is the good > one. It's a property of the device node and it wouldn't hurt me to have > a device tree property for that too (not entering the DT field now). > There is no ACPI prop for it too, but I wouldn't be surprised if it > comes in a later revision. The advantage of having it turned on > unconditionally is that we can instantiate it from userspace without > breaking the sysfs ABI. > > Note that in the 2 uses I have seen so far of Host Notify, in both cases > I need to instantiate the I2C device from an other driver (psmouse) so I > can control the content of i2c_board_info. If I understand it correctly, there is problem that i2c lis3lv02d driver needs to get IRQ number for freefall and in current structure you pass host notify IRQ number. It means that one property in lis3lv02d driver is used for two things: free fall IRQ and host notify IRQ. So the only way how to fix it is to use two different IRQ properties. Probably free fall IRQ is lis3lv02d specific and should be in platform data structure, not in generic i2c_board_info shared across all i2c drivers? -- Pali Rohár pali.rohar@gmail.com