MALI: bifrost: Add private data for governor

This adds support to get simple_ondemand governor data from devicetree.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I6d44ba467d52bde191fb1b87bce02dc503055262
This commit is contained in:
Finley Xiao
2020-12-30 17:03:10 +08:00
committed by Tao Huang
parent 1543446b83
commit 7bfc54efa9
2 changed files with 16 additions and 3 deletions

View File

@@ -49,6 +49,8 @@
#include <soc/rockchip/rockchip_opp_select.h>
#include <soc/rockchip/rockchip_system_monitor.h>
static struct devfreq_simple_ondemand_data ondemand_data;
static struct monitor_dev_profile mali_mdevp = {
.type = MONITOR_TPYE_DEV,
.low_temp_adjust = rockchip_monitor_dev_low_temp_adjust,
@@ -642,6 +644,7 @@ static void kbase_devfreq_work_term(struct kbase_device *kbdev)
int kbase_devfreq_init(struct kbase_device *kbdev)
{
struct device_node *np = kbdev->dev->of_node;
struct devfreq_dev_profile *dp;
struct dev_pm_opp *opp;
unsigned long opp_rate;
@@ -694,8 +697,12 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
return err;
}
of_property_read_u32(np, "upthreshold",
&ondemand_data.upthreshold);
of_property_read_u32(np, "downdifferential",
&ondemand_data.downdifferential);
kbdev->devfreq = devfreq_add_device(kbdev->dev, dp,
"simple_ondemand", NULL);
"simple_ondemand", &ondemand_data);
if (IS_ERR(kbdev->devfreq)) {
err = PTR_ERR(kbdev->devfreq);
kbase_devfreq_work_term(kbdev);

View File

@@ -46,6 +46,8 @@
#include <soc/rockchip/rockchip_opp_select.h>
#include <soc/rockchip/rockchip_system_monitor.h>
static struct devfreq_simple_ondemand_data ondemand_data;
static struct monitor_dev_profile mali_mdevp = {
.type = MONITOR_TPYE_DEV,
.low_temp_adjust = rockchip_monitor_dev_low_temp_adjust,
@@ -321,6 +323,7 @@ static int kbase_devfreq_init_core_mask_table(struct kbase_device *kbdev)
int kbase_devfreq_init(struct kbase_device *kbdev)
{
struct device_node *np = kbdev->dev->of_node;
struct devfreq_dev_profile *dp;
struct dev_pm_opp *opp;
unsigned long opp_rate;
@@ -349,9 +352,12 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
err = kbase_devfreq_init_core_mask_table(kbdev);
if (err)
return err;
of_property_read_u32(np, "upthreshold",
&ondemand_data.upthreshold);
of_property_read_u32(np, "downdifferential",
&ondemand_data.downdifferential);
kbdev->devfreq = devfreq_add_device(kbdev->dev, dp,
"simple_ondemand", NULL);
"simple_ondemand", &ondemand_data);
if (IS_ERR(kbdev->devfreq)) {
kbase_devfreq_term_freq_table(kbdev);
return PTR_ERR(kbdev->devfreq);