Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peng Fan and committed by
Mark Brown
f7907e57 96da2d9c

+3
+2
drivers/regulator/fixed.c
··· 123 123 config->enabled_at_boot = true; 124 124 125 125 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); 126 127 127 128 if (of_find_property(np, "vin-supply", NULL)) 128 129 config->input_supply = "vin"; ··· 190 189 } 191 190 192 191 drvdata->desc.enable_time = config->startup_delay; 192 + drvdata->desc.off_on_delay = config->off_on_delay; 193 193 194 194 if (config->input_supply) { 195 195 drvdata->desc.supply_name = devm_kstrdup(&pdev->dev,
+1
include/linux/regulator/fixed.h
··· 36 36 const char *input_supply; 37 37 int microvolts; 38 38 unsigned startup_delay; 39 + unsigned int off_on_delay; 39 40 unsigned enabled_at_boot:1; 40 41 struct regulator_init_data *init_data; 41 42 };