Commit cc28fb8e authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

ASoC: soc-cache: Add support for LZO register caching

This patch adds support for LZO compression when storing the register
cache.  The initial register defaults cache is marked as __devinitconst
and the only change required for a driver to use LZO compression is
to set the compress_type member in codec->driver to SND_SOC_LZO_COMPRESSION.

For a typical device whose register map would normally occupy 25kB or 50kB
by using the LZO compression technique, one can get down to ~5-7kB.  There
might be a performance penalty associated with each individual read/write
due to decompressing/compressing the underlying cache, however that should not
be noticeable.  These memory benefits depend on whether the target architecture
can get rid of the memory occupied by the original register defaults cache
which is marked as __devinitconst.  Nevertheless there will be some memory
gain even if the target architecture can't get rid of the original register
map, this should be around ~30-32kB instead of 50kB.
Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7a30a3db
...@@ -256,7 +256,8 @@ enum snd_soc_control_type { ...@@ -256,7 +256,8 @@ enum snd_soc_control_type {
}; };
enum snd_soc_compress_type { enum snd_soc_compress_type {
SND_SOC_NO_COMPRESSION SND_SOC_NO_COMPRESSION,
SND_SOC_LZO_COMPRESSION
}; };
int snd_soc_register_platform(struct device *dev, int snd_soc_register_platform(struct device *dev,
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
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
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment