Commit 80a71170 authored by Matti Vaittinen's avatar Matti Vaittinen Committed by Lee Jones

regulator: rohm-regulator: Support SNVS HW state.

The ROHM BD71815 supports setting voltage levels/regulator status
for HW-states "RUN", "SUSPEND", "LPSR" and "SNVS". Add DT parsing
helper also for SNVS state.
Signed-off-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 9cf37cec
...@@ -95,6 +95,12 @@ int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, ...@@ -95,6 +95,12 @@ int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
mask = dvs->lpsr_mask; mask = dvs->lpsr_mask;
omask = dvs->lpsr_on_mask; omask = dvs->lpsr_on_mask;
break; break;
case ROHM_DVS_LEVEL_SNVS:
prop = "rohm,dvs-snvs-voltage";
reg = dvs->snvs_reg;
mask = dvs->snvs_mask;
omask = dvs->snvs_on_mask;
break;
default: default:
return -EINVAL; return -EINVAL;
} }
......
...@@ -27,7 +27,8 @@ struct rohm_regmap_dev { ...@@ -27,7 +27,8 @@ struct rohm_regmap_dev {
#define ROHM_DVS_LEVEL_IDLE BIT(1) #define ROHM_DVS_LEVEL_IDLE BIT(1)
#define ROHM_DVS_LEVEL_SUSPEND BIT(2) #define ROHM_DVS_LEVEL_SUSPEND BIT(2)
#define ROHM_DVS_LEVEL_LPSR BIT(3) #define ROHM_DVS_LEVEL_LPSR BIT(3)
#define ROHM_DVS_LEVEL_VALID_AMOUNT 4 #define ROHM_DVS_LEVEL_SNVS BIT(4)
#define ROHM_DVS_LEVEL_VALID_AMOUNT 5
#define ROHM_DVS_LEVEL_UNKNOWN 0 #define ROHM_DVS_LEVEL_UNKNOWN 0
/** /**
...@@ -66,6 +67,9 @@ struct rohm_dvs_config { ...@@ -66,6 +67,9 @@ struct rohm_dvs_config {
unsigned int lpsr_reg; unsigned int lpsr_reg;
unsigned int lpsr_mask; unsigned int lpsr_mask;
unsigned int lpsr_on_mask; unsigned int lpsr_on_mask;
unsigned int snvs_reg;
unsigned int snvs_mask;
unsigned int snvs_on_mask;
}; };
#if IS_ENABLED(CONFIG_REGULATOR_ROHM) #if IS_ENABLED(CONFIG_REGULATOR_ROHM)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment