Commit 53856166 authored by Peng Fan's avatar Peng Fan Committed by Jason Liu

MLK-16188-4: drivers: regulator: fixed: add off-on-delay-us

Add off-on-delay-us for fixed regulator.
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
parent df850ea0
/*
* Copyright (C) 2015 Samsung Electronics
* Copyright 2017 NXP
*
* Przemyslaw Marczak <p.marczak@samsung.com>
*
......@@ -20,6 +21,7 @@ DECLARE_GLOBAL_DATA_PTR;
struct fixed_regulator_platdata {
struct gpio_desc gpio; /* GPIO for regulator enable control */
unsigned int startup_delay_us;
unsigned int off_on_delay_us;
};
static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
......@@ -56,6 +58,9 @@ static int fixed_regulator_ofdata_to_platdata(struct udevice *dev)
dev_pdata->startup_delay_us = fdtdec_get_uint(gd->fdt_blob,
dev_of_offset(dev),
"startup-delay-us", 0);
dev_pdata->off_on_delay_us = fdtdec_get_uint(gd->fdt_blob,
dev_of_offset(dev),
"off-on-delay-us", 0);
return 0;
}
......@@ -125,6 +130,10 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable)
if (enable && dev_pdata->startup_delay_us)
udelay(dev_pdata->startup_delay_us);
if (!enable && dev_pdata->off_on_delay_us) {
udelay(dev_pdata->off_on_delay_us);
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment