MALI: midgard: Linux: support custom ondemand_data

get parameter from dts

Change-Id: Id1b11e3d6a5809cbd4f6f52b1595562e0fa66f70
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
This commit is contained in:
Jacob Chen
2017-03-23 09:03:23 +08:00
committed by Huang, Tao
parent fe99293b22
commit 916b289ede
2 changed files with 8 additions and 1 deletions

View File

@@ -223,8 +223,14 @@ int kbase_devfreq_init(struct kbase_device *kbdev)
if (kbase_devfreq_init_freq_table(kbdev, dp))
return -EFAULT;
of_property_read_u32(kbdev->dev->of_node, "upthreshold",
&kbdev->ondemand_data.upthreshold);
of_property_read_u32(kbdev->dev->of_node, "downdifferential",
&kbdev->ondemand_data.downdifferential);
kbdev->devfreq = devfreq_add_device(kbdev->dev, dp,
"simple_ondemand", NULL);
"simple_ondemand",
&kbdev->ondemand_data);
if (IS_ERR(kbdev->devfreq)) {
kbase_devfreq_term_freq_table(kbdev);
return PTR_ERR(kbdev->devfreq);

View File

@@ -1035,6 +1035,7 @@ struct kbase_device {
struct devfreq *devfreq;
unsigned long current_freq;
unsigned long current_voltage;
struct devfreq_simple_ondemand_data ondemand_data;
#ifdef CONFIG_DEVFREQ_THERMAL
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
struct devfreq_cooling_device *devfreq_cooling;