aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-cache.c4
-rw-r--r--sound/soc/soc-core.c5
3 files changed, 8 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 714a704..586bfb9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -460,6 +460,7 @@ struct snd_soc_codec {
struct list_head list;
struct list_head card_list;
int num_dai;
+ enum snd_soc_compress_type compress_type;
/* runtime */
struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 78b25e8..cb58b11 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -1550,11 +1550,11 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
int i;
for (i = 0; i < ARRAY_SIZE(cache_types); ++i)
- if (cache_types[i].id == codec->driver->compress_type)
+ if (cache_types[i].id == codec->compress_type)
break;
if (i == ARRAY_SIZE(cache_types)) {
dev_err(codec->dev, "Could not match compress type: %d\n",
- codec->driver->compress_type);
+ codec->compress_type);
return -EINVAL;
}
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2b1fcae..1fd1d1a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3450,6 +3450,11 @@ int snd_soc_register_codec(struct device *dev,
return -ENOMEM;
}
+ if (codec_drv->compress_type)
+ codec->compress_type = codec_drv->compress_type;
+ else
+ codec->compress_type = SND_SOC_FLAT_COMPRESSION;
+
INIT_LIST_HEAD(&codec->dapm.widgets);
INIT_LIST_HEAD(&codec->dapm.paths);
codec->write = codec_drv->write;