MALI: midgard: Add private data for governor

This adds support to get simple_ondemand governor data from devicetree.

Change-Id: Ica8cde1b28a81d5b7e2c5c8c109a2469311bcd8e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
Finley Xiao
2019-05-14 10:06:23 +08:00
committed by Tao Huang
parent 267d231cec
commit 2a796d5cd4
2 changed files with 18 additions and 2 deletions

View File

@@ -48,6 +48,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,
@@ -334,6 +336,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;
unsigned long opp_rate;
int err;
@@ -363,8 +366,13 @@ int kbase_devfreq_init(struct kbase_device *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);

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,
@@ -225,6 +227,7 @@ static void kbase_devfreq_exit(struct device *dev)
int kbase_devfreq_init(struct kbase_device *kbdev)
{
struct device_node *np = kbdev->dev->of_node;
struct devfreq_dev_profile *dp;
unsigned long opp_rate;
int err;
@@ -252,8 +255,13 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
if (kbase_devfreq_init_freq_table(kbdev, dp))
return -EFAULT;
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);