Skip to content

Commit

Permalink
ASoC: rt5640: enable MCLK detection
Browse files Browse the repository at this point in the history
There is a power saving mechanism in rt5640. 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>
  • Loading branch information
Bard Liao authored and Mark Brown committed Oct 24, 2016
1 parent 1001354 commit 25fb706
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/codecs/rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -2407,6 +2407,9 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
if (ret != 0)
dev_warn(&i2c->dev, "Failed to apply regmap patch: %d\n", ret);

regmap_update_bits(rt5640->regmap, RT5640_DUMMY1,
RT5640_MCLK_DET, RT5640_MCLK_DET);

if (rt5640->pdata.in1_diff)
regmap_update_bits(rt5640->regmap, RT5640_IN1_IN2,
RT5640_IN_DF1, RT5640_IN_DF1);
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/codecs/rt5640.h
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,8 @@
#define RT5640_ZCD_HP_DIS (0x0 << 15)
#define RT5640_ZCD_HP_EN (0x1 << 15)

/* General Control 1 (0xfa) */
#define RT5640_MCLK_DET (0x1 << 11)

/* Codec Private Register definition */
/* 3D Speaker Control (0x63) */
Expand Down

0 comments on commit 25fb706

Please sign in to comment.