mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
regmap: Support paging for buses with reg_read()/reg_write()
We don't currently support paging for regmaps where the I/O happens through bus provided reg_read() and reg_write() operatons, we simply ignore the range since nothing is wired up properly. Wire things up. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230324-regmap-reg-read-write-page-v1-1-1fbc0dac67ae@kernel.org
This commit is contained in:
parent
2d38e8615a
commit
f18ee501e2
@ -1945,6 +1945,15 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg,
|
||||
unsigned int val)
|
||||
{
|
||||
struct regmap *map = context;
|
||||
struct regmap_range_node *range;
|
||||
int ret;
|
||||
|
||||
range = _regmap_range_lookup(map, reg);
|
||||
if (range) {
|
||||
ret = _regmap_select_page(map, ®, range, 1);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
reg = regmap_reg_addr(map, reg);
|
||||
return map->bus->reg_write(map->bus_context, reg, val);
|
||||
@ -2842,6 +2851,15 @@ static int _regmap_bus_reg_read(void *context, unsigned int reg,
|
||||
unsigned int *val)
|
||||
{
|
||||
struct regmap *map = context;
|
||||
struct regmap_range_node *range;
|
||||
int ret;
|
||||
|
||||
range = _regmap_range_lookup(map, reg);
|
||||
if (range) {
|
||||
ret = _regmap_select_page(map, ®, range, 1);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
reg = regmap_reg_addr(map, reg);
|
||||
return map->bus->reg_read(map->bus_context, reg, val);
|
||||
|
Loading…
x
Reference in New Issue
Block a user