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

ASoC: cs4271: flat regcache, trivial simplifications

- Switch to REGCACHE_FLAT, the whole overhead of RBTREE is not worth it
with non sparse register set in the address range 1..7.
- Move register width to central location

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20230410223902.2321834-3-alexander.sverdlin@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Alexander Sverdlin and committed by
Mark Brown
2e9688c8 80f47122

+2 -4
-1
sound/soc/codecs/cs4271-i2c.c
··· 17 17 18 18 config = cs4271_regmap_config; 19 19 config.reg_bits = 8; 20 - config.val_bits = 8; 21 20 22 21 return cs4271_probe(&client->dev, 23 22 devm_regmap_init_i2c(client, &config));
-1
sound/soc/codecs/cs4271-spi.c
··· 17 17 18 18 config = cs4271_regmap_config; 19 19 config.reg_bits = 16; 20 - config.val_bits = 8; 21 20 config.read_flag_mask = 0x21; 22 21 config.write_flag_mask = 0x20; 23 22
+2 -2
sound/soc/codecs/cs4271.c
··· 689 689 690 690 .reg_defaults = cs4271_reg_defaults, 691 691 .num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults), 692 - .cache_type = REGCACHE_RBTREE, 693 - 692 + .cache_type = REGCACHE_FLAT, 693 + .val_bits = 8, 694 694 .volatile_reg = cs4271_volatile_reg, 695 695 }; 696 696 EXPORT_SYMBOL_GPL(cs4271_regmap_config);