ASoC: cs4271: flat regcache, trivial simplifications
authorAlexander Sverdlin <alexander.sverdlin@gmail.com>
Mon, 10 Apr 2023 22:39:01 +0000 (00:39 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 11 Apr 2023 11:37:16 +0000 (12:37 +0100)
- 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>
sound/soc/codecs/cs4271-i2c.c
sound/soc/codecs/cs4271-spi.c
sound/soc/codecs/cs4271.c

index 0e8a7cf0da50570b8b501533bda003f06bbb366b..4033be1c3bc1b63fb565a40022f25bfa174e1998 100644 (file)
@@ -17,7 +17,6 @@ static int cs4271_i2c_probe(struct i2c_client *client)
 
        config = cs4271_regmap_config;
        config.reg_bits = 8;
-       config.val_bits = 8;
 
        return cs4271_probe(&client->dev,
                            devm_regmap_init_i2c(client, &config));
index 7ef0a66b777893dd2eaeb9bf741f8863e4714052..4feb80436bd99b4c83e2084ebdd52bb1916c06dc 100644 (file)
@@ -17,7 +17,6 @@ static int cs4271_spi_probe(struct spi_device *spi)
 
        config = cs4271_regmap_config;
        config.reg_bits = 16;
-       config.val_bits = 8;
        config.read_flag_mask = 0x21;
        config.write_flag_mask = 0x20;
 
index 2021cf4426061ef7d8ced6f394c311dfcf1724b8..188b8b43c524f21fc9758877c459d8e149c8b7f9 100644 (file)
@@ -689,8 +689,8 @@ const struct regmap_config cs4271_regmap_config = {
 
        .reg_defaults = cs4271_reg_defaults,
        .num_reg_defaults = ARRAY_SIZE(cs4271_reg_defaults),
-       .cache_type = REGCACHE_RBTREE,
-
+       .cache_type = REGCACHE_FLAT,
+       .val_bits = 8,
        .volatile_reg = cs4271_volatile_reg,
 };
 EXPORT_SYMBOL_GPL(cs4271_regmap_config);