diff options
author | Christoph Muellner <christoph.muellner@theobroma-systems.com> | 2017-02-24 11:48:23 +0100 |
---|---|---|
committer | Christoph Muellner <christoph.muellner@theobroma-systems.com> | 2017-03-08 16:05:45 +0100 |
commit | 250c3cec2b7bd82ca4fff259204ed4d68847d730 (patch) | |
tree | cd049df75822196a56cba36129abc188fde92a96 /plat/sun50iw1p1/plat_pm.c | |
parent | 4fbafc8575f5fef993538f66e12e02b431ae8c41 (diff) |
sun50iw1p1: Rewrite PMIC driver.
The existing API to interact with the PMIC (AXP803) offers
low-level calls to read and write PMIC registers.
This patch adds two high-level APIs:
* regulator-level API
* task-level API
The regulator-level API allows to enable, disable, and set
the voltage level of regulators. The regulators are named by IDs
in the form of AXP803_<regulator> (e.g. AXP803_DCDC2).
The task-level API allows to perform a batch of regulator-level
calls. Using this API allows to keep many invokations of the
regulator-level API compact.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Diffstat (limited to 'plat/sun50iw1p1/plat_pm.c')
-rw-r--r-- | plat/sun50iw1p1/plat_pm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plat/sun50iw1p1/plat_pm.c b/plat/sun50iw1p1/plat_pm.c index ec26248..922e497 100644 --- a/plat/sun50iw1p1/plat_pm.c +++ b/plat/sun50iw1p1/plat_pm.c @@ -254,7 +254,9 @@ static int32_t sunxi_affinst_suspend_finish(uint64_t mpidr, ******************************************************************************/ static void __dead2 sunxi_system_off(void) { - sunxi_pmic_write(0x32, sunxi_pmic_read(0x32) | 0x80); + uint8_t val; + sunxi_pmic_read(0x32, &val); + sunxi_pmic_write(0x32, val | 0x80); ERROR("PSCI system shutdown: still alive ...\n"); wfi(); |