summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8962.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-25 01:07:55 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-25 01:19:45 +0400
commit182c51ce7944a214dd77a0b5c0462241e49dd418 (patch)
treebd7b6ab829a18932f2710992762fd129d17d6040 /sound/soc/codecs/wm8962.c
parent5509f2f80c711add6bbcec9af7f4bbba2e2cc22b (diff)
downloadlinux-182c51ce7944a214dd77a0b5c0462241e49dd418.tar.xz
ASoC: wm8962: Optimise power consumption for IN4 DC measurement usage
When the hardware is configured with one or both of the IN4 inputs used for DC measurement (with no DC blocking capacitor connected) then we can improve power consumption slightly in idle modes by applying a register write sequence. Provide platform data to enable this, implemented using a regmap patch. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8962.c')
-rw-r--r--sound/soc/codecs/wm8962.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index cc4049e9174b..2a654fd42d12 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3638,6 +3638,13 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8962 = {
.volatile_register = wm8962_soc_volatile,
};
+/* Improve power consumption for IN4 DC measurement mode */
+static const struct reg_default wm8962_dc_measure[] = {
+ { 0xfd, 0x1 },
+ { 0xcc, 0x40 },
+ { 0xfd, 0 },
+};
+
static const struct regmap_config wm8962_regmap = {
.reg_bits = 16,
.val_bits = 16,
@@ -3653,6 +3660,7 @@ static const struct regmap_config wm8962_regmap = {
static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
+ struct wm8962_pdata *pdata = dev_get_platdata(&i2c->dev);
struct wm8962_priv *wm8962;
unsigned int reg;
int ret, i;
@@ -3731,6 +3739,16 @@ static __devinit int wm8962_i2c_probe(struct i2c_client *i2c,
goto err_regmap;
}
+ if (pdata && pdata->in4_dc_measure) {
+ ret = regmap_register_patch(wm8962->regmap,
+ wm8962_dc_measure,
+ ARRAY_SIZE(wm8962_dc_measure));
+ if (ret != 0)
+ dev_err(&i2c->dev,
+ "Failed to configure for DC mesurement: %d\n",
+ ret);
+ }
+
regcache_cache_only(wm8962->regmap, true);
ret = snd_soc_register_codec(&i2c->dev,