Lines Matching full:cfg
35 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_apply_state() local
37 for (unsigned int gpio_idx = 0; gpio_idx < cfg->num_gpios; gpio_idx++) { in regulator_gpio_apply_state()
41 ret = gpio_pin_get_dt(&cfg->gpios[gpio_idx]); in regulator_gpio_apply_state()
48 ret = gpio_pin_set_dt(&cfg->gpios[gpio_idx], new_state_of_gpio); in regulator_gpio_apply_state()
61 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_enable() local
64 if (cfg->enable.port == NULL) { in regulator_gpio_enable()
68 ret = gpio_pin_set_dt(&cfg->enable, 1); in regulator_gpio_enable()
79 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_disable() local
81 if (cfg->enable.port == NULL) { in regulator_gpio_disable()
85 return gpio_pin_set_dt(&cfg->enable, 0); in regulator_gpio_disable()
90 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_count_voltages() local
92 return cfg->states_cnt; in regulator_gpio_count_voltages()
97 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_list_voltage() local
99 if (idx >= cfg->states_cnt) { in regulator_gpio_list_voltage()
104 *volt_uv = cfg->states[idx * 2]; in regulator_gpio_list_voltage()
110 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_set_voltage() local
117 for (unsigned int state_idx = 0; state_idx < cfg->states_cnt; state_idx++) { in regulator_gpio_set_voltage()
118 if (!IN_RANGE(cfg->states[state_idx * 2], min_uv, max_uv) || in regulator_gpio_set_voltage()
119 cfg->states[state_idx * 2] >= best_voltage) { in regulator_gpio_set_voltage()
123 best_voltage = cfg->states[state_idx * 2]; in regulator_gpio_set_voltage()
124 best_state = cfg->states[state_idx * 2 + 1]; in regulator_gpio_set_voltage()
164 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_init() local
169 for (unsigned int gpio_idx = 0; gpio_idx < cfg->num_gpios; gpio_idx++) { in regulator_gpio_init()
170 if (!gpio_is_ready_dt(&cfg->gpios[gpio_idx])) { in regulator_gpio_init()
172 cfg->gpios[gpio_idx].port ? cfg->gpios[gpio_idx].port->name in regulator_gpio_init()
177 ret = gpio_pin_configure_dt(&cfg->gpios[gpio_idx], GPIO_OUTPUT); in regulator_gpio_init()
180 cfg->gpios[gpio_idx].pin); in regulator_gpio_init()
185 if (cfg->enable.port != NULL) { in regulator_gpio_init()
186 if (!gpio_is_ready_dt(&cfg->enable)) { in regulator_gpio_init()
187 LOG_ERR("%s: gpio pin: %s not ready", dev->name, cfg->enable.port->name); in regulator_gpio_init()
191 ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT | GPIO_OUTPUT_INIT_LOW); in regulator_gpio_init()
194 cfg->enable.pin); in regulator_gpio_init()