From 3ff6aea3a3c67c17a4e9b8f92184e86e7e20cca6 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 2 Dec 2010 14:53:01 +0000 Subject: [PATCH] --- yaml --- r: 230338 b: refs/heads/master c: 23bbce34f47762ce944ea9b8b3b3e05e220c6a2e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/sound/soc.h | 1 + trunk/sound/soc/soc-cache.c | 4 ++-- trunk/sound/soc/soc-core.c | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 8f020325460c..5c282b02bca8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 676ad98a06a629e6273819a54b70f3987044b608 +refs/heads/master: 23bbce34f47762ce944ea9b8b3b3e05e220c6a2e diff --git a/trunk/include/sound/soc.h b/trunk/include/sound/soc.h index 714a70441bf2..586bfb99fedb 100644 --- a/trunk/include/sound/soc.h +++ b/trunk/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/trunk/sound/soc/soc-cache.c b/trunk/sound/soc/soc-cache.c index 78b25e8c03f6..cb58b11d4f47 100644 --- a/trunk/sound/soc/soc-cache.c +++ b/trunk/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/trunk/sound/soc/soc-core.c b/trunk/sound/soc/soc-core.c index 2b1fcae4131e..1fd1d1a62af1 100644 --- a/trunk/sound/soc/soc-core.c +++ b/trunk/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;