]> git.baikalelectronics.ru Git - kernel.git/commit
OPP: Fix missing debugfs supply directory for OPPs
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 11 Dec 2018 11:09:36 +0000 (16:39 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 11 Dec 2018 11:21:56 +0000 (16:51 +0530)
commit0257ade50985b958c7f581615a25e8ac10f0bf6b
tree0b4df41cec1365e38ee62495fa59da07363777e8
parent629af9093f44eddb5a570ad58ff0f0047cf2028c
OPP: Fix missing debugfs supply directory for OPPs

There is one case where we may end up with no "supply" directory for the
OPPs in debugfs. That happens when the OPP core isn't managing the
regulators for the device and the device's OPP do have microvolt
property. It happens because the opp_table->regulator_count remains set
to 0 and the debugfs routines don't add any supply directory in such a
case.

This commit fixes that by setting opp_table->regulator_count to 1 in
that particular case. But to make everything work nicely and not break
other parts of the core, regulator_count is defined as "int" now instead
of "unsigned int" and it can have different special values now. It is
set to -1 initially to mark it "uninitialized" and later only we set it
to 0 or positive values after checking how many supplies are there.

This also helps in finding the bugs where only few of the OPPs have the
"opp-microvolt" property set and not all.

Fixes: 7076781ba93f ("PM / OPP: Don't create debugfs "supply-0" directory unnecessarily")
Reported-by: Quentin Perret <quentin.perret@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
drivers/opp/of.c
drivers/opp/opp.h