/*1* Copyright (C) 2010, Lars-Peter Clausen <[email protected]>2* JZ4740 SoC power management support3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License as published by the6* Free Software Foundation; either version 2 of the License, or (at your7* option) any later version.8*9* You should have received a copy of the GNU General Public License along10* with this program; if not, write to the Free Software Foundation, Inc.,11* 675 Mass Ave, Cambridge, MA 02139, USA.12*13*/1415#include <linux/init.h>16#include <linux/pm.h>17#include <linux/delay.h>18#include <linux/suspend.h>1920#include <asm/mach-jz4740/clock.h>2122#include "clock.h"23#include "irq.h"2425static int jz4740_pm_enter(suspend_state_t state)26{27jz4740_intc_suspend();28jz4740_clock_suspend();2930jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_SLEEP);3132__asm__(".set\tmips3\n\t"33"wait\n\t"34".set\tmips0");3536jz4740_clock_set_wait_mode(JZ4740_WAIT_MODE_IDLE);3738jz4740_clock_resume();39jz4740_intc_resume();4041return 0;42}4344static const struct platform_suspend_ops jz4740_pm_ops = {45.valid = suspend_valid_only_mem,46.enter = jz4740_pm_enter,47};4849static int __init jz4740_pm_init(void)50{51suspend_set_ops(&jz4740_pm_ops);52return 0;5354}55late_initcall(jz4740_pm_init);565758