[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE1zotLnBZ83O23kaDz_xVhhSpPW6YyOQmkaTfZaicmf6MfOdQ@mail.gmail.com>
Date: Wed, 3 Sep 2014 16:39:48 +0300
From: Octavian Purdila <octavian.purdila@...el.com>
To: Johan Hovold <johan@...nel.org>
Cc: Lee Jones <lee.jones@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>, wsa@...-dreams.de,
Samuel Ortiz <sameo@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>, linux-usb@...r.kernel.org,
lkml <linux-kernel@...r.kernel.org>, linux-gpio@...r.kernel.org,
linux-i2c@...r.kernel.org, Daniel Baluta <daniel.baluta@...el.com>,
Laurentiu Palcu <laurentiu.palcu@...el.com>
Subject: Re: [PATCH v2 1/3] mfd: add support for Diolan DLN-2 devices
On Tue, Sep 2, 2014 at 6:23 PM, Johan Hovold <johan@...nel.org> wrote:
> On Tue, Sep 02, 2014 at 11:45:55AM +0300, Octavian Purdila wrote:
>> On Tue, Sep 2, 2014 at 11:00 AM, Lee Jones <lee.jones@...aro.org> 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.
I took a closer look on the regmap bus read/write operations and I
think they are not fit for what we need in the driver. The driver uses
a request/response model which, IMHO, does not fit well with a
register read/write API. Yes, maybe we can emulate it, but why do
that?
>> (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.
>
Using a standard interface is nice, but I think that using the right
interface type is more important. This hardware does not use registers
but a messages to communicate with the OS.
Also caching is not useful for i2c and only partially useful for GPIO
(to cache the pin direction, and pin status in output mode only) so
its not a big win.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists