static void slp_suspend_ops_end(void) { /* legacy log */ slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_end @@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); }
static void slp_suspend_ops_finish(void) { /* legacy log */ aee_sram_printk("_Chip_pm_finish\n"); slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_finish @@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); /* debug help */ slp_xinfo("Battery_Voltage = %lu\n", BAT_Get_Battery_Voltage(0)); }
static int slp_suspend_ops_begin(suspend_state_t state) { /* legacy log */ slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_begin (%u) @@@@@@@@@@@@@@@@@@\n", slp_pwr_level); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_wake_reason = WR_NONE; return 0; }
static int slp_suspend_ops_prepare(void) { /* legacy log */ aee_sram_printk("_Chip_pm_prepare\n"); slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_prepare @@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); if (slp_dump_pmic) pmic_status_for_sleep(); /* ccci callback is removed and moved to ccci_helper module */ return 0; }
static void slp_suspend_ops_finish(void) { //Compal Add start odm_suspend_flag = 1; slp_xinfo("slp_suspend_ops_finish - odm_suspend_flag : %d \n", odm_suspend_flag); //Compal Add end /* legacy log */ aee_sram_printk("_Chip_pm_finish\n"); slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_finish @@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); /* debug help */ slp_xinfo("Battery_Voltage = %lu\n", BAT_Get_Battery_Voltage(0)); }
static int slp_suspend_ops_enter(suspend_state_t state) { u32 topmisc; unsigned int pwrlevel; /* legacy log */ aee_sram_printk("_Chip_pm_enter\n"); slp_xinfo("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo("_Chip_pm_enter @@@@@@@@@@@@@@@@@@@@@@\n"); slp_xinfo(" @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"); if (slp_dump_gpio) gpio_dump_regs(); /* keep CA9 clock frequency when WFI to sleep */ topmisc = slp_read32(TOP_MISC); slp_write32(TOP_MISC, topmisc & ~(1U << 0)); slp_write_sync(); if (slp_dump_regs) slp_dump_pm_regs(); rtc_disable_writeif(); pwrlevel = slp_pwr_level; if ((pwrlevel != 0) && (slp_read32(0xf0009024) & 0x8000)) { slp_xerror("!!! WILL NOT POWER DOWN CPUSYS DUE TO CPU1 ON !!!\n"); pwrlevel = 0; } slp_wake_reason = sc_go_to_sleep(pwrlevel); rtc_enable_writeif(); /* restore TOP_MISC */ slp_write32(TOP_MISC, topmisc); slp_write_sync(); return 0; }
static int slp_md_sta_show(struct seq_file *m, void *v) { u32 ssta, mdssta = 0; int i; if (!RM_TMR_SSTA) return -ENOMEM; sc_request_mdbus_clk(SC_MDBUS_USER_SLEEP); slp_xinfo("RM_CLK_SETTLE = 0x%x\n", RM_CLK_SETTLE ? slp_read32(RM_CLK_SETTLE) : 0); ssta = slp_read32(RM_TMR_SSTA); sc_unrequest_mdbus_clk(SC_MDBUS_USER_SLEEP); for (i = 0; i < 4; i++) { /* check if timer is in Pause or Pre-Pause state */ if ((ssta & 0xf) == 0x2 || (ssta & 0xf) == 0x4) mdssta |= (1U << (i * 4)); ssta >>= 4; } seq_printf(m, "0x%x\n", mdssta); return 0; }