mfp-pxa3xx.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #include <linux/module.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/io.h>
  19. #include <linux/syscore_ops.h>
  20. #include <mach/hardware.h>
  21. #include <mach/mfp-pxa3xx.h>
  22. #include <mach/pxa3xx-regs.h>
  23. #ifdef CONFIG_PM
  24. /*
  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.
  30. */
  31. static int pxa3xx_mfp_suspend(void)
  32. {
  33. mfp_config_lpm();
  34. return 0;
  35. }
  36. static void pxa3xx_mfp_resume(void)
  37. {
  38. mfp_config_run();
  39. /* clear RDH bit when MFP settings are restored
  40. *
  41. * NOTE: the last 3 bits DxS are write-1-to-clear so carefully
  42. * preserve them here in case they will be referenced later
  43. */
  44. ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
  45. }
  46. #else
  47. #define pxa3xx_mfp_suspend NULL
  48. #define pxa3xx_mfp_resume NULL
  49. #endif
  50. struct syscore_ops pxa3xx_mfp_syscore_ops = {
  51. .suspend = pxa3xx_mfp_suspend,
  52. .resume = pxa3xx_mfp_resume,
  53. };