/* from the __malidrv_build_info.c file that is generated during build */
extern const char *__malidrv_build_info(void);
+extern void mali_post_init(void);
extern int mali_pdev_dts_init(struct platform_device* mali_gpu_device);
/* Module parameter to control log level */
/* Setup sysfs entries */
err = mali_sysfs_register(mali_dev_name);
if (0 == err) {
+ mali_post_init();
MALI_DEBUG_PRINT(2, ("mali_probe(): Successfully initialized driver for platform device %s\n", pdev->name));
return 0;
} else {
void mali_core_scaling_term(void)
{
+}
+
+void mali_post_init(void)
+{
}
#endif /* MESON_CPU_TYPE <= MESON_CPU_TYPE_MESON6 */
int mali_meson_init_finish(struct platform_device* ptr_plt_dev)
{
-#ifdef CONFIG_GPU_THERMAL
- int err;
- struct gpufreq_cooling_device *gcdev = NULL;
- struct gpucore_cooling_device *gccdev = NULL;
-#endif
if (mali_core_scaling_init(&mali_plat_data) < 0)
return -1;
-
-#ifdef CONFIG_GPU_THERMAL
- gcdev = gpufreq_cooling_alloc();
- register_gpu_freq_info(get_current_frequency);
- if(IS_ERR(gcdev))
- printk("malloc gpu cooling buffer error!!\n");
- else if(!gcdev)
- printk("system does not enable thermal driver\n");
- else {
- gcdev->get_gpu_freq_level = get_mali_freq_level;
- gcdev->get_gpu_max_level = get_mali_max_level;
- gcdev->set_gpu_freq_idx = set_limit_mali_freq;
- gcdev->get_gpu_current_max_level = get_limit_mali_freq;
- err = gpufreq_cooling_register(gcdev);
- if(err < 0)
- printk("register GPU cooling error\n");
- printk("gpu cooling register okay with err=%d\n",err);
- }
-
- gccdev=gpucore_cooling_alloc();
- if(IS_ERR(gccdev))
- printk("malloc gpu core cooling buffer error!!\n");
- else if(!gccdev)
- printk("system does not enable thermal driver\n");
- else {
- gccdev->max_gpu_core_num=mali_plat_data.cfg_pp;
- gccdev->set_max_pp_num=set_limit_pp_num;
- err = (int)gpucore_cooling_register(gccdev);
- if(err < 0)
- printk("register GPU cooling error\n");
- printk("gpu core cooling register okay with err=%d\n",err);
- }
-#endif
-#ifdef CONFIG_AM_VDEC_H264_4K2K
- vh264_4k2k_register_module_callback(mali_4k2k_enter, mali_4k2k_exit);
-#endif /* CONFIG_AM_VDEC_H264_4K2K */
return 0;
}
}
+void mali_post_init(void)
+{
+#ifdef CONFIG_GPU_THERMAL
+ int err;
+ struct gpufreq_cooling_device *gcdev = NULL;
+ struct gpucore_cooling_device *gccdev = NULL;
+
+ gcdev = gpufreq_cooling_alloc();
+ register_gpu_freq_info(get_current_frequency);
+ if(IS_ERR(gcdev))
+ printk("malloc gpu cooling buffer error!!\n");
+ else if(!gcdev)
+ printk("system does not enable thermal driver\n");
+ else {
+ gcdev->get_gpu_freq_level = get_mali_freq_level;
+ gcdev->get_gpu_max_level = get_mali_max_level;
+ gcdev->set_gpu_freq_idx = set_limit_mali_freq;
+ gcdev->get_gpu_current_max_level = get_limit_mali_freq;
+ err = gpufreq_cooling_register(gcdev);
+ if(err < 0)
+ printk("register GPU cooling error\n");
+ printk("gpu cooling register okay with err=%d\n",err);
+ }
+
+ gccdev=gpucore_cooling_alloc();
+ if(IS_ERR(gccdev))
+ printk("malloc gpu core cooling buffer error!!\n");
+ else if(!gccdev)
+ printk("system does not enable thermal driver\n");
+ else {
+ gccdev->max_gpu_core_num=mali_plat_data.cfg_pp;
+ gccdev->set_max_pp_num=set_limit_pp_num;
+ err = (int)gpucore_cooling_register(gccdev);
+ if(err < 0)
+ printk("register GPU cooling error\n");
+ printk("gpu core cooling register okay with err=%d\n",err);
+ }
+#endif
+#ifdef CONFIG_AM_VDEC_H264_4K2K
+ vh264_4k2k_register_module_callback(mali_4k2k_enter, mali_4k2k_exit);
+#endif /* CONFIG_AM_VDEC_H264_4K2K */
+}
+
}
+void mali_post_init(void)
+{
+}
int mali_meson_init_finish(struct platform_device* ptr_plt_dev)
{
-#ifdef CONFIG_GPU_THERMAL
- int err;
- struct gpufreq_cooling_device *gcdev = NULL;
- struct gpucore_cooling_device *gccdev = NULL;
-#endif
if (mali_core_scaling_init(&mali_plat_data) < 0)
return -1;
-
-#ifdef CONFIG_GPU_THERMAL
- gcdev = gpufreq_cooling_alloc();
- register_gpu_freq_info(get_current_frequency);
- if(IS_ERR(gcdev))
- printk("malloc gpu cooling buffer error!!\n");
- else if(!gcdev)
- printk("system does not enable thermal driver\n");
- else {
- gcdev->get_gpu_freq_level = get_mali_freq_level;
- gcdev->get_gpu_max_level = get_mali_max_level;
- gcdev->set_gpu_freq_idx = set_limit_mali_freq;
- gcdev->get_gpu_current_max_level = get_limit_mali_freq;
- err = gpufreq_cooling_register(gcdev);
- if(err < 0)
- printk("register GPU cooling error\n");
- printk("gpu cooling register okay with err=%d\n",err);
- }
-
- gccdev=gpucore_cooling_alloc();
- if(IS_ERR(gccdev))
- printk("malloc gpu core cooling buffer error!!\n");
- else if(!gccdev)
- printk("system does not enable thermal driver\n");
- else {
- gccdev->max_gpu_core_num=mali_plat_data.cfg_pp;
- gccdev->set_max_pp_num=set_limit_pp_num;
- err = (int)gpucore_cooling_register(gccdev);
- if(err < 0)
- printk("register GPU cooling error\n");
- printk("gpu core cooling register okay with err=%d\n",err);
- }
-#endif
-#ifdef CONFIG_AM_VDEC_H264_4K2K
- vh264_4k2k_register_module_callback(mali_4k2k_enter, mali_4k2k_exit);
-#endif /* CONFIG_AM_VDEC_H264_4K2K */
return 0;
}
}
+void mali_post_init(void)
+{
+#ifdef CONFIG_GPU_THERMAL
+ int err;
+ struct gpufreq_cooling_device *gcdev = NULL;
+ struct gpucore_cooling_device *gccdev = NULL;
+
+ gcdev = gpufreq_cooling_alloc();
+ register_gpu_freq_info(get_current_frequency);
+ if(IS_ERR(gcdev))
+ printk("malloc gpu cooling buffer error!!\n");
+ else if(!gcdev)
+ printk("system does not enable thermal driver\n");
+ else {
+ gcdev->get_gpu_freq_level = get_mali_freq_level;
+ gcdev->get_gpu_max_level = get_mali_max_level;
+ gcdev->set_gpu_freq_idx = set_limit_mali_freq;
+ gcdev->get_gpu_current_max_level = get_limit_mali_freq;
+ err = gpufreq_cooling_register(gcdev);
+ if(err < 0)
+ printk("register GPU cooling error\n");
+ printk("gpu cooling register okay with err=%d\n",err);
+ }
+
+ gccdev=gpucore_cooling_alloc();
+ if(IS_ERR(gccdev))
+ printk("malloc gpu core cooling buffer error!!\n");
+ else if(!gccdev)
+ printk("system does not enable thermal driver\n");
+ else {
+ gccdev->max_gpu_core_num=mali_plat_data.cfg_pp;
+ gccdev->set_max_pp_num=set_limit_pp_num;
+ err = (int)gpucore_cooling_register(gccdev);
+ if(err < 0)
+ printk("register GPU cooling error\n");
+ printk("gpu core cooling register okay with err=%d\n",err);
+ }
+#endif
+#ifdef CONFIG_AM_VDEC_H264_4K2K
+ vh264_4k2k_register_module_callback(mali_4k2k_enter, mali_4k2k_exit);
+#endif /* CONFIG_AM_VDEC_H264_4K2K */
+}
int mali_meson_init_finish(struct platform_device* ptr_plt_dev)
{
-#ifdef CONFIG_GPU_THERMAL
- int err;
- struct gpufreq_cooling_device *gcdev = NULL;
-#endif
if (mali_core_scaling_init(&mali_plat_data) < 0)
return -1;
-
-#ifdef CONFIG_GPU_THERMAL
- gcdev = gpufreq_cooling_alloc();
- if(IS_ERR(gcdev))
- printk("malloc gpu cooling buffer error!!\n");
- else if(!gcdev)
- printk("system does not enable thermal driver\n");
- else {
- gcdev->get_gpu_freq_level = get_mali_freq_level;
- gcdev->get_gpu_max_level = get_mali_max_level;
- gcdev->set_gpu_freq_idx = set_limit_mali_freq;
- gcdev->get_gpu_current_max_level = get_limit_mali_freq;
- err = gpufreq_cooling_register(gcdev);
- if(err < 0)
- printk("register GPU cooling error\n");
- printk("gpu cooling register okay with err=%d\n",err);
- }
-
-#endif
return 0;
}
return ret;
}
+void mali_post_init(void)
+{
+#ifdef CONFIG_GPU_THERMAL
+ int err;
+ struct gpufreq_cooling_device *gcdev = NULL;
+
+ gcdev = gpufreq_cooling_alloc();
+ if(IS_ERR(gcdev))
+ printk("malloc gpu cooling buffer error!!\n");
+ else if(!gcdev)
+ printk("system does not enable thermal driver\n");
+ else {
+ gcdev->get_gpu_freq_level = get_mali_freq_level;
+ gcdev->get_gpu_max_level = get_mali_max_level;
+ gcdev->set_gpu_freq_idx = set_limit_mali_freq;
+ gcdev->get_gpu_current_max_level = get_limit_mali_freq;
+ err = gpufreq_cooling_register(gcdev);
+ if(err < 0)
+ printk("register GPU cooling error\n");
+ printk("gpu cooling register okay with err=%d\n",err);
+ }
+
+#endif
+}