Commit | Line | Data |
---|---|---|
d2912cb1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
2c8086a5 | 2 | /* |
3 | * linux/arch/arm/mach-pxa/mfp.c | |
4 | * | |
5 | * PXA3xx Multi-Function Pin Support | |
6 | * | |
7 | * Copyright (C) 2007 Marvell Internation Ltd. | |
8 | * | |
e9bba8ee | 9 | * 2007-08-21: eric miao <eric.miao@marvell.com> |
2c8086a5 | 10 | * initial version |
2c8086a5 | 11 | */ |
12 | ||
13 | #include <linux/module.h> | |
14 | #include <linux/kernel.h> | |
15 | #include <linux/init.h> | |
16 | #include <linux/io.h> | |
2eaa03b5 | 17 | #include <linux/syscore_ops.h> |
2c8086a5 | 18 | |
4c25c5d2 | 19 | #include "mfp-pxa3xx.h" |
e6acc406 | 20 | #include "pxa3xx-regs.h" |
2c8086a5 | 21 | |
d4fc858f RK |
22 | #ifdef CONFIG_PM |
23 | /* | |
24 | * Configure the MFPs appropriately for suspend/resume. | |
25 | * FIXME: this should probably depend on which system state we're | |
26 | * entering - for instance, we might not want to place MFP pins in | |
27 | * a pull-down mode if they're an active low chip select, and we're | |
28 | * just entering standby. | |
29 | */ | |
2eaa03b5 | 30 | static int pxa3xx_mfp_suspend(void) |
d4fc858f | 31 | { |
f8dec04d | 32 | mfp_config_lpm(); |
d4fc858f RK |
33 | return 0; |
34 | } | |
35 | ||
2eaa03b5 | 36 | static void pxa3xx_mfp_resume(void) |
d4fc858f | 37 | { |
f8dec04d | 38 | mfp_config_run(); |
c4d1fb62 | 39 | |
40 | /* clear RDH bit when MFP settings are restored | |
41 | * | |
42 | * NOTE: the last 3 bits DxS are write-1-to-clear so carefully | |
43 | * preserve them here in case they will be referenced later | |
44 | */ | |
45 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | |
d4fc858f | 46 | } |
4be35e23 | 47 | #else |
48 | #define pxa3xx_mfp_suspend NULL | |
49 | #define pxa3xx_mfp_resume NULL | |
50 | #endif | |
d4fc858f | 51 | |
2eaa03b5 | 52 | struct syscore_ops pxa3xx_mfp_syscore_ops = { |
d4fc858f | 53 | .suspend = pxa3xx_mfp_suspend, |
2eaa03b5 | 54 | .resume = pxa3xx_mfp_resume, |
d4fc858f | 55 | }; |