/Zephyr-latest/drivers/regulator/ |
D | regulator_common.c | 66 if ((config->min_uv > INT32_MIN) || (config->max_uv < INT32_MAX)) { in regulator_common_init() 74 if (current_uv < config->min_uv) { in regulator_common_init() 75 ret = regulator_set_voltage(dev, config->min_uv, config->min_uv); in regulator_common_init() 204 bool regulator_is_supported_voltage(const struct device *dev, int32_t min_uv, in regulator_is_supported_voltage() argument 211 if ((min_uv > config->max_uv) || (max_uv < config->min_uv)) { in regulator_is_supported_voltage() 222 if ((volt_uv >= min_uv) && (volt_uv <= max_uv)) { in regulator_is_supported_voltage() 230 int regulator_set_voltage(const struct device *dev, int32_t min_uv, in regulator_set_voltage() argument 241 if ((min_uv > config->max_uv) || (max_uv < config->min_uv)) { in regulator_set_voltage() 245 return api->set_voltage(dev, min_uv, max_uv); in regulator_set_voltage()
|
D | regulator_npm6001.c | 113 static int regulator_npm6001_buck012_set_voltage(const struct device *dev, int32_t min_uv, in regulator_npm6001_buck012_set_voltage() argument 122 ret = linear_range_get_win_index(range, min_uv, max_uv, &idx); in regulator_npm6001_buck012_set_voltage() 167 static int regulator_npm6001_buck3_set_voltage(const struct device *dev, int32_t min_uv, in regulator_npm6001_buck3_set_voltage() argument 175 ret = linear_range_get_win_index(&buck3_range, min_uv, max_uv, &idx); in regulator_npm6001_buck3_set_voltage() 210 static int regulator_npm6001_ldo0_set_voltage(const struct device *dev, int32_t min_uv, in regulator_npm6001_ldo0_set_voltage() argument 218 if ((min_uv <= ldo0_voltages[i].volt_uv) && (max_uv >= ldo0_voltages[i].volt_uv)) { in regulator_npm6001_ldo0_set_voltage() 320 static int regulator_npm6001_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_npm6001_set_voltage() argument 326 return regulator_npm6001_buck012_set_voltage(dev, min_uv, max_uv, &buck0_range, in regulator_npm6001_set_voltage() 330 return regulator_npm6001_buck012_set_voltage(dev, min_uv, max_uv, &buck1_range, in regulator_npm6001_set_voltage() 334 return regulator_npm6001_buck012_set_voltage(dev, min_uv, max_uv, &buck2_range, in regulator_npm6001_set_voltage() [all …]
|
D | regulator_fixed.c | 57 int32_t min_uv; in regulator_fixed_count_voltages() local 59 return (regulator_common_get_min_voltage(dev, &min_uv) < 0) ? 0U : 1U; in regulator_fixed_count_voltages()
|
D | regulator_npm1300.c | 179 static int buck_set_voltage(const struct device *dev, uint8_t chan, int32_t min_uv, int32_t max_uv) in buck_set_voltage() argument 187 ret = linear_range_get_win_index(&buckldo_range, min_uv, max_uv, &idx); in buck_set_voltage() 212 static int ldo_set_voltage(const struct device *dev, uint8_t chan, int32_t min_uv, int32_t max_uv) in ldo_set_voltage() argument 218 ret = linear_range_get_win_index(&buckldo_range, min_uv, max_uv, &idx); in ldo_set_voltage() 227 int regulator_npm1300_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_npm1300_set_voltage() argument 233 return buck_set_voltage(dev, 0, min_uv, max_uv); in regulator_npm1300_set_voltage() 235 return buck_set_voltage(dev, 1, min_uv, max_uv); in regulator_npm1300_set_voltage() 237 return ldo_set_voltage(dev, 0, min_uv, max_uv); in regulator_npm1300_set_voltage() 239 return ldo_set_voltage(dev, 1, min_uv, max_uv); in regulator_npm1300_set_voltage()
|
D | regulator_rpi_pico.c | 49 static int regulator_rpi_pico_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_rpi_pico_set_voltage() argument 55 ret = linear_range_group_get_win_index(core_ranges, num_core_ranges, min_uv, max_uv, &idx); in regulator_rpi_pico_set_voltage()
|
D | regulator_max20335.c | 177 static int regulator_max20335_set_buck_ldo_voltage(const struct device *dev, int32_t min_uv, in regulator_max20335_set_buck_ldo_voltage() argument 185 ret = linear_range_get_win_index(range, min_uv, max_uv, &idx); in regulator_max20335_set_buck_ldo_voltage() 219 static int regulator_max20335_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_max20335_set_voltage() argument 224 min_uv, in regulator_max20335_set_voltage()
|
D | regulator_nxp_vref.c | 140 int32_t min_uv, int32_t max_uv) in regulator_nxp_vref_set_voltage() argument 147 ret = linear_range_get_win_index(&utrim_range, min_uv, max_uv, &idx); in regulator_nxp_vref_set_voltage()
|
D | regulator_da1469x.c | 280 static int regulator_da1469x_set_voltage(const struct device *dev, int32_t min_uv, in regulator_da1469x_set_voltage() argument 297 if (min_uv < PLL_VDD_UV) { in regulator_da1469x_set_voltage() 298 min_uv = PLL_VDD_UV; in regulator_da1469x_set_voltage() 304 min_uv, max_uv, &idx); in regulator_da1469x_set_voltage()
|
D | regulator_gpio.c | 108 static int regulator_gpio_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_gpio_set_voltage() argument 118 if (!IN_RANGE(cfg->states[state_idx * 2], min_uv, max_uv) || in regulator_gpio_set_voltage()
|
D | regulator_shell.c | 185 int32_t min_uv, max_uv; in cmd_vset() local 194 ret = strtomicro(argv[2], 'v', &min_uv); in cmd_vset() 207 max_uv = min_uv; in cmd_vset() 210 ret = regulator_set_voltage(dev, min_uv, max_uv); in cmd_vset()
|
D | regulator_axp192.c | 236 static int axp192_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in axp192_set_voltage() argument 242 LOG_INST_DBG(config->log, "voltage = [min=%d, max=%d]", min_uv, max_uv); in axp192_set_voltage() 246 min_uv, max_uv, &idx); in axp192_set_voltage()
|
D | regulator_adp5360.c | 105 static int regulator_adp5360_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_adp5360_set_voltage() argument 111 ret = linear_range_group_get_win_index(config->desc->ranges, config->desc->nranges, min_uv, in regulator_adp5360_set_voltage()
|
D | regulator_npm2100.c | 169 static int regulator_npm2100_set_voltage(const struct device *dev, int32_t min_uv, int32_t max_uv) in regulator_npm2100_set_voltage() argument 177 ret = linear_range_get_win_index(&boost_range, min_uv, max_uv, &idx); in regulator_npm2100_set_voltage() 191 ret = linear_range_get_win_index(&ldosw_range, min_uv, max_uv, &idx); in regulator_npm2100_set_voltage()
|
D | regulator_pca9420.c | 246 int32_t min_uv, int32_t max_uv) in regulator_pca9420_set_voltage() argument 255 config->desc->num_ranges, min_uv, in regulator_pca9420_set_voltage()
|
/Zephyr-latest/include/zephyr/drivers/ |
D | regulator.h | 78 typedef int (*regulator_set_voltage_t)(const struct device *dev, int32_t min_uv, 161 int32_t min_uv; member 193 .min_uv = DT_PROP_OR(node_id, regulator_min_microvolt, \ 303 static inline int regulator_common_get_min_voltage(const struct device *dev, int32_t *min_uv) in regulator_common_get_min_voltage() argument 308 if (config->min_uv == INT32_MIN) { in regulator_common_get_min_voltage() 312 *min_uv = config->min_uv; in regulator_common_get_min_voltage() 511 bool regulator_is_supported_voltage(const struct device *dev, int32_t min_uv, 532 int regulator_set_voltage(const struct device *dev, int32_t min_uv,
|
/Zephyr-latest/samples/shields/npm6001_ek/src/ |
D | main.c | 156 int32_t min_uv, max_uv; in cmd_regulator_set() local 165 min_uv = (int32_t)strtoul(argv[2], NULL, 10) * 1000; in cmd_regulator_set() 169 max_uv = min_uv; in cmd_regulator_set() 172 ret = regulator_set_voltage(dev, min_uv, max_uv); in cmd_regulator_set()
|
/Zephyr-latest/tests/drivers/regulator/api/src/ |
D | main.c | 105 zassert_equal(config->min_uv, INT32_MIN); in ZTEST() 124 zassert_equal(config->min_uv, 100); in ZTEST() 703 int32_t min_uv = 0; in ZTEST() local 706 err = regulator_common_get_min_voltage(reg0, &min_uv); in ZTEST() 709 err = regulator_common_get_min_voltage(reg3, &min_uv); in ZTEST() 711 zassert_equal(min_uv, 100); in ZTEST()
|