static void mapphone_panel_disable(struct omap_dss_device *dssdev) { mapphone_panel_reset(false); mapphone_panel_regulator_disable(); /* change the DSS power state to RET with LCD off */ if (dss_pwrdm) omap4_set_pwrdm_state(dss_pwrdm, PWRDM_POWER_RET); }
static int mapphone_panel_enable(struct omap_dss_device *dssdev) { int ret; /* change the DSS power state to INACTIVE with LCD on */ if (dss_pwrdm) omap4_set_pwrdm_state(dss_pwrdm, PWRDM_POWER_INACTIVE); ret = mapphone_panel_regulator_enable(); if (!ret) mapphone_panel_reset(true); return ret; }
/** * omap4_enter_idle - Programs OMAP4 to enter the specified state * @dev: cpuidle device * @state: The target state to be programmed * * Called from the CPUidle framework to program the device to the * specified low power state selected by the governor. * Returns the amount of time spent in the low power state. */ static int omap4_enter_idle(struct cpuidle_device *dev, struct cpuidle_state *state) { struct omap4_processor_cx *cx = cpuidle_get_statedata(state); struct timespec ts_preidle, ts_postidle, ts_idle; u32 cpu1_state; int cpu_id = smp_processor_id(); /* Used to keep track of the total time in idle */ getnstimeofday(&ts_preidle); local_irq_disable(); local_fiq_disable(); /* * Do only WFI for non-boot CPU(aux cores) */ if (dev->cpu) { wmb(); DO_WFI(); goto return_sleep_time; } /* * Do only a WFI as long as CPU1 is online */ if (num_online_cpus() > 1) { wmb(); DO_WFI(); goto return_sleep_time; } /* * Hold on till CPU1 hits OFF */ cpu1_state = pwrdm_read_pwrst(cpu1_pd); if (cpu1_state != PWRDM_POWER_OFF) { wmb(); DO_WFI(); goto return_sleep_time; } if (cx->type > OMAP4_STATE_C1) clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); #ifdef CONFIG_PM_DEBUG pwrdm_pre_transition(); #endif pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state); omap4_set_pwrdm_state(mpu_pd, cx->mpu_state); pwrdm_set_logic_retst(core_pd, cx->core_logic_state); omap4_set_pwrdm_state(core_pd, cx->core_state); omap4_enter_sleep(dev->cpu, cx->cpu0_state); /* restore the MPU and CORE states to ON */ omap4_set_pwrdm_state(mpu_pd, PWRDM_POWER_ON); omap4_set_pwrdm_state(core_pd, PWRDM_POWER_ON); #ifdef CONFIG_PM_DEBUG pwrdm_post_transition(); #endif if (cx->type > OMAP4_STATE_C1) clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); return_sleep_time: getnstimeofday(&ts_postidle); ts_idle = timespec_sub(ts_postidle, ts_preidle); local_irq_enable(); local_fiq_enable(); return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;; }