diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-05-07 07:20:57 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-30 15:01:09 -0400 |
commit | b6911bba598f5d611f7fdbb87b5af7f1712dbe9d (patch) | |
tree | 8d19951428748909cd508251ebce1d1a5e2cf6ec /arch/mips/include | |
parent | 643c5705bc9d30b64ca320715eb210b853d1f27e (diff) |
MIPS: Malta: add suspend state entry code
This patch introduces code which will enter a suspend state via the
PIIX4. This can only be done when PCI support is enabled since it
requires access to PCI I/O space and the generation of a special cycle
on the PCI bus. In cases where PCI is disabled the mips_pm_suspend
function will simply always return an error.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6905/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/mach-malta/malta-pm.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-malta/malta-pm.h b/arch/mips/include/asm/mach-malta/malta-pm.h new file mode 100644 index 000000000000..c2c2e201013d --- /dev/null +++ b/arch/mips/include/asm/mach-malta/malta-pm.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Imagination Technologies | ||
3 | * Author: Paul Burton <paul.burton@imgtec.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ASM_MIPS_MACH_MALTA_PM_H__ | ||
12 | #define __ASM_MIPS_MACH_MALTA_PM_H__ | ||
13 | |||
14 | #include <asm/mips-boards/piix4.h> | ||
15 | |||
16 | #ifdef CONFIG_MIPS_MALTA_PM | ||
17 | |||
18 | /** | ||
19 | * mips_pm_suspend - enter a suspend state | ||
20 | * @state: the state to enter, one of PIIX4_FUNC3IO_PMCNTRL_SUS_TYP_* | ||
21 | * | ||
22 | * Enters a suspend state via the Malta's PIIX4. If the state to be entered | ||
23 | * is one which loses context (eg. SOFF) then this function will never | ||
24 | * return. | ||
25 | */ | ||
26 | extern int mips_pm_suspend(unsigned state); | ||
27 | |||
28 | #else /* !CONFIG_MIPS_MALTA_PM */ | ||
29 | |||
30 | static inline int mips_pm_suspend(unsigned state) | ||
31 | { | ||
32 | return -EINVAL; | ||
33 | } | ||
34 | |||
35 | #endif /* !CONFIG_MIPS_MALTA_PM */ | ||
36 | |||
37 | #endif /* __ASM_MIPS_MACH_MALTA_PM_H__ */ | ||