linux-stable/drivers/opp
Viresh Kumar 60049737d6 OPP: Fix missing debugfs supply directory for OPPs
[ Upstream commit 46f48aca2e ]

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: 1fae788ed6 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:50:04 +01:00
..
core.c OPP: Fix missing debugfs supply directory for OPPs 2020-01-27 14:50:04 +01:00
cpu.c Revert "OPP: Protect dev_list with opp_table lock" 2019-11-24 08:19:09 +01:00
debugfs.c PM / OPP: "opp-hz" is optional for power domains 2018-05-09 10:15:18 +05:30
Kconfig
Makefile PM / OPP: Add ti-opp-supply driver 2017-12-17 19:17:44 +01:00
of.c OPP: Fix missing debugfs supply directory for OPPs 2020-01-27 14:50:04 +01:00
opp.h OPP: Fix missing debugfs supply directory for OPPs 2020-01-27 14:50:04 +01:00
ti-opp-supply.c opp: ti-opp-supply: Correct the supply in _get_optimal_vdd_voltage call 2018-12-01 09:37:27 +01:00