From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965931AbbJ3Kkc (ORCPT ); Fri, 30 Oct 2015 06:40:32 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:49651 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758636AbbJ3Kk1 (ORCPT ); Fri, 30 Oct 2015 06:40:27 -0400 From: Arnd Bergmann To: Michael Welling Cc: Mark Brown , Dmitry Torokhov , kbuild test robot , kbuild-all@01.org, Tony Lindgren , Pavel Machek , Felipe Balbi , Sebastian Reichel , Roger Quadros , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH v3] Input: tsc2005 - Add support for tsc2004 Date: Fri, 30 Oct 2015 11:40:04 +0100 Message-ID: <5143701.zqn4HuBlp3@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151030010151.GA4196@qwerty.qwertyembedded> References: <1446077554-19684-1-git-send-email-mwelling@ieee.org> <20151030003905.GL28319@sirena.org.uk> <20151030010151.GA4196@qwerty.qwertyembedded> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:hOV+2bqD1nbhPPWc35tiAObbZhd63zuxIzozBaFmSm+I4xqX3iS h+rbXv14c9+TDtZEi8IKarXNlDZAi6Tu4TSBOs18BIDQ858rikKeGfzeHROym5BWzRypHwl xaKq3Kr4f0xEbt5dWakkb1QnGKnr2+fndU03PE2Wra02eLeyirnoDgA8wn9IHU0ND8aPXIY 1J2rqBKcvp66WY9/VH48w== X-UI-Out-Filterresults: notjunk:1;V01:K0:itllcDO/wK0=:tYvA3R6SrvZxyGIhhbH5Ug jSAtyw1I0SHuNk4xiPc/8Tb3LiBblVNUsGbL04xRXJ3JxU60JXhYNFQBfU823djQqJToZIF06 xfQLxdxbUv8Ps8DkBYs5zMcbWwXePxYHcggSgftqBAmtfVpvdtpiS+Z8i2DQNLhXI6hlOTM0H IZGmFv2EjzcYCT3B9nwND2P5gT5p0erSYWRy+qgpS3t+5Gi85AS66bDrWWK6RB0RoHez7iDwv up5A2pPhtzDAdIMaLBB5lFTZVGy6KRw04eHLDgFys9iyh2S+mOn7N7ewKjALeJaorKscRySbq X+RUfo41lO/xkIAHSCl1a/d54+aWd58XypEBYAz3ILWloHqzAIcBMRL3XMHOteh5oX9MY9fD5 083EH5z6jqTh5E9+GlHjLLar/U6hW3fvIu66cA+SMV/v+kYMm9HorUTTIlpogqEI7UoONWDzp SKsMgwtUFsdLOXPeJAydaTlzW+bo+7U5EhI8A7KB8KWCLgHjBfHKn9KvQcnnvA1Zd3BucjQsu xcpJiohHKNoi7sO1sC9YrEiHtbRfpcB9aqxFFMRRPUxMBTgu2wn5iHWtSeJvsBI26MJ0su5dw 53mb2D8juP3TOxe0FrXWbzx+WRtyeRD9aJhr78jSOaKcfm3xpfhvjq9KZWHwrrqWFgObrh+9p 4vJ2z0TNLDP8GwOPyy/Y4mxRzOX+T2crdc/5ooVwk80yttYibL/ndK/D2TL0oE+z4/tzIU1yw zvnUElMJjhdel7w2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 29 October 2015 20:01:51 Michael Welling wrote: > On Fri, Oct 30, 2015 at 09:39:05AM +0900, Mark Brown wrote: > > On Thu, Oct 29, 2015 at 03:23:31PM -0700, Dmitry Torokhov wrote: > > > > > However, you have regmap in the driver core already. Mark, is it > > > possible to have regmap API also allow doing raw underlying protocol > > > transfer so that consumers could issue command requests without needing > > > to know if they need to do it over i2c or spi or whatever. Or we need a > > > notion of command registers in regmap... > > > > I don't think it's a good idea to break the encapsulation of the regmap > > and export the raw I/O functionality directly, there seem to be more bad > > ways of using that than good. The driver must at some point know what > > bus it is dealing with and be able to manage this itself. > > > > I don't know what "command registers" are. > > With this device, if the MSB of the first byte of the transaction is 1 then > a convertor command is encoded in that byte instead of a register address. > > So here is my plan: > - Add a function pointer for tsc2005_cmd in the struct tsc2005 > - Put the spi and i2c tsc2005_cmd versions in their respective drivers > - Pass the cmd functions to the core via tsc200x_probe > > Any objections? Sounds good. If you end up needing more than one function pointer, better pass a 'const' pointer to a structure of function pointers that you can declare statically in the driver. > Other review suggestions before I code the revision? > Am I doing too much with a single patch? Yes. Please split out the DT binding changes into a separate patch, and start with one patch that just moves the common parts out of the SPI driver before you add the new driver. Arnd