return regcache_get_val(map, rbnode->block, idx);
}
+static const void *regcache_rbtree_get_reg_addr(struct regmap *map,
+ struct regcache_rbtree_node *rbnode, unsigned int idx)
+{
+ return regcache_get_val_addr(map, rbnode->block, idx);
+}
+
static void regcache_rbtree_set_register(struct regmap *map,
struct regcache_rbtree_node *rbnode,
unsigned int idx, unsigned int val)
struct regcache_rbtree_node *rbnode;
unsigned int regtmp;
unsigned int val;
+ const void *addr;
int ret;
int i, base, end;
continue;
map->cache_bypass = 1;
- ret = _regmap_write(map, regtmp, val);
+
+ if (regmap_can_raw_write(map)) {
+ addr = regcache_rbtree_get_reg_addr(map,
+ rbnode, i);
+ ret = _regmap_raw_write(map, regtmp, addr,
+ map->format.val_bytes,
+ false);
+ } else {
+ ret = _regmap_write(map, regtmp, val);
+ }
+
map->cache_bypass = 0;
if (ret)
return ret;