int enter_boot_power_down() { int key; int ac; power_gate_init(); lcd_disable(); video_dac_disable(); camera_power_off() ; vcc2_power_off(); //turn_off_audio_DAC(); if (!early_suspend_flag) { printf("\n boot_suspend \n"); // if (pdata->set_exgpio_early_suspend) { // pdata->set_exgpio_early_suspend(OFF); // } early_power_gate_switch(OFF); early_clk_switch(OFF); early_pll_switch(OFF); early_suspend_flag = 1; } printf("enter boot_pm_suspend!\n"); analog_switch(OFF); usb_switch(OFF, 0); usb_switch(OFF, 1); // if (pdata->set_vccx2) { // pdata->set_vccx2(OFF); // } power_gate_switch(OFF); clk_switch(OFF); pll_switch(OFF); clrbits_le32(P_HHI_SYS_CPU_CLK_CNTL,1<<7); //change A9-->24M printf("boot sleep ...\n"); // WRITE_MPEG_REG_BITS(HHI_MALI_CLK_CNTL, 0, 9, 3); // mali use xtal // CLEAR_CBUS_REG_MASK(HHI_SYS_CPU_CLK_CNTL, 1<<7); // a9 use xtal // SET_CBUS_REG_MASK(HHI_SYS_PLL_CNTL, (1 << 15)); // turn off sys pll // // meson_power_suspend(); key = powerkey_scan(); ac = axp_charger_is_ac_online(); while((!key)&&ac) { key = powerkey_scan(); ac = axp_charger_is_ac_online(); } setbits_le32(P_HHI_SYS_CPU_CLK_CNTL,1<<7); //change A9-->normal printf("boot... wake up\n"); // if (pdata->set_vccx2) { // pdata->set_vccx2(ON); // } SET_CBUS_REG_MASK(HHI_SYS_CPU_CLK_CNTL, (1 << 7)); // a9 use pll WRITE_MPEG_REG_BITS(HHI_MALI_CLK_CNTL, 3, 9, 3); // mali use pll pll_switch(ON); clk_switch(ON); power_gate_switch(ON); usb_switch(ON, 0); usb_switch(ON, 1); analog_switch(ON); if (early_suspend_flag) { early_pll_switch(ON); early_clk_switch(ON); early_power_gate_switch(ON); early_suspend_flag = 0; printf("boot sys_resume\n"); } printf("mlvds init\n"); lcd_enable(); printf("mlvds init finish\n"); return ac; }
static int __init meson_mode_gate_init(void) { power_gate_init(); return 0; }