Lines Matching +full:zephyr +full:- +full:base
2 * Copyright 2023-2024 NXP
3 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/regulator.h>
11 #include <zephyr/dt-bindings/regulator/nxp_vref.h>
12 #include <zephyr/kernel.h>
13 #include <zephyr/sys/linear_range.h>
14 #include <zephyr/sys/util.h>
26 VREF_Type *base; member
34 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_enable()
35 VREF_Type *const base = config->base; in regulator_nxp_vref_enable() local
37 volatile uint32_t *const csr = &base->CSR; in regulator_nxp_vref_enable()
41 k_busy_wait(config->bg_start_time); in regulator_nxp_vref_enable()
59 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_disable()
60 VREF_Type *const base = config->base; in regulator_nxp_vref_disable() local
66 base->CSR &= ~(VREF_CSR_BUF21EN_MASK | VREF_CSR_HCBGEN_MASK | VREF_CSR_LPBGEN_MASK); in regulator_nxp_vref_disable()
73 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_set_mode()
74 VREF_Type *const base = config->base; in regulator_nxp_vref_set_mode() local
75 uint32_t csr = base->CSR; in regulator_nxp_vref_set_mode()
98 return -EINVAL; in regulator_nxp_vref_set_mode()
101 base->CSR = csr; in regulator_nxp_vref_set_mode()
103 k_busy_wait(config->buf_start_delay); in regulator_nxp_vref_set_mode()
110 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_get_mode()
111 VREF_Type *const base = config->base; in regulator_nxp_vref_get_mode() local
112 uint32_t csr = base->CSR; in regulator_nxp_vref_get_mode()
142 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_set_voltage()
143 VREF_Type *const base = config->base; in regulator_nxp_vref_set_voltage() local
152 base->UTRIM &= ~VREF_UTRIM_TRIM2V1_MASK; in regulator_nxp_vref_set_voltage()
153 base->UTRIM |= VREF_UTRIM_TRIM2V1_MASK & idx; in regulator_nxp_vref_set_voltage()
161 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_get_voltage()
162 VREF_Type *const base = config->base; in regulator_nxp_vref_get_voltage() local
167 idx = (base->UTRIM & VREF_UTRIM_TRIM2V1_MASK) >> VREF_UTRIM_TRIM2V1_SHIFT; in regulator_nxp_vref_get_voltage()
187 const struct regulator_nxp_vref_config *config = dev->config; in regulator_nxp_vref_init()
188 VREF_Type *const base = config->base; in regulator_nxp_vref_init() local
198 if (config->current_compensation_en) { in regulator_nxp_vref_init()
199 base->CSR |= VREF_CSR_ICOMPEN_MASK; in regulator_nxp_vref_init()
203 base->UTRIM = 0; in regulator_nxp_vref_init()
213 .base = (VREF_Type *) DT_INST_REG_ADDR(inst), \