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