Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * linux/arch/arm/mach-pxa/mfp.c
0004  *
0005  * PXA3xx Multi-Function Pin Support
0006  *
0007  * Copyright (C) 2007 Marvell Internation Ltd.
0008  *
0009  * 2007-08-21: eric miao <eric.miao@marvell.com>
0010  *             initial version
0011  */
0012 
0013 #include <linux/module.h>
0014 #include <linux/kernel.h>
0015 #include <linux/init.h>
0016 #include <linux/io.h>
0017 #include <linux/syscore_ops.h>
0018 
0019 #include "mfp-pxa3xx.h"
0020 #include "pxa3xx-regs.h"
0021 
0022 #ifdef CONFIG_PM
0023 /*
0024  * Configure the MFPs appropriately for suspend/resume.
0025  * FIXME: this should probably depend on which system state we're
0026  * entering - for instance, we might not want to place MFP pins in
0027  * a pull-down mode if they're an active low chip select, and we're
0028  * just entering standby.
0029  */
0030 static int pxa3xx_mfp_suspend(void)
0031 {
0032     mfp_config_lpm();
0033     return 0;
0034 }
0035 
0036 static void pxa3xx_mfp_resume(void)
0037 {
0038     mfp_config_run();
0039 
0040     /* clear RDH bit when MFP settings are restored
0041      *
0042      * NOTE: the last 3 bits DxS are write-1-to-clear so carefully
0043      * preserve them here in case they will be referenced later
0044      */
0045     ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
0046 }
0047 #else
0048 #define pxa3xx_mfp_suspend  NULL
0049 #define pxa3xx_mfp_resume   NULL
0050 #endif
0051 
0052 struct syscore_ops pxa3xx_mfp_syscore_ops = {
0053     .suspend    = pxa3xx_mfp_suspend,
0054     .resume     = pxa3xx_mfp_resume,
0055 };