From 8459dabb684f905ca6d10669fc8dfaea489ce48b Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Thu, 30 May 2019 11:42:11 +0800 Subject: [PATCH] MALI: utgard: Add private data for governor This adds support to get simple_ondemand governor data from devicetree. Change-Id: Ic897ad6227152c4ce695d6cee8085b4d303339bf Signed-off-by: Finley Xiao --- drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c b/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c index 94cd3c25ea00..260c2a8227a9 100644 --- a/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c +++ b/drivers/gpu/arm/mali400/mali/linux/mali_devfreq.c @@ -45,6 +45,8 @@ static struct monitor_dev_profile mali_mdevp = { .high_temp_adjust = rockchip_monitor_dev_high_temp_adjust, }; +static struct devfreq_simple_ondemand_data ondemand_data; + static int mali_devfreq_target(struct device *dev, unsigned long *target_freq, u32 flags) { @@ -226,6 +228,7 @@ static void mali_devfreq_exit(struct device *dev) int mali_devfreq_init(struct mali_device *mdev) { + struct device_node *np = mdev->dev->of_node; #ifdef CONFIG_DEVFREQ_THERMAL struct devfreq_cooling_power *callbacks = NULL; _mali_osk_device_data data; @@ -254,8 +257,13 @@ int mali_devfreq_init(struct mali_device *mdev) if (mali_devfreq_init_freq_table(mdev, dp)) return -EFAULT; + of_property_read_u32(np, "upthreshold", + &ondemand_data.upthreshold); + of_property_read_u32(np, "downdifferential", + &ondemand_data.downdifferential); + mdev->devfreq = devfreq_add_device(mdev->dev, dp, - "simple_ondemand", NULL); + "simple_ondemand", &ondemand_data); if (IS_ERR(mdev->devfreq)) { mali_devfreq_term_freq_table(mdev); return PTR_ERR(mdev->devfreq);