Commit c986968f authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Mark Brown

regulator: core: Add option to prevent disabling unused regulators

This may be useful for debugging and develompent purposes, when there are
drivers that depend on regulators to be enabled but do not request them.

It is inspired from the clk_ignore_unused and pd_ignore_unused parameters,
that are used to keep firmware-enabled clocks and power domains on even if
these are not used by drivers.

The parameter is not expected to be used in normal cases and should not be
needed on a platform with proper driver support.
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarBrian Masney <bmasney@redhat.com>
Acked-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20231107190926.1185326-1-javierm@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b85ea95d
......@@ -5544,6 +5544,13 @@
print every Nth verbose statement, where N is the value
specified.
regulator_ignore_unused
[REGULATOR]
Prevents regulator framework from disabling regulators
that are unused, due no driver claiming them. This may
be useful for debug and development, but should not be
needed on a platform with proper driver support.
relax_domain_level=
[KNL, SMP] Set scheduler's default relax_domain_level.
See Documentation/admin-guide/cgroup-v1/cpusets.rst.
......
......@@ -6234,6 +6234,14 @@ static int regulator_late_cleanup(struct device *dev, void *data)
return 0;
}
static bool regulator_ignore_unused;
static int __init regulator_ignore_unused_setup(char *__unused)
{
regulator_ignore_unused = true;
return 1;
}
__setup("regulator_ignore_unused", regulator_ignore_unused_setup);
static void regulator_init_complete_work_function(struct work_struct *work)
{
/*
......@@ -6246,6 +6254,15 @@ static void regulator_init_complete_work_function(struct work_struct *work)
class_for_each_device(&regulator_class, NULL, NULL,
regulator_register_resolve_supply);
/*
* For debugging purposes, it may be useful to prevent unused
* regulators from being disabled.
*/
if (regulator_ignore_unused) {
pr_warn("regulator: Not disabling unused regulators\n");
return;
}
/* If we have a full configuration then disable any regulators
* we have permission to change the status for and which are
* not in use or always_on. This is effectively the default
......
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