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

Simon Glass sjg at chromium.org
Tue Dec 10 16:18:20 CET 2019


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

Disadvantage is that it takes a bit more space.

Regards,
Simon


More information about the U-Boot mailing list