• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/arch/arm/mach-pxa/
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/sysdev.h>
21
22#include <mach/hardware.h>
23#include <mach/mfp-pxa3xx.h>
24#include <mach/pxa3xx-regs.h>
25
26#ifdef CONFIG_PM
27static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state)
28{
29	mfp_config_lpm();
30	return 0;
31}
32
33static int pxa3xx_mfp_resume(struct sys_device *d)
34{
35	mfp_config_run();
36
37	/* clear RDH bit when MFP settings are restored
38	 *
39	 * NOTE: the last 3 bits DxS are write-1-to-clear so carefully
40	 * preserve them here in case they will be referenced later
41	 */
42	ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
43	return 0;
44}
45#else
46#define pxa3xx_mfp_suspend	NULL
47#define pxa3xx_mfp_resume	NULL
48#endif
49
50struct sysdev_class pxa3xx_mfp_sysclass = {
51	.name		= "mfp",
52	.suspend	= pxa3xx_mfp_suspend,
53	.resume 	= pxa3xx_mfp_resume,
54};
55
56static int __init mfp_init_devicefs(void)
57{
58	if (cpu_is_pxa3xx())
59		return sysdev_class_register(&pxa3xx_mfp_sysclass);
60
61	return 0;
62}
63postcore_initcall(mfp_init_devicefs);
64