From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH v2 1/3] mfd: add support for Diolan DLN-2 devices Date: Tue, 2 Sep 2014 17:23:11 +0200 Message-ID: <20140902152311.GY4894@localhost> References: <20140901095127.GK7374@lee--X1> <20140901113949.GP7374@lee--X1> <20140901154626.GH8796@lee--X1> <20140901175453.GR4894@localhost> <20140902080010.GD17117@lee--X1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Octavian Purdila Cc: Lee Jones , Johan Hovold , Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org, Samuel Ortiz , Arnd Bergmann , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lkml , linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Daniel Baluta , Laurentiu Palcu List-Id: linux-gpio@vger.kernel.org On Tue, Sep 02, 2014 at 11:45:55AM +0300, Octavian Purdila wrote: > On Tue, Sep 2, 2014 at 11:00 AM, Lee Jones wrote: > > On Mon, 01 Sep 2014, Johan Hovold wrote: > >> I haven't looked at the details of the protocol for the device in > >> question, but it might even be possible to use regmap here (as I > >> mentioned in my comments on v1). > > > > Obviously that would be preferred. > > > > Octavian, did you look into that? > > > Yes, I did. Since this is the first time I am looking at regmap I may > be wrong but I don't see a way to use it. The dln2 i2c driver needs to > be able to send and receive arbitrary size buffers and this does not > seem possible to do with the regmap API. That should be possible using the regmap bus read and write operations. > (Also creating a regmap class for a particular device seems over > engineering since nobody else is going to use it) Possibly, but it would allow subdrivers to be implemented using a standard interface and also provide register caching for free. The event callbacks of the device in questions would not fit this scheme though, but perhaps only that part needs to be driver specific. Johan