Support PU regulator dynamical on/off on kernel v3.10.
Acked-by: Jason Liu
Signed-off-by: Anson Huang <b20788@freescale.com>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
/*get gpu regulator*/
device->gpu_regulator = regulator_get(pdev, "cpu_vddgpu");
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
/*get gpu regulator*/
device->gpu_regulator = regulator_get(pdev, "cpu_vddgpu");
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ device->gpu_regulator = regulator_get(pdev, "vddpu");
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
if (IS_ERR(device->gpu_regulator)) {
gcmkTRACE_ZONE(gcvLEVEL_ERROR, gcvZONE_DRIVER,
"%s(%d): Failed to get gpu regulator %s/%s \n",
if (IS_ERR(device->gpu_regulator)) {
gcmkTRACE_ZONE(gcvLEVEL_ERROR, gcvZONE_DRIVER,
"%s(%d): Failed to get gpu regulator %s/%s \n",
pm_runtime_disable(Device->pmdev);
#endif
pm_runtime_disable(Device->pmdev);
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
if (Device->gpu_regulator) {
regulator_put(Device->gpu_regulator);
Device->gpu_regulator = NULL;
if (Device->gpu_regulator) {
regulator_put(Device->gpu_regulator);
Device->gpu_regulator = NULL;
struct clk *clk_2d_axi;
struct clk *clk_vg_axi;
struct clk *clk_2d_axi;
struct clk *clk_vg_axi;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
/*Power management.*/
struct regulator *gpu_regulator;
#endif
/*Power management.*/
struct regulator *gpu_regulator;
#endif
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;
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,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ int ret;
+#endif
gctBOOL oldClockState = gcvFALSE;
gctBOOL oldPowerState = gcvFALSE;
gctBOOL oldClockState = gcvFALSE;
gctBOOL oldPowerState = gcvFALSE;
}
if((Power == gcvTRUE) && (oldPowerState == gcvFALSE))
{
}
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) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ if(!IS_ERR(Os->device->gpu_regulator)) {
+ ret = regulator_enable(Os->device->gpu_regulator);
+ if (ret != 0)
+ gckOS_Print("%s(%d): fail to enable pu regulator %d!\n",
+ __FUNCTION__, __LINE__, ret);
+ }
#else
imx_gpc_power_up_pu(true);
#endif
#else
imx_gpc_power_up_pu(true);
#endif
pm_runtime_put_sync(Os->device->pmdev);
#endif
pm_runtime_put_sync(Os->device->pmdev);
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,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
if(!IS_ERR(Os->device->gpu_regulator))
regulator_disable(Os->device->gpu_regulator);
#else