PD#108096 add pm ops
authorJiyu Yang <jiyu.yang@amlogic.com>
Sun, 28 Jun 2015 07:03:00 +0000 (15:03 +0800)
committerJiyu Yang <jiyu.yang@amlogic.com>
Tue, 30 Jun 2015 08:20:11 +0000 (16:20 +0800)
suspend/resume issues

Change-Id: I4f8818a0b4594d0026524a8f1b417de29b04f62c
Signed-off-by: Jiyu Yang <jiyu.yang@amlogic.com>
mali/platform/meson_bu/mali_clock.c
mali/platform/meson_bu/meson_main2.c

index cae21736ac8ccc8b57dfa6be0a5dd6a8e2562087..fbda6b588d8615c3887f059bb78c9955bad248fa 100644 (file)
@@ -136,8 +136,8 @@ void disable_clock(void)
                return ;
        }
 
-       clk_prepare_enable(clk_mali_0);
-       clk_prepare_enable(clk_mali_1);
+       clk_disable_unprepare(clk_mali_0);
+       clk_disable_unprepare(clk_mali_1);
 }
 
 void enable_clock(void)
@@ -154,8 +154,8 @@ void enable_clock(void)
                return ;
        }
 
-       clk_disable_unprepare(clk_mali_0);
-       clk_disable_unprepare(clk_mali_1);
+       clk_prepare_enable(clk_mali_0);
+       clk_prepare_enable(clk_mali_1);
 }
 
 u32 get_mali_freq(u32 idx)
index 6bcbf497ae9b582578f2d8a34af55f15d1a3caf6..bca9175c7450b6ea9b183e55b32dc3cbff1f2faf 100644 (file)
@@ -70,12 +70,14 @@ int mali_platform_device_init(struct platform_device *device)
        err = platform_device_add_data(device, &mali_gpu_data, sizeof(mali_gpu_data));
 
        if (0 == err) {
+               device->dev.type = &mali_pm_device; /* We should probably use the pm_domain instead of type on newer kernels */
 #ifdef CONFIG_PM_RUNTIME
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
-               pm_runtime_set_autosuspend_delay(&(device->dev), 1000);
-               pm_runtime_use_autosuspend(&(device->dev));
+               pm_runtime_set_autosuspend_delay(&device->dev, 1000);
+               pm_runtime_use_autosuspend(&device->dev);
 #endif
                pm_runtime_enable(&(device->dev));
+               pm_runtime_enable(&device->dev);
 #endif
                mali_meson_init_finish(device);
        }