Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: mt6311: Use REGCACHE_RBTREE

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>

authored by

Daniel Kurtz and committed by
Mark Brown
47769cbc 8005c49d

+1
+1
drivers/regulator/mt6311-regulator.c
··· 30 30 .reg_bits = 8, 31 31 .val_bits = 8, 32 32 .max_register = MT6311_FQMTR_CON4, 33 + .cache_type = REGCACHE_RBTREE, 33 34 }; 34 35 35 36 /* Default limits measured in millivolts and milliamps */