From 58b8ff0b663a7491c1964e1e3a8d1d88ef707077 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Thu, 7 Aug 2025 17:35:22 +0100 Subject: power: regulator: tps65910: Cannot test unsigned for being negative The code in tps65910_regulator.c treats the field supply in struct tps65910_regulator_pdata as an int and even tests the value for being negative so change it from a u32 to int so that the code all works as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Signed-off-by: Peng Fan --- include/power/tps65910_pmic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/power/tps65910_pmic.h b/include/power/tps65910_pmic.h index 2026ec2f426..8fa02f33ab1 100644 --- a/include/power/tps65910_pmic.h +++ b/include/power/tps65910_pmic.h @@ -123,7 +123,7 @@ enum { /* platform data */ struct tps65910_regulator_pdata { - u32 supply; /* regulator supply voltage in uV */ + int supply; /* regulator supply voltage in uV */ uint unit; /* unit-address according to DT */ }; -- cgit v1.2.3 From 9065b87f35018a4e993e7dfb8a8ec29474785f76 Mon Sep 17 00:00:00 2001 From: Primoz Fiser Date: Thu, 28 Aug 2025 13:24:04 +0200 Subject: power: pmic: pca9450: Add support for system reset The family of PCA9450 PMICs have the ability to perform system resets. Restarting via PMIC is preferred method of restarting the system as all the peripherals are brought to a know state after a power-cycle. The PCA9450 features a cold restart procedure which is initiated by an I2C command 0x14 to the SW_RST register. Support in Linux for restarting via PCA9450 PMIC has been added by Linux commit 6157e62b07d9 ("regulator: pca9450: Add restart handler"). Now add support for it also in the U-Boot via sysreset framework. Signed-off-by: Primoz Fiser Reviewed-by: Paul Geurts Signed-off-by: Peng Fan --- include/power/pca9450.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/power/pca9450.h b/include/power/pca9450.h index e5ab09fb8c8..9119ef793b1 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -75,4 +75,6 @@ enum { #define PCA9450_PMIC_RESET_WDOG_B_CFG_WARM 0x40 #define PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12 0x80 +#define PCA9450_SW_RST_COLD_RST 0x14 + #endif -- cgit v1.2.3 From ad197b31b3f88d53c349995d8bbaeba4b18b8f2b Mon Sep 17 00:00:00 2001 From: Primoz Fiser Date: Thu, 28 Aug 2025 13:24:05 +0200 Subject: power: pmic: pca9450: Add support for reset status PCA9450 PMIC supports reading the reset status from the PWRON_STAT register. Bits 7-4 give indication of the PMIC reset cause: - PWRON (BIT7) - Power ON triggered by PMIC_ON_REQ input line, - WDOGB (BIT6) - Boot after cold reset by WDOGB pin (watchdog reset), - SW_RST (BIT5) - Boot after cold reset initiated by the software, - PMIC_RST (BIT4) - Boot after PMIC_RST_B input line trigger. Add support for reading reset status via the sysreset framework in a convenient printable format. Signed-off-by: Primoz Fiser Reviewed-by: Paul Geurts Signed-off-by: Peng Fan --- include/power/pca9450.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/power/pca9450.h b/include/power/pca9450.h index 9119ef793b1..41b7f95c034 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -75,6 +75,11 @@ enum { #define PCA9450_PMIC_RESET_WDOG_B_CFG_WARM 0x40 #define PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12 0x80 +#define PCA9450_PWRON_STAT_PWRON_MASK 0x80 +#define PCA9450_PWRON_STAT_WDOG_MASK 0x40 +#define PCA9450_PWRON_STAT_SW_RST_MASK 0x20 +#define PCA9450_PWRON_STAT_PMIC_RST_MASK 0x10 + #define PCA9450_SW_RST_COLD_RST 0x14 #endif -- cgit v1.2.3