1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

board: pine64: Configure PMIC on Pinephone Pro for touchscreen

Touchscreen needs 3V on LDO2.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
Ondrej Jirman
2024-07-05 17:22:12 +02:00
parent 7cab3d122a
commit a45b233b2b

View File

@@ -6,6 +6,9 @@
#include <dm.h>
#include <fdt_support.h>
#include <linux/libfdt.h>
#include <linux/delay.h>
#include <power/rk8xx_pmic.h>
#include <power/pmic.h>
#ifdef CONFIG_OF_BOARD_SETUP
int ft_board_setup(void *blob, struct bd_info *bd)
@@ -20,3 +23,23 @@ int ft_board_setup(void *blob, struct bd_info *bd)
return 0;
}
#endif
int board_early_init_r(void)
{
struct udevice *pmic = NULL;
int ret;
ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
if (ret) {
printf("ERROR: PMIC not found! (%d)\n", ret);
return ret;
}
/*
* Raise LDO2 voltage to 3V (needed for touch controller)
*/
pmic_reg_write(pmic, 0x3d, 0x0c);
udelay(2000);
return 0;
}