- gpio: GPIO to use for enable control
- startup-delay-us: startup time in microseconds
- regulator constraints (binding info: regulator.txt)
+- enable-active-high: Polarity of GPIO is Active high. If this property
+ is missing, the default assumed is Active low.
+
Other kernel-style properties, are currently not used.
regulator-max-microamp = <15000>;
regulator-always-on;
regulator-boot-on;
+ enable-active-high;
};
struct dm_regulator_uclass_platdata *uc_pdata;
struct fixed_regulator_platdata *dev_pdata;
struct gpio_desc *gpio;
+ const void *blob = gd->fdt_blob;
+ int node = dev->of_offset, flags = GPIOD_IS_OUT;
int ret;
dev_pdata = dev_get_platdata(dev);
/* Set type to fixed */
uc_pdata->type = REGULATOR_TYPE_FIXED;
+ if (fdtdec_get_bool(blob, node, "enable-active-high"))
+ flags |= GPIOD_IS_OUT_ACTIVE;
+
/* Get fixed regulator optional enable GPIO desc */
gpio = &dev_pdata->gpio;
- ret = gpio_request_by_name(dev, "gpio", 0, gpio, GPIOD_IS_OUT);
+ ret = gpio_request_by_name(dev, "gpio", 0, gpio, flags);
if (ret) {
debug("Fixed regulator optional enable GPIO - not found! Error: %d\n",
ret);