blob: f9b551f01f420c73e9a259fef7d985b18ecacab2 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0-or-later
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
4 * JZ4740 SoC power management support
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00005 */
6
7#include <linux/init.h>
8#include <linux/pm.h>
9#include <linux/delay.h>
10#include <linux/suspend.h>
11
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000012static int jz4740_pm_enter(suspend_state_t state)
13{
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000014 __asm__(".set\tmips3\n\t"
15 "wait\n\t"
16 ".set\tmips0");
17
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000018
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000019
20 return 0;
21}
22
23static const struct platform_suspend_ops jz4740_pm_ops = {
24 .valid = suspend_valid_only_mem,
25 .enter = jz4740_pm_enter,
26};
27
28static int __init jz4740_pm_init(void)
29{
30 suspend_set_ops(&jz4740_pm_ops);
31 return 0;
32
33}
34late_initcall(jz4740_pm_init);