mfp-pxa3xx.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 <[email protected]>
  10. * initial version
  11. */
  12. #include <linux/module.h>
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/io.h>
  16. #include <linux/syscore_ops.h>
  17. #include "mfp-pxa3xx.h"
  18. #include "pxa3xx-regs.h"
  19. #ifdef CONFIG_PM
  20. /*
  21. * Configure the MFPs appropriately for suspend/resume.
  22. * FIXME: this should probably depend on which system state we're
  23. * entering - for instance, we might not want to place MFP pins in
  24. * a pull-down mode if they're an active low chip select, and we're
  25. * just entering standby.
  26. */
  27. static int pxa3xx_mfp_suspend(void)
  28. {
  29. mfp_config_lpm();
  30. return 0;
  31. }
  32. static void pxa3xx_mfp_resume(void)
  33. {
  34. mfp_config_run();
  35. /* clear RDH bit when MFP settings are restored
  36. *
  37. * NOTE: the last 3 bits DxS are write-1-to-clear so carefully
  38. * preserve them here in case they will be referenced later
  39. */
  40. ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
  41. }
  42. #else
  43. #define pxa3xx_mfp_suspend NULL
  44. #define pxa3xx_mfp_resume NULL
  45. #endif
  46. struct syscore_ops pxa3xx_mfp_syscore_ops = {
  47. .suspend = pxa3xx_mfp_suspend,
  48. .resume = pxa3xx_mfp_resume,
  49. };