diff options
author | John Hsu <KCHSU0@nuvoton.com> | 2016-03-22 11:57:05 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-05-30 16:17:44 +0100 |
commit | 3a56103534cd4f700274224f4c249eafa74daa4b (patch) | |
tree | 6eb8d39606d8295bf774baad0944c83718d211d2 /sound/soc/codecs/nau8825.c | |
parent | 407c71b69850aa789c70f7f7e54244739983d8d2 (diff) | |
download | linux-3a56103534cd4f700274224f4c249eafa74daa4b.tar.bz2 |
ASoC: nau8825: reduce standby power consumption
Decrease internal clock frequency for power saving when standby.
But clock divider needs restore when MCLK as system clock in playback.
Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/nau8825.c')
-rw-r--r-- | sound/soc/codecs/nau8825.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index cb08a358b2a3..1269fbbb2bac 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -1132,6 +1132,9 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id, regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, NAU8825_CLK_SRC_MASK, NAU8825_CLK_SRC_MCLK); regmap_update_bits(regmap, NAU8825_REG_FLL6, NAU8825_DCO_EN, 0); + /* MCLK not changed by clock tree */ + regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, + NAU8825_CLK_MCLK_SRC_MASK, 0); ret = nau8825_mclk_prepare(nau8825, freq); if (ret) return ret; @@ -1142,6 +1145,13 @@ static int nau8825_configure_sysclk(struct nau8825 *nau8825, int clk_id, NAU8825_DCO_EN); regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, NAU8825_CLK_SRC_MASK, NAU8825_CLK_SRC_VCO); + /* Decrease the VCO frequency for power saving */ + regmap_update_bits(regmap, NAU8825_REG_CLK_DIVIDER, + NAU8825_CLK_MCLK_SRC_MASK, 0xf); + regmap_update_bits(regmap, NAU8825_REG_FLL1, + NAU8825_FLL_RATIO_MASK, 0x10); + regmap_update_bits(regmap, NAU8825_REG_FLL6, + NAU8825_SDM_EN, NAU8825_SDM_EN); if (nau8825->mclk_freq) { clk_disable_unprepare(nau8825->mclk); nau8825->mclk_freq = 0; |