PM / OPP: Support adjusting OPP voltages at runtime
authorStephen Boyd <sboyd@codeaurora.org>
Wed, 16 Oct 2019 14:57:53 +0000 (16:57 +0200)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 22 Oct 2019 02:22:11 +0000 (07:52 +0530)
commit771fdcf8d3d04e77ae0f0dc1018144206a61d216
treefde4c7063d5123e775977db885001b0ac29857c1
parent54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c
PM / OPP: Support adjusting OPP voltages at runtime

On some SoCs the Adaptive Voltage Scaling (AVS) technique is
employed to optimize the operating voltage of a device. At a
given frequency, the hardware monitors dynamic factors and either
makes a suggestion for how much to adjust a voltage for the
current frequency, or it automatically adjusts the voltage
without software intervention. Add an API to the OPP library for
the former case, so that AVS type devices can update the voltages
for an OPP when the hardware determines the voltage should
change. The assumption is that drivers like CPUfreq or devfreq
will register for the OPP notifiers and adjust the voltage
according to suggestions that AVS makes.

This patch is derived from [1] submitted by Stephen.
[1] https://lore.kernel.org/patchwork/patch/599279/

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
[s.nawrocki@samsung.com: added handling of OPP min/max voltage]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c
include/linux/pm_opp.h