Commit b3fdb747 authored by Andy Sinclair's avatar Andy Sinclair Committed by Fabio Baltieri
Browse files

drivers: regulator: fixed: Removed pin state setting from init



The setting of initial state in handled by the common driver,
which calls the enable function for any regulator that has
regulator-boot-on set, and is not already enabled.

Signed-off-by: default avatarAndy Sinclair <andy.sinclair@nordicsemi.no>
parent 48fa603d
Loading
Loading
Loading
Loading
+5 −15
Original line number Diff line number Diff line
@@ -84,33 +84,23 @@ static const struct regulator_driver_api regulator_fixed_api = {
static int regulator_fixed_init(const struct device *dev)
{
	const struct regulator_fixed_config *cfg = dev->config;
	bool init_enabled;
	int ret;

	regulator_common_data_init(dev);

	init_enabled = regulator_common_is_init_enabled(dev);

	if (cfg->enable.port != NULL) {
		if (!gpio_is_ready_dt(&cfg->enable)) {
			LOG_ERR("GPIO port: %s not ready", cfg->enable.port->name);
			return -ENODEV;
		}

		if (init_enabled) {
			ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT_ACTIVE);
			if (ret < 0) {
				return ret;
			}
		} else {
			ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT_INACTIVE);
		int ret = gpio_pin_configure_dt(&cfg->enable, GPIO_OUTPUT);

		if (ret < 0) {
			return ret;
		}
	}
	}

	return regulator_common_init(dev, init_enabled);
	return regulator_common_init(dev, false);
}

#define REGULATOR_FIXED_DEFINE(inst)                                              \