summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv
diff options
context:
space:
mode:
authorLoren HUANG <b02279@freescale.com>2013-05-15 18:57:56 +0800
committerXianzhong <b07117@freescale.com>2013-06-28 18:02:26 +0800
commit79095604181ce962cd91870fcf691120884773e8 (patch)
treed9c370fec5428275c685fe96c0b83d7fc2bf3de4 /drivers/mxc/gpu-viv
parentac6e4ca689ce8d66cdb6a932216d29f107545544 (diff)
ENGR00262748 Clean up regulator code for 3.5.7
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
Diffstat (limited to 'drivers/mxc/gpu-viv')
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c8
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h3
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c16
3 files changed, 12 insertions, 15 deletions
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 cf089b26cb7a..4c5f416c1496 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
@@ -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;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
index 460f022933ac..3a4e9b805e59 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
@@ -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;
}
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 88b317eddd80..969d467d247b 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
@@ -6826,11 +6826,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
@@ -6943,11 +6943,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. */