dts: nxp_vref: Add current compensation prop

Add DT property to enable current compensation feature of NXP VREF.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This commit is contained in:
Declan Snyder 2024-10-08 16:15:53 -05:00 committed by David Leach
parent 7f4c948729
commit e4deb46ba1
2 changed files with 16 additions and 0 deletions

View File

@ -26,6 +26,7 @@ struct regulator_nxp_vref_config {
VREF_Type *base;
uint16_t buf_start_delay;
uint16_t bg_start_time;
bool current_compensation_en;
};
static int regulator_nxp_vref_enable(const struct device *dev)
@ -183,6 +184,8 @@ static const struct regulator_driver_api api = {
static int regulator_nxp_vref_init(const struct device *dev)
{
const struct regulator_nxp_vref_config *config = dev->config;
VREF_Type *const base = config->base;
int ret;
regulator_common_data_init(dev);
@ -192,6 +195,10 @@ static int regulator_nxp_vref_init(const struct device *dev)
return ret;
}
if (config->current_compensation_en) {
base->CSR |= VREF_CSR_ICOMPEN_MASK;
}
return regulator_common_init(dev, false);
}
@ -205,6 +212,8 @@ static int regulator_nxp_vref_init(const struct device *dev)
nxp_buffer_startup_delay_us), \
.bg_start_time = DT_INST_PROP(inst, \
nxp_bandgap_startup_time_us), \
.current_compensation_en = DT_INST_PROP(inst, \
nxp_current_compensation_en), \
}; \
\
DEVICE_DT_INST_DEFINE(inst, regulator_nxp_vref_init, NULL, &data_##inst,\

View File

@ -34,6 +34,13 @@ properties:
Maximum bandgap startup time as specified in the
appropriate device data sheet, in microseconds.
nxp,current-compensation-en:
type: boolean
description: |
Enable second-order curvature compensation.
This must be enabled to achieve the performance stated in the datasheet.
However, the reset value of the peripheral has it disabled.
"#nxp,reference-cells":
type: int
const: 1