clk: versaclock: regmap modernisations
Subsystems (3)
cover clk: versaclock: regmap modernisations
The maple tree register cache is a more modern replacement for the rbtree cache which uses a more modern data structure and makes decisions likely to be better for more current hardware, update the versaclock drivers to use it.
While looking at updating the cache types I noticed a minor optimisation opportunity with a redundant _is_writeable() operation in versaclock3 so I updated that too.
---
Mark Brown (4):
clk: versaclock3: Remove redundant _is_writeable()
clk: versaclock3: Convert to use maple tree register cache
clk: versaclock5: Convert to use maple tree register cache
clk: versaclock7: Convert to use maple tree register cache
drivers/clk/clk-versaclock3.c | 8 +------- drivers/clk/clk-versaclock5.c | 2 +- drivers/clk/clk-versaclock7.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-)
---
base-commit: 6465e260f48790807eef06b583b38ca9789b6072
change-id: 20230929-clk-maple-versaclk-129fa4fb712f
Best regards,
Signature · 1 line
Mark Brown <[email protected]>
PATCH 1/4 clk: versaclock3: Remove redundant _is_writeable()
The versaclock3 driver provides an _is_writeable() function which returns true for all registers. This is the default assumption for regmaps so we can remove the function for a very minor improvement in performance and code size.
--- drivers/clk/clk-versaclock3.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/clk/clk-versaclock3.c +0 -6
@@ -586,17 +586,11 @@ static const struct clk_ops vc3_clk_mux_ops = { .get_parent = vc3_clk_mux_get_parent, }; -static bool vc3_regmap_is_writeable (struct device *dev,unsigned int reg) -{ -return true; -} -static const struct regmap_config vc3_regmap_config = { .reg_bits =8 , .val_bits =8 , .cache_type =REGCACHE_RBTREE , .max_register =0x24 , - .writeable_reg = vc3_regmap_is_writeable, };static struct vc3_hw_data clk_div[5 ];
Signature · 1 line
2.39.2
Re: [PATCH 1/4] clk: versaclock3: Remove redundant _is_writeable()
Quoting Mark Brown (2023-09-29 07:26:05)
Quoted 7 lines
The versaclock3 driver provides an
_is_writeable()function which returns true for all registers. This is the default assumption for regmaps so we can remove the function for a very minor improvement in performance and code size.Signed-off-by Mark Brown <[email protected]>---
Applied to clk-next
PATCH 2/4 clk: versaclock3: Convert to use maple tree register cache
In reply to Mark BrownThe maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
--- drivers/clk/clk-versaclock3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-versaclock3.c +1 -1
@@ -589,7 +589,7 @@ static const struct clk_ops vc3_clk_mux_ops = {static const struct regmap_config vc3_regmap_config = { .reg_bits =8 , .val_bits =8 , - .cache_type =REGCACHE_RBTREE , + .cache_type =REGCACHE_MAPLE , .max_register =0x24 , };
Signature · 1 line
2.39.2
Re: [PATCH 2/4] clk: versaclock3: Convert to use maple tree register cache
Quoting Mark Brown (2023-09-29 07:26:06)
Quoted 6 lines
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
Signed-off-by Mark Brown <[email protected]>---
Applied to clk-next
PATCH 3/4 clk: versaclock5: Convert to use maple tree register cache
In reply to Mark BrownThe maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
--- drivers/clk/clk-versaclock5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-versaclock5.c +1 -1
@@ -217,7 +217,7 @@ static bool vc5_regmap_is_writeable(struct device *dev, unsigned int reg)static const struct regmap_config vc5_regmap_config = { .reg_bits =8 , .val_bits =8 , - .cache_type =REGCACHE_RBTREE , + .cache_type =REGCACHE_MAPLE , .max_register =0x76 , .writeable_reg = vc5_regmap_is_writeable, };
Signature · 1 line
2.39.2
Re: [PATCH 3/4] clk: versaclock5: Convert to use maple tree register cache
Quoting Mark Brown (2023-09-29 07:26:07)
Quoted 6 lines
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
Signed-off-by Mark Brown <[email protected]>---
Applied to clk-next
PATCH 4/4 clk: versaclock7: Convert to use maple tree register cache
In reply to Mark BrownThe maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
--- drivers/clk/clk-versaclock7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-versaclock7.c +1 -1
@@ -1275,7 +1275,7 @@ static const struct regmap_config vc7_regmap_config = { .ranges = vc7_range_cfg, .num_ranges = ARRAY_SIZE(vc7_range_cfg), .volatile_reg = vc7_volatile_reg, - .cache_type = REGCACHE_RBTREE, + .cache_type = REGCACHE_MAPLE, .can_multi_write = true, .reg_format_endian = REGMAP_ENDIAN_LITTLE, .val_format_endian = REGMAP_ENDIAN_LITTLE,
Signature · 1 line
2.39.2
Re: [PATCH 4/4] clk: versaclock7: Convert to use maple tree register cache
Quoting Mark Brown (2023-09-29 07:26:08)
Quoted 6 lines
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache.
Signed-off-by Mark Brown <[email protected]>---
Applied to clk-next