mali_bool pwrctrl_dfs_gpu_target(int step)
{
    int targetProfile;
    int byStep;

    if (1 == g_mali_dfs_var.dfs_DfsOn)//s_uwDebugFsDvfsOn
    {
        /* parameters check */
        if ((step > 3) || (step < -3))
        {
            MALI_DEBUG_PRINT(3,( "bad parameters input to pwrctrl_dfs_gpu_target \r\n"));
            return MALI_FALSE;
        }

        if (0 == step)
        {
            MALI_DEBUG_PRINT(3,( "step=0,no need call this dvfs func \r\n"));
            return MALI_TRUE;
        }

        /* dfs action */
        MALI_DEBUG_PRINT(3,( "current GPU DVFS Profile is %d \r\n",g_mali_dfs_var.dfs_CurrPrf));//s_uwDvfsCurrPrf

        targetProfile = mali_get_target_profile(g_mali_dfs_var.dfs_CurrPrf, step);

        if (g_mali_dfs_var.dfs_CurrPrf == targetProfile)
        {
            MALI_DEBUG_PRINT(3,( "current == target ,no need change \r\n"));
            return MALI_TRUE;
        }
        else
        {
            MALI_DEBUG_PRINT(3,( "current =%d, target=%d doing DVFS \r\n",g_mali_dfs_var.dfs_CurrPrf, targetProfile));
        }

        /* could support step over or step by step */
        #if DVFS_STEP_OVER
        mali_dfs_target_profile(targetProfile);
        #else
        if (g_mali_dfs_var.dfs_CurrPrf < targetProfile)
        {
            for ( byStep = g_mali_dfs_var.dfs_CurrPrf + 1; byStep <= targetProfile; byStep++ )
            {
                mali_dfs_target_profile(byStep);
            }
        }
        else
        {
            for ( byStep = g_mali_dfs_var.dfs_CurrPrf - 1; byStep >= targetProfile; byStep-- )
            {
                mali_dfs_target_profile(byStep);
            }
        }
        #endif

        g_mali_dfs_var.dfs_CurrPrf = targetProfile;
        mali_remark_clockrate(g_mali_dfs_var.dfs_CurrPrf);
    }
    return MALI_TRUE;
}
void pwrctrl_dfs_gpu_enable(void)
{
   /* powerup with old profile */
    mali_dfs_target_profile(g_mali_dfs_var.dfs_BakPrf);//s_uwDvfsBakPrf
}
/*****************************************************************************
 function name  : mali_platform_init
 description    : init mali by calling interFace of low software and dvfs
 input vars     : void
 output vars    : NA
 return value   : _mali_osk_errcode_t
 calls          : mali_clock_init
                  mali_dvfs_status_init
 called         : mali_driver_init

 history        :
  1.data        : 04/03/2014
    author      : s00250033
    modify      : new

*****************************************************************************/
_mali_osk_errcode_t mali_platform_init(struct platform_device *pdev)
{
#if MALI_PWRON_NO_DRV
    mali_platform_powerup_no_drv();
    MALI_SUCCESS;
#endif

    pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
    pdev->dev.type              = &mali_gpu_device_device_type;
    pdev->dev.platform_data     = &mali_gpu_data;

    np = pdev->dev.of_node;
    
    switch(mali_get_gpu_type())
    {
        case MALI_CORE_400_MP1:
            pdev->num_resources         = ARRAY_SIZE(mali_gpu_resources_m400_mp1);
            pdev->resource              = mali_gpu_resources_m400_mp1;
            MALI_DEBUG_PRINT(2,("get gpu type MALI_CORE_400_MP1\n"));
            break;
        case MALI_CORE_400_MP2:
            pdev->num_resources         = ARRAY_SIZE(mali_gpu_resources_m400_mp2);
            pdev->resource              = mali_gpu_resources_m400_mp2;
            MALI_DEBUG_PRINT(2,("get gpu type MALI_CORE_400_MP2\n"));
            break;
        case MALI_CORE_450_MP4:
            mali_gpu_class_is_mali450 = MALI_TRUE;
            pdev->num_resources         = ARRAY_SIZE(mali_gpu_resources_m450_mp4);
            pdev->resource              = mali_gpu_resources_m450_mp4;    
            MALI_DEBUG_PRINT(2,("get gpu type MALI_CORE_450_MP4\n"));
            break;
        default:
            MALI_DEBUG_PRINT(1,("error get gpu type\n"));
            MALI_ERROR(_MALI_OSK_ERR_FAULT);
    }
    
    /* open and get the clk and regulator without mali pmm */
    init_mali_clock_regulator(pdev);

    #if MALI_DVFS_ENABLED
    pwrctrl_g3d_dfs_init(pdev);
    
    mali_dfs_target_profile(0);
    
    /* init the dvfs AND work queue */
    
    mali_dvfs_status_init(MALI_DVFS_HOLD);

    #endif

    
#ifdef CONFIG_PM_RUNTIME
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
    pm_runtime_set_autosuspend_delay(&(pdev->dev), 1000);
    pm_runtime_use_autosuspend(&(pdev->dev));
#endif
    pm_runtime_enable(&pdev->dev);
#endif
    
    
    MALI_SUCCESS;   
}