From 7a97177ac47dd4c045251b4e666cdb726839dbd8 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Mon, 16 Jun 2014 14:48:01 +0800 Subject: [PATCH] ENGR00317981: gpu-viv: use runtime pm for VDDPU management 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 --- .../mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c | 2 ++ drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c index 87b01d4dcd6a..671578d07588 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c @@ -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) { diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c index a0a6503f32f3..c1df1aa302bd 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -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. */ -- 2.39.5