Linux Audio

Check our new training course

Linux BSP development engineering services

Need help to port Linux and bootloaders to your hardware?
Loading...
v6.8
 1// SPDX-License-Identifier: GPL-2.0-only
 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 *
 9 * 2007-08-21: eric miao <eric.miao@marvell.com>
10 *             initial version
 
 
 
 
11 */
12
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>
18
 
19#include "mfp-pxa3xx.h"
20#include "pxa3xx-regs.h"
21
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 */
30static int pxa3xx_mfp_suspend(void)
31{
32	mfp_config_lpm();
33	return 0;
34}
35
36static void pxa3xx_mfp_resume(void)
37{
38	mfp_config_run();
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);
46}
47#else
48#define pxa3xx_mfp_suspend	NULL
49#define pxa3xx_mfp_resume	NULL
50#endif
51
52struct syscore_ops pxa3xx_mfp_syscore_ops = {
53	.suspend	= pxa3xx_mfp_suspend,
54	.resume		= pxa3xx_mfp_resume,
55};
v4.10.11
 
 1/*
 2 * linux/arch/arm/mach-pxa/mfp.c
 3 *
 4 * PXA3xx Multi-Function Pin Support
 5 *
 6 * Copyright (C) 2007 Marvell Internation Ltd.
 7 *
 8 * 2007-08-21: eric miao <eric.miao@marvell.com>
 9 *             initial version
10 *
11 *  This program is free software; you can redistribute it and/or modify
12 *  it under the terms of the GNU General Public License version 2 as
13 *  published by the Free Software Foundation.
14 */
15
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/io.h>
20#include <linux/syscore_ops.h>
21
22#include <mach/hardware.h>
23#include "mfp-pxa3xx.h"
24#include <mach/pxa3xx-regs.h>
25
26#ifdef CONFIG_PM
27/*
28 * Configure the MFPs appropriately for suspend/resume.
29 * FIXME: this should probably depend on which system state we're
30 * entering - for instance, we might not want to place MFP pins in
31 * a pull-down mode if they're an active low chip select, and we're
32 * just entering standby.
33 */
34static int pxa3xx_mfp_suspend(void)
35{
36	mfp_config_lpm();
37	return 0;
38}
39
40static void pxa3xx_mfp_resume(void)
41{
42	mfp_config_run();
43
44	/* clear RDH bit when MFP settings are restored
45	 *
46	 * NOTE: the last 3 bits DxS are write-1-to-clear so carefully
47	 * preserve them here in case they will be referenced later
48	 */
49	ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
50}
51#else
52#define pxa3xx_mfp_suspend	NULL
53#define pxa3xx_mfp_resume	NULL
54#endif
55
56struct syscore_ops pxa3xx_mfp_syscore_ops = {
57	.suspend	= pxa3xx_mfp_suspend,
58	.resume		= pxa3xx_mfp_resume,
59};