Skip to content

Commit f7907e5

Browse files
MrVanbroonie
authored andcommitted
regulator: fixed: add off-on-delay
Depends on board design, the gpio controlling regulator may connects with a big capacitance. When need off, it takes some time to let the regulator to be truly off. If not add enough delay, the regulator might have always been on, so introduce off-on-delay to handle such case. Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/1572311875-22880-3-git-send-email-peng.fan@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 96da2d9 commit f7907e5

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/regulator/fixed.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ of_get_fixed_voltage_config(struct device *dev,
123123
config->enabled_at_boot = true;
124124

125125
of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
126+
of_property_read_u32(np, "off-on-delay-us", &config->off_on_delay);
126127

127128
if (of_find_property(np, "vin-supply", NULL))
128129
config->input_supply = "vin";
@@ -189,6 +190,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
189190
}
190191

191192
drvdata->desc.enable_time = config->startup_delay;
193+
drvdata->desc.off_on_delay = config->off_on_delay;
192194

193195
if (config->input_supply) {
194196
drvdata->desc.supply_name = devm_kstrdup(&pdev->dev,

‎include/linux/regulator/fixed.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ struct fixed_voltage_config {
3636
const char *input_supply;
3737
int microvolts;
3838
unsigned startup_delay;
39+
unsigned int off_on_delay;
3940
unsigned enabled_at_boot:1;
4041
struct regulator_init_data *init_data;
4142
};

0 commit comments

Comments
 (0)