power: add rockchip_pm.c for devices low power control
during system suspend in charge animation, we may need add power manage control for some devices low power. Since U-Boot don't provide standard suspend/resume callback for device. We have to add rockchip_pm.c to write hard code to achieve this for different platforms or boards. Change-Id: I01f67c7c57cbcaae48d3def65eea8cab499af93b Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
1e7885d671
commit
88949342ad
|
|
@ -81,6 +81,14 @@ config CHARGE_ANIMATION
|
||||||
help
|
help
|
||||||
This adds a simple function for charge animation display.
|
This adds a simple function for charge animation display.
|
||||||
|
|
||||||
|
config ROCKCHIP_PM
|
||||||
|
bool "Enable Rockchip power manager for charge animation"
|
||||||
|
depends on CHARGE_ANIMATION
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
This adds power manage control of devices for low power
|
||||||
|
during system suspend in charge animation.
|
||||||
|
|
||||||
config AXP_DCDC1_VOLT
|
config AXP_DCDC1_VOLT
|
||||||
int "axp pmic dcdc1 voltage"
|
int "axp pmic dcdc1 voltage"
|
||||||
depends on AXP221_POWER || AXP809_POWER || AXP818_POWER
|
depends on AXP221_POWER || AXP809_POWER || AXP818_POWER
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ obj-$(CONFIG_AXP221_POWER) += axp221.o
|
||||||
obj-$(CONFIG_AXP809_POWER) += axp809.o
|
obj-$(CONFIG_AXP809_POWER) += axp809.o
|
||||||
obj-$(CONFIG_AXP818_POWER) += axp818.o
|
obj-$(CONFIG_AXP818_POWER) += axp818.o
|
||||||
obj-$(CONFIG_CHARGE_ANIMATION) += charge_animation.o
|
obj-$(CONFIG_CHARGE_ANIMATION) += charge_animation.o
|
||||||
|
obj-$(CONFIG_ROCKCHIP_PM) += rockchip_pm.o
|
||||||
obj-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o
|
obj-$(CONFIG_EXYNOS_TMU) += exynos-tmu.o
|
||||||
obj-$(CONFIG_FTPMU010_POWER) += ftpmu010.o
|
obj-$(CONFIG_FTPMU010_POWER) += ftpmu010.o
|
||||||
obj-$(CONFIG_SY8106A_POWER) += sy8106a.o
|
obj-$(CONFIG_SY8106A_POWER) += sy8106a.o
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <power/charge_display.h>
|
#include <power/charge_display.h>
|
||||||
#include <power/charge_animation.h>
|
#include <power/charge_animation.h>
|
||||||
|
#include <power/rockchip_pm.h>
|
||||||
#include <power/fuel_gauge.h>
|
#include <power/fuel_gauge.h>
|
||||||
#include <power/pmic.h>
|
#include <power/pmic.h>
|
||||||
#include <power/rk8xx_pmic.h>
|
#include <power/rk8xx_pmic.h>
|
||||||
|
|
@ -122,12 +123,16 @@ static int system_suspend_enter(struct charge_animation_pdata *pdata)
|
||||||
putc('2');
|
putc('2');
|
||||||
irqs_suspend();
|
irqs_suspend();
|
||||||
putc('3');
|
putc('3');
|
||||||
|
device_suspend();
|
||||||
|
putc('4');
|
||||||
putc('\n');
|
putc('\n');
|
||||||
|
|
||||||
/* Trap into ATF for low power mode */
|
/* Trap into ATF for low power mode */
|
||||||
cpu_suspend(0, psci_system_suspend);
|
cpu_suspend(0, psci_system_suspend);
|
||||||
|
|
||||||
putc('\n');
|
putc('\n');
|
||||||
|
putc('4');
|
||||||
|
device_resume();
|
||||||
putc('3');
|
putc('3');
|
||||||
irqs_resume();
|
irqs_resume();
|
||||||
putc('2');
|
putc('2');
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* (C) Copyright 2018 Rockchip Electronics Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0+
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <command.h>
|
||||||
|
#include <common.h>
|
||||||
|
#include <dm.h>
|
||||||
|
#include <power/rockchip_pm.h>
|
||||||
|
|
||||||
|
int device_suspend(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int device_resume(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
/*
|
||||||
|
* (C) Copyright 2018 Rockchip Electronics Co., Ltd
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0+
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _ROCKCHIP_PM_H_
|
||||||
|
#define _ROCKCHIP_PM_H_
|
||||||
|
|
||||||
|
int device_suspend(void);
|
||||||
|
int device_resume(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue