diff options
-rw-r--r-- | include/sound/soc.h | 1 | ||||
-rw-r--r-- | sound/soc/soc-cache.c | 4 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 714a70441bf2..586bfb99fedb 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -460,6 +460,7 @@ struct snd_soc_codec { | |||
460 | struct list_head list; | 460 | struct list_head list; |
461 | struct list_head card_list; | 461 | struct list_head card_list; |
462 | int num_dai; | 462 | int num_dai; |
463 | enum snd_soc_compress_type compress_type; | ||
463 | 464 | ||
464 | /* runtime */ | 465 | /* runtime */ |
465 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ | 466 | struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */ |
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 78b25e8c03f6..cb58b11d4f47 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) | |||
1550 | int i; | 1550 | int i; |
1551 | 1551 | ||
1552 | for (i = 0; i < ARRAY_SIZE(cache_types); ++i) | 1552 | for (i = 0; i < ARRAY_SIZE(cache_types); ++i) |
1553 | if (cache_types[i].id == codec->driver->compress_type) | 1553 | if (cache_types[i].id == codec->compress_type) |
1554 | break; | 1554 | break; |
1555 | if (i == ARRAY_SIZE(cache_types)) { | 1555 | if (i == ARRAY_SIZE(cache_types)) { |
1556 | dev_err(codec->dev, "Could not match compress type: %d\n", | 1556 | dev_err(codec->dev, "Could not match compress type: %d\n", |
1557 | codec->driver->compress_type); | 1557 | codec->compress_type); |
1558 | return -EINVAL; | 1558 | return -EINVAL; |
1559 | } | 1559 | } |
1560 | 1560 | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 2b1fcae4131e..1fd1d1a62af1 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, | |||
3450 | return -ENOMEM; | 3450 | return -ENOMEM; |
3451 | } | 3451 | } |
3452 | 3452 | ||
3453 | if (codec_drv->compress_type) | ||
3454 | codec->compress_type = codec_drv->compress_type; | ||
3455 | else | ||
3456 | codec->compress_type = SND_SOC_FLAT_COMPRESSION; | ||
3457 | |||
3453 | INIT_LIST_HEAD(&codec->dapm.widgets); | 3458 | INIT_LIST_HEAD(&codec->dapm.widgets); |
3454 | INIT_LIST_HEAD(&codec->dapm.paths); | 3459 | INIT_LIST_HEAD(&codec->dapm.paths); |
3455 | codec->write = codec_drv->write; | 3460 | codec->write = codec_drv->write; |