diff options
author | Zeng Zhaoming <b32542@freescale.com> | 2011-04-06 02:19:15 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-01-09 20:07:53 +0800 |
commit | 896bfe73122099f2e7b95e15a8c40fa23aca2ed1 (patch) | |
tree | cdeb3159803731a5b8576ed5eceeba1a55e3f8c2 /sound/soc/soc-core.c | |
parent | 30ffc95a3e9d95e42d10f1d08213ad7b10462266 (diff) |
ENGR00141647 AUDIO,SGTL5000: Fix codec error after reset
sgtl5000 codec not work after board reset, this is caused by
sgtl5000 using register address step is 2, and snd-soc-core can't
handle this as we expect, so we have to fill the register cache by
reading register out when initialization instead of providing a default
value array.
Signed-off-by: Zeng Zhaoming <b32542@freescale.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 493ae7c4c041..a04e003da973 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3762,13 +3762,16 @@ int snd_soc_register_codec(struct device *dev, * kernel might have freed the array by the time we initialize * the cache. */ - if (codec_drv->reg_cache_default) { - codec->reg_def_copy = kmemdup(codec_drv->reg_cache_default, - reg_size, GFP_KERNEL); - if (!codec->reg_def_copy) { - ret = -ENOMEM; - goto fail; - } + if (codec_drv->reg_cache_default) + codec->reg_def_copy = + kmemdup(codec_drv->reg_cache_default, + reg_size, GFP_KERNEL); + else + codec->reg_def_copy = kzalloc(reg_size, GFP_KERNEL); + + if (!codec->reg_def_copy) { + ret = -ENOMEM; + goto fail; } } |