]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00317981: gpu-viv: use runtime pm for VDDPU management
authorShawn Guo <shawn.guo@freescale.com>
Mon, 16 Jun 2014 06:48:01 +0000 (14:48 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:16:29 +0000 (21:16 -0600)
On kernel 3.14, we use generic power domain for VDDPU management.  In
that case, GPU driver does not need to call regulator API to manage
VDDPU anymore.  Instead, it only needs to call runtime pm, which is
already being used by the driver.

Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index 87b01d4dcd6ae7cb555f5b7561a6b1c29ec52e35..671578d07588aeb67327da262fd314512a6afdf1 100644 (file)
@@ -645,6 +645,7 @@ gckGALDEVICE_Construct(
     device->pmdev = pdev;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
     /*get gpu regulator*/
     device->gpu_regulator = regulator_get(pdev, "cpu_vddgpu");
@@ -659,6 +660,7 @@ gckGALDEVICE_Construct(
                PARENT_FILE, DEBUG_FILE);
        gcmkONERROR(gcvSTATUS_NOT_FOUND);
     }
+#endif
 #endif
     /*Initialize the clock structure*/
     if (IrqLine != -1) {
index a0a6503f32f3f6979279bf261811cb39f2b8bb14..c1df1aa302bd5cf64129ab0dac03b896ea9a8a8c 100644 (file)
@@ -6821,8 +6821,10 @@ gckOS_SetGPUPower(
     struct clk *clk_2dcore = Os->device->clk_2d_core;
     struct clk *clk_2d_axi = Os->device->clk_2d_axi;
     struct clk *clk_vg_axi = Os->device->clk_vg_axi;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
     int ret;
+#endif
 #endif
 
     gctBOOL oldClockState = gcvFALSE;
@@ -6849,6 +6851,7 @@ gckOS_SetGPUPower(
     }
        if((Power == gcvTRUE) && (oldPowerState == gcvFALSE))
        {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
         if(!IS_ERR(Os->device->gpu_regulator)) {
             ret = regulator_enable(Os->device->gpu_regulator);
@@ -6859,6 +6862,7 @@ gckOS_SetGPUPower(
 #else
         imx_gpc_power_up_pu(true);
 #endif
+#endif
 
 #ifdef CONFIG_PM
                pm_runtime_get_sync(Os->device->pmdev);
@@ -6970,11 +6974,13 @@ gckOS_SetGPUPower(
                pm_runtime_put_sync(Os->device->pmdev);
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
         if(!IS_ERR(Os->device->gpu_regulator))
             regulator_disable(Os->device->gpu_regulator);
 #else
         imx_gpc_power_up_pu(false);
+#endif
 #endif
        }
     /* TODO: Put your code here. */