MALI: bifrost_for_linux: optimize opp-table for rockchip SoCs

Change-Id: I33e029a58880c3a54f36e9c5d7d94ce2394404b7
Signed-off-by: Liang Chen <cl@rock-chips.com>
This commit is contained in:
Liang Chen
2018-12-29 18:05:33 +08:00
committed by Tao Huang
parent be55b3581e
commit fad451203d
3 changed files with 9 additions and 12 deletions

View File

@@ -20,5 +20,6 @@
int kbase_devfreq_init(struct kbase_device *kbdev);
void kbase_devfreq_term(struct kbase_device *kbdev);
int kbase_platform_rk_init_opp_table(struct kbase_device *kbdev);
#endif /* _BASE_DEVFREQ_H_ */

View File

@@ -3928,19 +3928,9 @@ static int power_control_init(struct platform_device *pdev)
}
}
#if defined(CONFIG_OF) && defined(CONFIG_PM_OPP)
/* Register the OPPs if they are available in device tree */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) \
|| defined(LSK_OPPV2_BACKPORT)
err = dev_pm_opp_of_add_table(kbdev->dev);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0))
err = of_init_opp_table(kbdev->dev);
#else
err = 0;
#endif /* LINUX_VERSION_CODE */
err = kbase_platform_rk_init_opp_table(kbdev);
if (err)
dev_dbg(kbdev->dev, "OPP table not found\n");
#endif /* CONFIG_OF && CONFIG_PM_OPP */
dev_err(kbdev->dev, "Failed to init_opp_table (%d)\n", err);
return 0;

View File

@@ -22,6 +22,7 @@
#include <linux/nvmem-consumer.h>
#include <linux/soc/rockchip/pvtm.h>
#include <linux/thermal.h>
#include <soc/rockchip/rockchip_opp_select.h>
#include "mali_kbase_rk.h"
@@ -451,3 +452,8 @@ static void kbase_platform_rk_remove_sysfs_files(struct device *dev)
device_remove_file(dev, &dev_attr_utilisation);
}
int kbase_platform_rk_init_opp_table(struct kbase_device *kbdev)
{
return rockchip_init_opp_table(kbdev->dev, NULL,
"gpu_leakage", "mali");
}