From 98a21b7733b037f2e9bfa437ead86be3196d9681 Mon Sep 17 00:00:00 2001 From: Valentin Schneider Date: Wed, 15 Nov 2017 17:04:56 +0000 Subject: drivers/firmware/arm_scmi/perf: Temp fix for OPP tables Right now, the SCMI OPP power channel is being used to fetch OPP voltage data. Ideally, we'd want to only pass power data, but some frameworks like thermal still expect independant frequency and voltage values to compute power. As a temporary bugfix, the power channel will still be used to collect voltage values and populate the OPP table. This commit adds a comment regarding this matter, and makes it so SCMI populates OPP tables with micro-volt values (previously milli-volts, which would break the thermal framework). Signed-off-by: Valentin Schneider --- drivers/firmware/arm_scmi/perf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 1cb4ba705094..27fe6e6f46de 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -414,7 +414,20 @@ static int scmi_dvfs_add_opps_to_device(struct device *dev) for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) { freq = opp->perf * dom->mult_factor; - ret = dev_pm_opp_add(dev, freq, opp->power); + /* + * TODO: find a better solution to pass the OPP voltage. + * + * Right now, the SCMI OPP power channel is being used + * to fetch OPP voltage data. Ideally, we'd want to only pass + * power data, but some frameworks like thermal still expect + * independant frequency and voltage values to compute power. + * + * As a temporary bugfix, the power channel will still be used + * to collect voltage values and populate the OPP table. SCMI + * returns values in milli-Volts, but the OPP table standard + * is micro-Volts, so it is x1000'ed. + */ + ret = dev_pm_opp_add(dev, freq, 1000 * opp->power); if (ret) { dev_warn(dev, "failed to add opp %luHz %umV\n", freq, opp->power); -- cgit v1.2.3