mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
board: pinephone-pro: Wait for the battery to get some charge [TODO]
We need to wait for the battery voltage to raise above some safe level before proceeding with boot. Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <asm/arch-rockchip/hardware.h>
|
||||
#include <asm/arch-rockchip/misc.h>
|
||||
#include <power/regulator.h>
|
||||
#include <linux/delay.h>
|
||||
#include <power/rk8xx_pmic.h>
|
||||
|
||||
#define GRF_IO_VSEL_BT565_GPIO2AB 1
|
||||
@@ -62,6 +63,8 @@ static void pinephone_pro_init(void)
|
||||
struct udevice *pmic;
|
||||
int ret;
|
||||
|
||||
printf("Initializing Pinephone Pro charger\n");
|
||||
|
||||
ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
|
||||
if (ret) {
|
||||
printf("ERROR: PMIC not found! (%d)\n", ret);
|
||||
@@ -80,6 +83,12 @@ static void pinephone_pro_init(void)
|
||||
* Close charger when USB lower then 3.26V
|
||||
*/
|
||||
rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000);
|
||||
|
||||
/*
|
||||
* Check battery voltage and wait until it's in bootable state.
|
||||
*/
|
||||
//TODO:
|
||||
rk818_wait_battery(pmic);
|
||||
}
|
||||
|
||||
void pmic_setup(void)
|
||||
|
@@ -129,6 +129,11 @@ static int rk8xx_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rk818_wait_battery(struct udevice *dev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(PMIC_CHILDREN)
|
||||
static int rk8xx_bind(struct udevice *dev)
|
||||
{
|
||||
|
@@ -236,4 +236,6 @@ int rk8xx_spl_configure_buck(struct udevice *pmic, int buck, int uvolt);
|
||||
int rk818_spl_configure_usb_input_current(struct udevice *pmic, int current_ma);
|
||||
int rk818_spl_configure_usb_chrg_shutdown(struct udevice *pmic, int uvolt);
|
||||
|
||||
int rk818_wait_battery(struct udevice *dev);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user