mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user