Files
kernel_google_redbull/drivers/opp
Viresh Kumar 30a4e81f14 GKI: OPP: Fix missing debugfs supply directory for OPPs
[ Upstream commit 46f48aca2e5aef3f430e95d1a5fb68227ec8ec85 ]

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.

Bug: 153585706
Test: boot bramble, verify list of probed devices
Fixes: 1fae788ed6 ("PM / OPP: Don't create debugfs "supply-0" directory unnecessarily")
Change-Id: Ia4dabf8860dd3881b17b94ca4e9d2b9f1a28217d
Reported-by: Quentin Perret <quentin.perret@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from 60049737d6)
Signed-off-by: Will McVicker <willmcvicker@google.com>
2020-05-30 02:19:31 +08:00
..
2017-12-17 19:17:44 +01:00