From 916b289edee5b788b8a0aa334b00aa6ce4d4075c Mon Sep 17 00:00:00 2001 From: Jacob Chen Date: Thu, 23 Mar 2017 09:03:23 +0800 Subject: [PATCH] MALI: midgard: Linux: support custom ondemand_data get parameter from dts Change-Id: Id1b11e3d6a5809cbd4f6f52b1595562e0fa66f70 Signed-off-by: Jacob Chen --- .../midgard_for_linux/backend/gpu/mali_kbase_devfreq.c | 8 +++++++- drivers/gpu/arm/midgard_for_linux/mali_kbase_defs.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_devfreq.c b/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_devfreq.c index ad05fe5bea8d..69b13ddad95f 100644 --- a/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_devfreq.c +++ b/drivers/gpu/arm/midgard_for_linux/backend/gpu/mali_kbase_devfreq.c @@ -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); diff --git a/drivers/gpu/arm/midgard_for_linux/mali_kbase_defs.h b/drivers/gpu/arm/midgard_for_linux/mali_kbase_defs.h index 4bb8c2c7aec2..69845c2a69ec 100644 --- a/drivers/gpu/arm/midgard_for_linux/mali_kbase_defs.h +++ b/drivers/gpu/arm/midgard_for_linux/mali_kbase_defs.h @@ -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; -- 2.34.1