]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: rt5660: enable MCLK detection
authorBard Liao <bardliao@realtek.com>
Thu, 20 Oct 2016 02:13:44 +0000 (10:13 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 24 Oct 2016 17:03:14 +0000 (18:03 +0100)
There is a power saving mechanism in rt5660. It will turn off some
unused power when MCLK is not present. We call that "MCLK detection"
and it should be enabled by default.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5660.c
sound/soc/codecs/rt5660.h

index 9f0933ced8049fa8c9d6be0b8d65491662988cc8..76cf76a2e9b6d1865c18da567d18c58b6f1880ad 100644 (file)
@@ -1311,6 +1311,10 @@ static int rt5660_i2c_probe(struct i2c_client *i2c,
        if (ret != 0)
                dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret);
 
+       regmap_update_bits(rt5660->regmap, RT5660_GEN_CTRL1,
+               RT5660_AUTO_DIS_AMP | RT5660_MCLK_DET | RT5660_POW_CLKDET,
+               RT5660_AUTO_DIS_AMP | RT5660_MCLK_DET | RT5660_POW_CLKDET);
+
        if (rt5660->pdata.dmic1_data_pin) {
                regmap_update_bits(rt5660->regmap, RT5660_GPIO_CTRL1,
                        RT5660_GP1_PIN_MASK, RT5660_GP1_PIN_DMIC1_SCL);
index 6cdb9269ec9e0fb3d8a781a689dc1f65b4b0116e..bba18fb66b6f7685dc883c4671c416e2bed7d0f1 100644 (file)
 /* General Control 1 (0xfa) */
 #define RT5660_PWR_VREF_HP                     (0x1 << 11)
 #define RT5660_PWR_VREF_HP_SFT                 11
+#define RT5660_AUTO_DIS_AMP                    (0x1 << 6)
+#define RT5660_MCLK_DET                                (0x1 << 5)
+#define RT5660_POW_CLKDET                      (0x1 << 1)
 #define RT5660_DIG_GATE_CTRL                   (0x1)
 #define RT5660_DIG_GATE_CTRL_SFT               0