]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00262748 Clean up regulator code for 3.5.7
authorLoren HUANG <b02279@freescale.com>
Wed, 15 May 2013 10:57:56 +0000 (18:57 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:14:03 +0000 (14:14 +0200)
Remove gpu_regulator since 3.5.7 doesn't need it.

Cherry-pick from 3.5.7 branch.

Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c

index cf089b26cb7aac07f0ee48cf813cd64f8d63bc08..4c5f416c14963805ac49a92b8e5326e2fb04049b 100644 (file)
@@ -365,9 +365,7 @@ gckGALDEVICE_Construct(
     device->pmdev = pdev;
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
-    device->gpu_regulator =(struct regulator*)0xffffffff ;
-#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
     /*get gpu regulator*/
     device->gpu_regulator = regulator_get(pdev, "cpu_vddgpu");
     if (IS_ERR(device->gpu_regulator)) {
@@ -1096,9 +1094,7 @@ gckGALDEVICE_Destroy(
             pm_runtime_disable(Device->pmdev);
 #endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
-        /*NULL*/
-#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
         if (Device->gpu_regulator) {
            regulator_put(Device->gpu_regulator);
            Device->gpu_regulator = NULL;
index 460f022933ac75b62329477acf4d79ae20129c94..3a4e9b805e59a8ecc2a65a2a6d897a0014bb1d9e 100644 (file)
@@ -91,9 +91,10 @@ typedef struct _gckGALDEVICE
     struct clk         *clk_2d_axi;
     struct clk         *clk_vg_axi;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
     /*Power management.*/
     struct regulator      *gpu_regulator;
-
+#endif
        /*Run time pm*/
        struct device           *pmdev;
 }
index ac51d7cb3d892e41f63f1aeaf69e96a851b2b29d..7697c1bb297d969022054cfd4fa7baefaa813f83 100644 (file)
@@ -6819,11 +6819,11 @@ gckOS_SetGPUPower(
     }
        if((Power == gcvTRUE) && (oldPowerState == gcvFALSE))
        {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)         
-           if(!IS_ERR(Os->device->gpu_regulator))
-               regulator_enable(Os->device->gpu_regulator);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+        if(!IS_ERR(Os->device->gpu_regulator))
+            regulator_enable(Os->device->gpu_regulator);
 #else
-           imx_gpc_power_up_pu(true);
+        imx_gpc_power_up_pu(true);
 #endif
 
 #ifdef CONFIG_PM
@@ -6936,11 +6936,11 @@ gckOS_SetGPUPower(
                pm_runtime_put_sync(Os->device->pmdev);
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)         
-               if(!IS_ERR(Os->device->gpu_regulator))
-                       regulator_disable(Os->device->gpu_regulator);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+        if(!IS_ERR(Os->device->gpu_regulator))
+            regulator_disable(Os->device->gpu_regulator);
 #else
-               imx_gpc_power_up_pu(false);
+        imx_gpc_power_up_pu(false);
 #endif
        }
     /* TODO: Put your code here. */