ASoC: Make LZO cache compression optional

Make LZO cache compression optional as it pulls in the kernel wide LZO
implementation and rbtree compression is generally more efficient for
typical register maps, especially in terms of CPU performance.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Mark Brown 2010-12-21 17:19:56 +00:00
parent be4fcddd17
commit 68d44ee0bc
2 changed files with 19 additions and 2 deletions

View File

@ -4,8 +4,6 @@
menuconfig SND_SOC menuconfig SND_SOC
tristate "ALSA for SoC audio support" tristate "ALSA for SoC audio support"
select LZO_COMPRESS
select LZO_DECOMPRESS
select SND_PCM select SND_PCM
select AC97_BUS if SND_SOC_AC97_BUS select AC97_BUS if SND_SOC_AC97_BUS
select SND_JACK if INPUT=y || INPUT=SND select SND_JACK if INPUT=y || INPUT=SND
@ -22,6 +20,21 @@ menuconfig SND_SOC
if SND_SOC if SND_SOC
config SND_SOC_CACHE_LZO
bool "Support LZO compression for register caches"
select LZO_COMPRESS
select LZO_DECOMPRESS
---help---
Select this to enable LZO compression for register caches.
This will allow machine or CODEC drivers to compress register
caches in memory, reducing the memory consumption at the
expense of performance. If this is not present and is used
the system will fall back to uncompressed caches.
Usually it is safe to disable this option, where cache
compression in used the rbtree option will typically perform
better.
config SND_SOC_AC97_BUS config SND_SOC_AC97_BUS
bool bool

View File

@ -988,6 +988,7 @@ static int snd_soc_rbtree_cache_init(struct snd_soc_codec *codec)
return 0; return 0;
} }
#ifdef CONFIG_SND_SOC_CACHE_LZO
struct snd_soc_lzo_ctx { struct snd_soc_lzo_ctx {
void *wmem; void *wmem;
void *dst; void *dst;
@ -1399,6 +1400,7 @@ err_tofree:
} }
return ret; return ret;
} }
#endif
static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec) static int snd_soc_flat_cache_sync(struct snd_soc_codec *codec)
{ {
@ -1541,6 +1543,7 @@ static const struct snd_soc_cache_ops cache_types[] = {
.write = snd_soc_flat_cache_write, .write = snd_soc_flat_cache_write,
.sync = snd_soc_flat_cache_sync .sync = snd_soc_flat_cache_sync
}, },
#ifdef CONFIG_SND_SOC_CACHE_LZO
{ {
.id = SND_SOC_LZO_COMPRESSION, .id = SND_SOC_LZO_COMPRESSION,
.name = "LZO", .name = "LZO",
@ -1550,6 +1553,7 @@ static const struct snd_soc_cache_ops cache_types[] = {
.write = snd_soc_lzo_cache_write, .write = snd_soc_lzo_cache_write,
.sync = snd_soc_lzo_cache_sync .sync = snd_soc_lzo_cache_sync
}, },
#endif
{ {
.id = SND_SOC_RBTREE_COMPRESSION, .id = SND_SOC_RBTREE_COMPRESSION,
.name = "rbtree", .name = "rbtree",