Opp rate is used to calc power in thermal framework, so we record
this rate instead of real clock rate.
Devfreq is not ready in target() when use performance governor, so
we need record opp rate in probe().
Change-Id: Iec1918ad5d12124b9f112964f247339e0d50645f
Signed-off-by: Liang Chen <cl@rock-chips.com>
When multiple videos are playback at the same time, video_info_list
may be damaged, so we need protect the list with a muxte_lock.
Change-Id: I7f9ab8d9a9cd29b69550b47d1b35b6645357b0b0
Signed-off-by: Liang Chen <cl@rock-chips.com>
commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream.
Propagate the error of devfreq_add_device() in devm_devfreq_add_device()
rather than statically returning ENOMEM. This makes it slightly faster
to pinpoint the cause of a returned error.
Fixes: 8cd84092d3 ("PM / devfreq: Add resource-managed function for devfreq device")
Cc: stable@vger.kernel.org
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
opp rate is used to calc power in thermal framework, so we record this rate
instead of real clock rate.
Change-Id: Ic51a8c36be8d63fcf765e6d49930d1d437a2e502
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
By passing a pointer to struct devfreq, we can fix global data abuse issue.
Change-Id: I17f6264b86549f67d61d03f38da0127e666eee3c
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
Last_status is used to calculate dmc's power in thermal control.
If last_status is neithor inited nor kept updated, the power model will
get the wrong status and then the wrong power. And dmc gets wrong
cooling state at last.
Meanwhile this issue reports the warning "core: dev_pm_opp_get_voltage
: Invalid parameters"
Change-Id: Ic371796ad94fd6dab376fefbea91adff0068d26b
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
use framework internal dynamic power calc function. Do not use
global data, rk_dmcfreq.
Change-Id: I1f46b2471b5d25a9233724fdd61efe63ea13b860
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
When the devfreq cooling device was designed, it was an oversight not to
pass a pointer to the struct devfreq as the first parameters of the
callbacks. The design patterns of the kernel suggest it for a good
reason.
By passing a pointer to struct devfreq, the driver can register one
function that works with multiple devices. With the current
implementation, a driver that can work with multiple devices has to
create multiple copies of the same function with different parameters so
that each devfreq_cooling_device can use the appropriate one. By
passing a pointer to struct devfreq, the driver can identify which
device it's referring to.
Change-Id: I384bf9aafd2391eccab2ca6a76e4e57f2740aa6b
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Ørjan Eide <orjan.eide@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3aa5374376746f20a27be8682be7f91c8b71d1d8)
Some chips need adjust opp level by different chip-process, add
common functions to select opp level from device-tree, so modules
can select opp level easy.
Change-Id: Ifbd5f720e6a52a68f13697bbb37ac01ff4a87e3e
Signed-off-by: Liang Chen <cl@rock-chips.com>
This adds the necessary data for handling dmcfreq on the rk3328
Change-Id: If4cff5cc372f80b6776a7272a1bff54abef2cf33
Signed-off-by: CanYang He <hcy@rock-chips.com>
This adds the necessary data for handling dfi on the rk3328.
Change-Id: Id870f78dad3ddd6cb5771674a4e8905322f9e8ef
Signed-off-by: CanYang He <hcy@rock-chips.com>
after modify, rockchip_dfi_ops can apply to other platform use such
version ddr monitor. regardless of channel count, only one channel
of rk3288,rk3399,rk3328 can work. and regardless of monitor clk,
some platform like rk3328 monitor clk is always on.
Change-Id: Ia1c02a89116546ded385c5a6a3e36d020d66b7f3
Signed-off-by: CanYang He <hcy@rock-chips.com>
add rockchip_dmc as a cooling device in thermal control
Change-Id: Iefb046a104eb2205f2ef17dd80bb31fd75b42c90
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
This patch adds NoC (Network on Chip) Probe driver which provides
the primitive values to get the performance data. For example, RK3399
has multiple NoC probes to monitor traffic statistics for analyzing
the transaction flow.
Change-Id: I66f6708f0d244488ca08f0f1f1cb36b19c7a2d0a
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
drivers/devfreq/rockchip_dmc.c: In function 'rk3368_dmc_init':
drivers/devfreq/rockchip_dmc.c:649:7: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
drivers/devfreq/rockchip_dmc.c:639:6: note: 'ret' was declared here
Change-Id: I843b7a4a0804bcf02152ba3218dcefa26d047c95
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
When DRAM frequency greater than or equal to this setting value,
the function of auto power-down will disable.
Change-Id: I0c7faee045ff00de0dc36adc45e21389c41aa81f
Signed-off-by: YouMin Chen <cym@rock-chips.com>
The dmc driver supports changing min_freq and max_freq according to
system status and vop bandwidth at present. But even if user changes
governor to userspace, the ddr frequency may also change constantly.
This patch adds a new dmc_ondemand governor which doesn't chang min_freq
and max_freq, it can also support changing ddr frequecy based on usage,
system status and vop bandwidth. So users can set their own frequency by
the userspace governor.
Change-Id: Ib731f29a6ded3b7f05e60cbae4f858e6beeac9da
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>