提交 34a730aa 编写于 作者: J Jonas Gorski 提交者: Mark Brown

regmap: make LZO cache optional

Commit 2cbbb579 ("regmap: Add the LZO cache support") added support
for LZO compression in regcache, but there were never any users added
afterwards. Since LZO support itself has its own size, it currently is
rather a deoptimization.

So make it optional by introducing a symbol that can be selected by
drivers wanting to make use of it.

Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).
Signed-off-by: NJonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 2ea659a9
...@@ -4,9 +4,12 @@ ...@@ -4,9 +4,12 @@
config REGMAP config REGMAP
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ) default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
select IRQ_DOMAIN if REGMAP_IRQ
bool
config REGCACHE_COMPRESSED
select LZO_COMPRESS select LZO_COMPRESS
select LZO_DECOMPRESS select LZO_DECOMPRESS
select IRQ_DOMAIN if REGMAP_IRQ
bool bool
config REGMAP_AC97 config REGMAP_AC97
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
CFLAGS_regmap.o := -I$(src) CFLAGS_regmap.o := -I$(src)
obj-$(CONFIG_REGMAP) += regmap.o regcache.o obj-$(CONFIG_REGMAP) += regmap.o regcache.o
obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
static const struct regcache_ops *cache_types[] = { static const struct regcache_ops *cache_types[] = {
&regcache_rbtree_ops, &regcache_rbtree_ops,
#if IS_ENABLED(CONFIG_REGCHACHE_COMPRESSED)
&regcache_lzo_ops, &regcache_lzo_ops,
#endif
&regcache_flat_ops, &regcache_flat_ops,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册