[PATCH v2 2/4] regmap: Allow providing read/write callbacks through struct regmap_config

Jean-Jacques Hiblot jjhiblot at ti.com
Mon Dec 16 11:09:57 CET 2019


Hi Simon,

On 10/12/2019 16:18, Simon Glass wrote:
> Hi Jean-Jacques,
>
> On Tue, 5 Nov 2019 at 04:47, Jean-Jacques Hiblot <jjhiblot at ti.com> wrote:
>> Some linux drivers provide their own read/write functions to access data
>> from/of the regmap. Adding support for it.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
>>
>> ---
>>
>> Changes in v2:
>> - Only use custom accessors if {,SPL,TPL}_REGMAP_ACCESSORS is enabled
>>
>>   drivers/core/Kconfig  | 25 +++++++++++++++++++++++++
>>   drivers/core/regmap.c | 22 ++++++++++++++++++++--
>>   include/regmap.h      | 28 +++++++++++++++++++++++++---
>>   3 files changed, 70 insertions(+), 5 deletions(-)
> Coming back to the discussion on driver model....
>
> How do you specify the fields? I would expect that this would be done
> in the driver tree? Perhaps in a subnode of the device?
>
> Just to state what I see as the advantages of using a separate device
> for access:
>
> - Remove the #ifdef in the regmap struct
> - Easy to specify the behaviour in a device-tree node
> - Easy to extend as the child device can do what it likes with respect to access

That sure is a better abstraction. However the goal of this patch is 
only to use the same API as linux. It allows porting the drivers as-is 
and thus reduce the burden of maintenance.

JJ

>
> Disadvantage is that it takes a bit more space.
>
> Regards,
> Simon


More information about the U-Boot mailing list