}
#endif
-static void tegra_suspend_powergate_control(int partid, bool turn_off)
-{
- if (turn_off)
- tegra_powergate_partition(partid);
- else
- tegra_unpowergate_partition(partid);
-}
-
#ifdef CONFIG_TEGRA_LP0_IN_IDLE
int tegra_enter_lp0(unsigned long sleep_time)
{
int err = 0;
u32 scratch37 = 0xDEADBEEF;
u32 reg;
-
#if defined(CONFIG_ARCH_TEGRA_14x_SOC)
u32 enter_state = 0;
#endif
- bool tegra_suspend_vde_powergated = false;
if (WARN_ON(mode <= TEGRA_SUSPEND_NONE ||
mode >= TEGRA_MAX_SUSPEND_MODE)) {
if ((mode == TEGRA_SUSPEND_LP0) || (mode == TEGRA_SUSPEND_LP1))
tegra_suspend_check_pwr_stats();
- /* turn off VDE partition in LP1 */
- if (mode == TEGRA_SUSPEND_LP1 &&
- tegra_powergate_is_powered(TEGRA_POWERGATE_VDEC)) {
- pr_info("turning off partition %s in LP1\n",
- tegra_powergate_get_name(TEGRA_POWERGATE_VDEC));
- tegra_suspend_powergate_control(TEGRA_POWERGATE_VDEC, true);
- tegra_suspend_vde_powergated = true;
- }
-
tegra_common_suspend();
tegra_pm_set(mode);
tegra_common_resume();
- /* turn on VDE partition in LP1 */
- if (mode == TEGRA_SUSPEND_LP1 && tegra_suspend_vde_powergated) {
- pr_info("turning on partition %s in LP1\n",
- tegra_powergate_get_name(TEGRA_POWERGATE_VDEC));
- tegra_suspend_powergate_control(TEGRA_POWERGATE_VDEC, false);
- }
-
fail:
return err;
}
return;
}
-static void tegra_suspend_powergate_control(int partid, bool turn_off)
-{
- if (turn_off)
- tegra_powergate_partition(partid);
- else
- tegra_unpowergate_partition(partid);
-}
-
int tegra_suspend_dram(enum tegra_suspend_mode mode, unsigned int flags)
{
int err = 0;
u32 scratch37 = 0xDEADBEEF;
u32 reg;
- bool tegra_suspend_vde_powergated = false;
-
if (WARN_ON(mode <= TEGRA_SUSPEND_NONE ||
mode >= TEGRA_MAX_SUSPEND_MODE)) {
err = -ENXIO;
if ((mode == TEGRA_SUSPEND_LP0) || (mode == TEGRA_SUSPEND_LP1))
tegra_suspend_check_pwr_stats();
- /* turn off VDE partition in LP1 */
- if (mode == TEGRA_SUSPEND_LP1 &&
- tegra_powergate_is_powered(TEGRA_POWERGATE_VDEC)) {
- pr_info("turning off partition %s in LP1\n",
- tegra_powergate_get_name(TEGRA_POWERGATE_VDEC));
- tegra_suspend_powergate_control(TEGRA_POWERGATE_VDEC, true);
- tegra_suspend_vde_powergated = true;
- }
-
tegra_common_suspend();
tegra_pm_set(mode);
tegra_common_resume();
- /* turn on VDE partition in LP1 */
- if (mode == TEGRA_SUSPEND_LP1 && tegra_suspend_vde_powergated) {
- pr_info("turning on partition %s in LP1\n",
- tegra_powergate_get_name(TEGRA_POWERGATE_VDEC));
- tegra_suspend_powergate_control(TEGRA_POWERGATE_VDEC, false);
- }
-
fail:
return err;
}