diff mbox series

ASoC: rt715: Use maple tree register cache

Message ID 20230412-asoc-rt715-maple-v1-1-200a84835fde@kernel.org (mailing list archive)
State Accepted
Commit 50f655429957702302c91835d84a03b9672862c2
Headers show
Series ASoC: rt715: Use maple tree register cache | expand

Commit Message

Mark Brown April 21, 2023, 4:35 p.m. UTC
regmap has introduced a maple tree based register cache which makes use of
this more advanced data structure which has been added to the kernel
recently. Maple trees are much flatter than rbtrees, meaning that they do
not grow to such depths when the register map is sparse which makes access
a bit more efficient. The maple tree cache type is still a bit of a work
in progress but should be effective for some devices already.

RT715 seems like a good candidate for maple tree. It is a SoundWire MBQ
device and therefore supports only single register read/write operations
which do not use raw I/O and will therefore save the cost of converting
to and from device native format when accessing the cache while not having
a negative impact from the current lack of bulk operations in maple tree
cache sync. It has a moderately large and quite sparse register map which
is a good fit for storing in a maple tree.

Convert to use maple tree. There should be little if any visible difference
at runtime.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt715-sdw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: f033c26de5a5734625d2dd1dc196745fae186f1b
change-id: 20230412-asoc-rt715-maple-185f657063f4

Best regards,
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt715-sdw.c b/sound/soc/codecs/rt715-sdw.c
index 4e61e16470ed..5ffe9a00dfd8 100644
--- a/sound/soc/codecs/rt715-sdw.c
+++ b/sound/soc/codecs/rt715-sdw.c
@@ -354,7 +354,7 @@  static const struct regmap_config rt715_regmap = {
 	.max_register = 0x752039, /* Maximum number of register */
 	.reg_defaults = rt715_reg_defaults, /* Defaults */
 	.num_reg_defaults = ARRAY_SIZE(rt715_reg_defaults),
-	.cache_type = REGCACHE_RBTREE,
+	.cache_type = REGCACHE_MAPLE,
 	.use_single_read = true,
 	.use_single_write = true,
 	.reg_read = rt715_sdw_read,