Skip to content

Commit 434530f

Browse files
KanjiMonsterrkhuangtao
authored andcommitted
UPSTREAM: regmap: make LZO cache optional
Commit 2cbbb57 ("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). Change-Id: I38a5164c2169f889a10f6c47968c1dbd187c6725 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Tao Huang <huangtao@rock-chips.com> (cherry picked from commit 34a730aa74c7c743f4ca9635e0d0b2479d6ed53c)
1 parent 356bf4e commit 434530f

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

drivers/base/regmap/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
config REGMAP
66
default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
7+
select IRQ_DOMAIN if REGMAP_IRQ
8+
bool
9+
10+
config REGCACHE_COMPRESSED
711
select LZO_COMPRESS
812
select LZO_DECOMPRESS
9-
select IRQ_DOMAIN if REGMAP_IRQ
1013
bool
1114

1215
config REGMAP_AC97

drivers/base/regmap/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
CFLAGS_regmap.o := -I$(src)
33

44
obj-$(CONFIG_REGMAP) += regmap.o regcache.o
5-
obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-lzo.o regcache-flat.o
5+
obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
6+
obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
67
obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
78
obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
89
obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o

drivers/base/regmap/regcache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121

2222
static const struct regcache_ops *cache_types[] = {
2323
&regcache_rbtree_ops,
24+
#if IS_ENABLED(CONFIG_REGCHACHE_COMPRESSED)
2425
&regcache_lzo_ops,
26+
#endif
2527
&regcache_flat_ops,
2628
};
2729

0 commit comments

Comments
 (0)