diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2015-05-28 14:57:33 +0800 |
---|---|---|
committer | Shengjiu Wang <shengjiu.wang@freescale.com> | 2015-06-01 18:13:13 +0800 |
commit | 796665760605e020e6835f13db6ce49e0a0e03f5 (patch) | |
tree | e5c65dbec4434f08233edfaed17539062b48e012 /sound | |
parent | 4fdb40165706bba3de6aa47e6328136d1eb597fc (diff) |
MLK-10899: ASoC: si476x: add startup/shutdown to powerup/down FM
The hw parameter is set failed for si476x if si476x is not powerup,
the codec use the default value of this module. So add startup/shutdown
to powerup/powerdown FM, then we can set parameter successfully.
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/si476x.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sound/soc/codecs/si476x.c b/sound/soc/codecs/si476x.c index fa2b8e07f420..8dc9af9c5b2e 100644 --- a/sound/soc/codecs/si476x.c +++ b/sound/soc/codecs/si476x.c @@ -213,7 +213,26 @@ static int si476x_codec_probe(struct snd_soc_codec *codec) return snd_soc_codec_set_cache_io(codec, 0, 0, SND_SOC_REGMAP); } +static int si476x_codec_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { + struct si476x_core *core = i2c_mfd_cell_to_core(dai->dev); + + if (!si476x_core_is_powered_up(core)) + si476x_core_set_power_state(core, SI476X_POWER_UP_FULL); + return 0; +} + +static void si476x_codec_shutdown(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) { + struct si476x_core *core = i2c_mfd_cell_to_core(dai->dev); + + if (si476x_core_is_powered_up(core)) + si476x_core_set_power_state(core, SI476X_POWER_DOWN); +} + static struct snd_soc_dai_ops si476x_dai_ops = { + .startup = si476x_codec_startup, + .shutdown = si476x_codec_shutdown, .hw_params = si476x_codec_hw_params, .set_fmt = si476x_codec_set_dai_fmt, }; |