Re: [PATCH] [RFC] regmap: Add no-"bus" configuration possibility

From: Mark Brown
Date: Tue Nov 20 2012 - 06:08:42 EST


On Sat, Nov 03, 2012 at 05:18:17PM -0700, Andrey Smirnov wrote:

Sorry about the delay - like I say the patch was unfortunately sent
during ELC-E.

> This patch adds two callbacks to the 'regmap' configuration which user
> is expected to set with their implementation of read and write
> functionality for the device.

So, this is where I think we want to end up but a couple of high level
issues I'm seeing, both fairly easy to deal with I suspect.

> + int (*nbstr_read)(void *context, unsigned int reg, unsigned int *val);
> + int (*nbstr_write)(void *context, unsigned int reg, unsigned int val);

One issue is that I find the 'nbstr' name totally unparasable. It looks
like some sort of string or something. Just call the ops reg_ and have
done with it I think...

The other is that rather than have special cases for this I think what
we should be doing is refactoring the code so that the existing bus
based I/O fills in these ops. That will keep the code more maintainable
in the long run since there won't be magic special cases that don't get
much testing or can be missed when doing updates.

Attachment: signature.asc
Description: Digital signature