Commit 96129a0e authored by Charles Keepax's avatar Charles Keepax Committed by Lee Jones

mfd: wm5110: Set DCVDD voltage to 1.175V before entering sleep mode

The low power sleep mode on wm5110 requires that the LDO1 regulator be
set to 1.175V prior to entering sleep, then returned to 1.2V after
exiting sleep mode. This patch apply these regulator settings.
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 882bc468
...@@ -478,6 +478,37 @@ static int arizona_runtime_resume(struct device *dev) ...@@ -478,6 +478,37 @@ static int arizona_runtime_resume(struct device *dev)
goto err; goto err;
} }
break; break;
case WM5110:
case WM8280:
ret = arizona_wait_for_boot(arizona);
if (ret)
goto err;
if (arizona->external_dcvdd) {
ret = regmap_update_bits(arizona->regmap,
ARIZONA_ISOLATION_CONTROL,
ARIZONA_ISOLATE_DCVDD1, 0);
if (ret) {
dev_err(arizona->dev,
"Failed to connect DCVDD: %d\n", ret);
goto err;
}
} else {
/*
* As this is only called for the internal regulator
* (where we know voltage ranges available) it is ok
* to request an exact range.
*/
ret = regulator_set_voltage(arizona->dcvdd,
1200000, 1200000);
if (ret < 0) {
dev_err(arizona->dev,
"Failed to set resume voltage: %d\n",
ret);
goto err;
}
}
break;
default: default:
ret = arizona_wait_for_boot(arizona); ret = arizona_wait_for_boot(arizona);
if (ret != 0) { if (ret != 0) {
...@@ -528,6 +559,27 @@ static int arizona_runtime_suspend(struct device *dev) ...@@ -528,6 +559,27 @@ static int arizona_runtime_suspend(struct device *dev)
ret); ret);
return ret; return ret;
} }
} else {
switch (arizona->type) {
case WM5110:
case WM8280:
/*
* As this is only called for the internal regulator
* (where we know voltage ranges available) it is ok
* to request an exact range.
*/
ret = regulator_set_voltage(arizona->dcvdd,
1175000, 1175000);
if (ret < 0) {
dev_err(arizona->dev,
"Failed to set suspend voltage: %d\n",
ret);
return ret;
}
break;
default:
break;
}
} }
regcache_cache_only(arizona->regmap, true); regcache_cache_only(arizona->regmap, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment