diff options
| author | Jonas Karlman <[email protected]> | 2026-07-09 23:02:40 +0000 |
|---|---|---|
| committer | Peng Fan <[email protected]> | 2026-07-12 16:18:32 +0800 |
| commit | 10acd5bc9a6c453b86486156e76f1fbbe116e285 (patch) | |
| tree | 545fbe5352d3551f541b943dad02d240b4b753fe /include | |
| parent | 0663b4f553789f8d38220a543116563885693120 (diff) | |
test: dm: regulator: Add regulator_set_value_clamp() tests
Add a sandbox LDO3 with a configurable 1.8V to 3.3V range and use it
to test regulator_set_value_clamp().
Test in-range requests, clamping against the regulator limits, invalid
ranges outside the regulator limits and a min value higher than max.
Signed-off-by: Jonas Karlman <[email protected]>
Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/power/sandbox_pmic.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/power/sandbox_pmic.h b/include/power/sandbox_pmic.h index 1dbd15b5235..50ef39b45e9 100644 --- a/include/power/sandbox_pmic.h +++ b/include/power/sandbox_pmic.h @@ -13,10 +13,10 @@ #define SANDBOX_OF_BUCK_PREFIX "buck" #define SANDBOX_BUCK_COUNT 3 -#define SANDBOX_LDO_COUNT 2 +#define SANDBOX_LDO_COUNT 3 /* * Sandbox PMIC registers: - * We have only 12 significant registers, but we alloc 16 for padding. + * We have only 15 significant registers, but we alloc 16 for padding. */ enum { SANDBOX_PMIC_REG_BUCK1_UV = 0, @@ -36,6 +36,10 @@ enum { SANDBOX_PMIC_REG_LDO2_UA, SANDBOX_PMIC_REG_LDO2_OM, + SANDBOX_PMIC_REG_LDO3_UV, + SANDBOX_PMIC_REG_LDO3_UA, + SANDBOX_PMIC_REG_LDO3_OM, + SANDBOX_PMIC_REG_COUNT = 16, }; @@ -94,6 +98,11 @@ enum { #define OUT_LDO2_UV_MAX 3950000 #define OUT_LDO2_UV_STEP 50000 +/* LDO3 Voltage: min: 0.75V, step: 50mV, max 3.95V */ +#define OUT_LDO3_UV_MIN 750000 +#define OUT_LDO3_UV_MAX 3950000 +#define OUT_LDO3_UV_STEP 50000 + /* register <-> value conversion */ #define REG2VAL(min, step, reg) ((min) + ((step) * (reg))) #define VAL2REG(min, step, val) (((val) - (min)) / (step)) @@ -116,6 +125,8 @@ enum { #define SANDBOX_LDO1_PLATNAME "VDD_EMMC_1.8V" #define SANDBOX_LDO2_DEVNAME "ldo2" #define SANDBOX_LDO2_PLATNAME "VDD_LCD_3.3V" +#define SANDBOX_LDO3_DEVNAME "ldo3" +#define SANDBOX_LDO3_PLATNAME "SUPPLY_1.8_3.3V" /* * Expected regulators setup after call of: |
