diff options
author | Manoj Gangwal <mgangwal@nvidia.com> | 2012-02-10 14:44:55 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-02-16 13:11:32 -0800 |
commit | 6229d0e30e50f54610726681cee1329e09856a51 (patch) | |
tree | b6f7d28c85ab2fd6b9a0a4f8797684a7d8303206 /sound | |
parent | a99c44e4c597baab1d0e5bdc7598f1fb927823ea (diff) |
asoc: codecs: Add Suspend/Resume support for ALC5640
- Added suspend/resume support for ALC5640
- Fix for I2S1 interface
Bug 936013
Change-Id: I60b0eb224e9475b722ecb9e2fb8bf0a6dae12767
Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com>
Reviewed-on: http://git-master/r/83058
Reviewed-by: Johnny Qiu <joqiu@nvidia.com>
Tested-by: Johnny Qiu <joqiu@nvidia.com>
Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/rt5640.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 040f866ade64..fdfa6b5f13e7 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -76,7 +76,7 @@ static struct rt5640_init_reg init_list[] = { {RT5640_SPO_R_MIXER , 0x2800},/* SPKVOLR -> SPORMIX */ /* {RT5640_SPO_L_MIXER , 0xb800},//DAC -> SPOLMIX */ /* {RT5640_SPO_R_MIXER , 0x1800},//DAC -> SPORMIX */ - {RT5640_I2S1_SDP , 0xD000},/*change IIS1 and IIS2 */ +/* {RT5640_I2S1_SDP , 0xD000},//change IIS1 and IIS2 */ /*record*/ {RT5640_IN1_IN2 , 0x5080},/*IN1 boost 40db & differential mode*/ {RT5640_IN3_IN4 , 0x0500},/*IN2 boost 40db & signal ended mode*/ @@ -2336,9 +2336,31 @@ static int rt5640_probe(struct snd_soc_codec *codec) static int rt5640_remove(struct snd_soc_codec *codec) { rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); + rt5640_reset(codec); + snd_soc_write(codec, RT5640_PWR_ANLG1, 0); + + return 0; +} +#ifdef CONFIG_PM +static int rt5640_suspend(struct snd_soc_codec *codec, pm_message_t state) +{ + rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); + snd_soc_write(codec, RT5640_PWR_ANLG1, 0); + return 0; } +static int rt5640_resume(struct snd_soc_codec *codec) +{ + rt5640_set_bias_level(codec, SND_SOC_BIAS_STANDBY); + + return 0; +} +#else +#define rt5640_suspend NULL +#define rt5640_resume NULL +#endif + #define RT5640_STEREO_RATES SNDRV_PCM_RATE_8000_96000 #define RT5640_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) @@ -2417,6 +2439,8 @@ struct snd_soc_dai_driver rt5640_dai[] = { static struct snd_soc_codec_driver soc_codec_dev_rt5640 = { .probe = rt5640_probe, .remove = rt5640_remove, + .suspend = rt5640_suspend, + .resume = rt5640_resume, .set_bias_level = rt5640_set_bias_level, .reg_cache_size = RT5640_VENDOR_ID2 + 1, .reg_word_size = sizeof(u16), |