예제 #1
0
int aw_pm_begin(suspend_state_t state)
{
    PM_DBG("%d state begin:%d\n", state,debug_mask);

    //set freq max
#ifdef CONFIG_CPU_FREQ_USR_EVNT_NOTIFY
    //cpufreq_user_event_notify();
#endif
    
    /*must init perfcounter, because delay_us and delay_ms is depandant perf counter*/
#ifndef GET_CYCLE_CNT
    backup_perfcounter();
    init_perfcounters (1, 0);
#endif

    if(unlikely(debug_mask&PM_STANDBY_PRINT_REG)){
        printk("before dev suspend , line:%d\n", __LINE__);
        show_reg(SW_VA_CCM_IO_BASE, (CCU_REG_LENGTH)*4, "ccu");
        show_reg(SW_VA_PORTC_IO_BASE, GPIO_REG_LENGTH*4, "gpio");
        show_reg(SW_VA_TIMERC_IO_BASE, TMR_REG_LENGTH*4, "timer");
        show_reg(SW_VA_TWI0_IO_BASE, TWI0_REG_LENGTH*4, "twi0");
        show_reg(SW_VA_SRAM_IO_BASE, SRAM_REG_LENGTH*4, "sram");
        if (userdef_reg_addr != 0 && userdef_reg_size != 0)
        {
            show_reg(userdef_reg_addr, userdef_reg_size*4, "user defined");
        }
    }
    return 0;

}
예제 #2
0
int aw_pm_begin(suspend_state_t state)
{
    struct cpufreq_policy *policy;

    PM_DBG("%d state begin:%d\n", state,debug_mask);

    //set freq max
#ifdef CONFIG_CPU_FREQ_USR_EVNT_NOTIFY
    //cpufreq_user_event_notify();
#endif
    
    backup_max_freq = 0;
    backup_min_freq = 0;
    policy = cpufreq_cpu_get(0);
    if (!policy)
    {
        PM_DBG("line:%d cpufreq_cpu_get failed!\n", __LINE__);
        goto out;
    }

    backup_max_freq = policy->max;
    backup_min_freq = policy->min;
    policy->user_policy.max= suspend_freq;
    policy->user_policy.min = suspend_freq;
    cpufreq_cpu_put(policy);
    cpufreq_update_policy(0);

    /*must init perfcounter, because delay_us and delay_ms is depandant perf counter*/
#ifndef GET_CYCLE_CNT
    backup_perfcounter();
    init_perfcounters (1, 0);
#endif

    if(unlikely(debug_mask&PM_STANDBY_PRINT_REG)){
        printk("before dev suspend , line:%d\n", __LINE__);
        show_reg(SW_VA_CCM_IO_BASE, (CCU_REG_LENGTH)*4, "ccu");
        show_reg(SW_VA_PORTC_IO_BASE, GPIO_REG_LENGTH*4, "gpio");
        show_reg(SW_VA_TIMERC_IO_BASE, TMR_REG_LENGTH*4, "timer");
        show_reg(SW_VA_TWI0_IO_BASE, TWI0_REG_LENGTH*4, "twi0");
        show_reg(SW_VA_SRAM_IO_BASE, SRAM_REG_LENGTH*4, "sram");
        if (userdef_reg_addr != 0 && userdef_reg_size != 0)
        {
            show_reg(userdef_reg_addr, userdef_reg_size*4, "user defined");
        }
    }
    return 0;

out:
    return -1;
}