When enabling a fixed regulator, it may take some time to rise to the
correct voltage. If we do not delay here then subsequent operations
will fail.
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Optional properties:
- gpio: GPIO to use for enable control
Optional properties:
- gpio: GPIO to use for enable control
+- startup-delay-us: startup time in microseconds
- regulator constraints (binding info: regulator.txt)
Other kernel-style properties, are currently not used.
- regulator constraints (binding info: regulator.txt)
Other kernel-style properties, are currently not used.
struct fixed_regulator_platdata {
struct gpio_desc gpio; /* GPIO for regulator enable control */
struct fixed_regulator_platdata {
struct gpio_desc gpio; /* GPIO for regulator enable control */
+ unsigned int startup_delay_us;
};
static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
};
static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
if (ret)
debug("Fixed regulator gpio - not found! Error: %d", ret);
if (ret)
debug("Fixed regulator gpio - not found! Error: %d", ret);
+ /* Get optional ramp up delay */
+ dev_pdata->startup_delay_us = fdtdec_get_uint(gd->fdt_blob,
+ dev->of_offset,
+ "startup-delay-us", 0);
+
+
+ if (enable && dev_pdata->startup_delay_us)
+ udelay(dev_pdata->startup_delay_us);
+