#define HZ_IN_MHZ (1000000)
#ifdef CONFIG_MALI_MIDGARD_RT_PM
-#define RUNTIME_PM_DELAY_TIME 100
+#define RUNTIME_PM_DELAY_TIME 50
#endif
/* Versatile Express (VE) configuration defaults shared between config_attributes[]
int ret_val;
struct device *dev = kbdev->dev;
struct rk_context *platform;
-
platform = (struct rk_context *)kbdev->platform_context;
if (pm_runtime_status_suspended(dev))
#ifdef CONFIG_MALI_MIDGARD_DVFS
struct rk_context *platform = (struct rk_context *)kbdev->platform_context;
#endif
+ kbase_platform_power_on(kbdev);
+
kbase_platform_clock_on(kbdev);
#ifdef CONFIG_MALI_MIDGARD_DVFS
if (platform->dvfs_enabled) {
static void pm_callback_runtime_off(kbase_device *kbdev)
{
kbase_platform_clock_off(kbdev);
+ kbase_platform_power_off(kbdev);
#ifdef CONFIG_MALI_MIDGARD_DVFS
if (kbase_platform_dvfs_enable(false, p_mali_dvfs_infotbl[0].clock)!= MALI_TRUE)
printk("[err] disabling dvfs is faled\n");
panic("oops");
/* enable mali t760 powerdomain*/
- platform->mali_pd_node = clk_get_dvfs_node("mali_pd");
- if(IS_ERR_OR_NULL(platform->mali_pd_node))
+ platform->mali_pd = clk_get(NULL,"pd_gpu");
+ if(IS_ERR_OR_NULL(platform->mali_pd))
{
- platform->mali_pd_node = NULL;
- printk(KERN_ERR "%s, %s(): failed to get [platform->mali_pd_node]\n", __FILE__, __func__);
- //goto out;
+ platform->mali_pd = NULL;
+ printk(KERN_ERR "%s, %s(): failed to get [platform->mali_pd]\n", __FILE__, __func__);
+ goto out;
}
else
{
- //dvfs_clk_prepare_enable(platform->mali_pd_node);
- printk("pd not enable\n");
+ clk_prepare_enable(platform->mali_pd);
+ printk("mali pd enabled\n");
}
mali_pd_status = 1;
return 0;
out:
- if(platform->mali_pd_node)
- clk_put_dvfs_node(platform->mali_pd_node);
+ if(platform->mali_pd)
+ clk_put(platform->mali_pd);
return -EPERM;
}
/*turn on power domain*/
-static int kbase_platform_power_on(struct kbase_device *kbdev)
+int kbase_platform_power_on(struct kbase_device *kbdev)
{
struct rk_context *platform;
if (!kbdev)
if (mali_pd_status == 1)
return 0;
-#if 0
- if(platform->mali_pd_node)
- dvfs_clk_prepare_enable(platform->mali_pd_node);
+#if 1
+ if(platform->mali_pd)
+ clk_prepare_enable(platform->mali_pd);
#endif
mali_pd_status = 1;
KBASE_TIMELINE_GPU_POWER(kbdev, 1);
}
/*turn off power domain*/
-static int kbase_platform_power_off(struct kbase_device *kbdev)
+int kbase_platform_power_off(struct kbase_device *kbdev)
{
struct rk_context *platform;
if (!kbdev)
if (mali_pd_status== 0)
return 0;
-#if 0
- if(platform->mali_pd_node)
- dvfs_clk_disable_unprepare(platform->mali_pd_node);
+#if 1
+ if(platform->mali_pd)
+ clk_disable_unprepare(platform->mali_pd);
#endif
mali_pd_status = 0;
KBASE_TIMELINE_GPU_POWER(kbdev, 0);
struct clk *clk_mali;
struct clk *mali_pd;
#if 1
- struct dvfs_node * mali_pd_node;
+ struct clk * mali_pd_node;
struct dvfs_node * mali_clk_node;
#endif
#ifdef CONFIG_MALI_MIDGARD_DVFS
int kbase_platform_clock_on(struct kbase_device *kbdev);
int kbase_platform_clock_off(struct kbase_device *kbdev);
+int kbase_platform_power_off(struct kbase_device *kbdev);
+int kbase_platform_power_on(struct kbase_device *kbdev);
#endif /* _KBASE_PLATFORM_H_ */