Skip to content

Commit

Permalink
regulator: mt6311: Use REGCACHE_RBTREE
Browse files Browse the repository at this point in the history
This regulator is on a slow i2c bus.  Register accesses are very simple,
they all either enable/disable a regulator channel, or select a new
voltage level.  Thus, reading registers from the device will always
return what was last written.

Therefore we can save a lot of time when reading registers by using a
regmap_cache.  Since the register map is relatively large, but we only
ever access a few of them, we use an RBTREE cache.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Henry Chen <henryc.chen@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Daniel Kurtz authored and Mark Brown committed Dec 18, 2015
1 parent 8005c49 commit 47769cb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/regulator/mt6311-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static const struct regmap_config mt6311_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = MT6311_FQMTR_CON4,
.cache_type = REGCACHE_RBTREE,
};

/* Default limits measured in millivolts and milliamps */
Expand Down

0 comments on commit 47769cb

Please sign in to comment.