0121--ARM-goldfish-Implement-suspend-as-wait-for-interr.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From f0266de1899f043daff3b472b8fdd6e30012cb25 Mon Sep 17 00:00:00 2001
  2. From: =?utf-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= <[email protected]>
  3. Date: Wed, 9 Jan 2008 11:46:33 -0800
  4. Subject: [PATCH 121/134] [ARM] goldfish: Implement suspend as wait-for-interrupt.
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=utf-8
  7. Content-Transfer-Encoding: 8bit
  8. Signed-off-by: Mike A. Chan <[email protected]>
  9. Signed-off-by: Arve Hjønnevåg <[email protected]>
  10. ---
  11. arch/arm/mach-goldfish/Makefile | 2 +-
  12. arch/arm/mach-goldfish/pm.c | 43 +++++++++++++++++++++++++++++++++++++++
  13. 2 files changed, 44 insertions(+), 1 deletions(-)
  14. create mode 100644 arch/arm/mach-goldfish/pm.c
  15. --- a/arch/arm/mach-goldfish/Makefile
  16. +++ b/arch/arm/mach-goldfish/Makefile
  17. @@ -4,6 +4,6 @@
  18. # Object file lists.
  19. -obj-y := pdev_bus.o timer.o audio.o
  20. +obj-y := pdev_bus.o timer.o audio.o pm.o
  21. obj-$(CONFIG_MACH_GOLDFISH) += board-goldfish.o
  22. --- /dev/null
  23. +++ b/arch/arm/mach-goldfish/pm.c
  24. @@ -0,0 +1,43 @@
  25. +/* arch/arm/mach-msm/pm.c
  26. + *
  27. + * Goldfish Power Management Routines
  28. + *
  29. + * Copyright (C) 2007 Google, Inc.
  30. + *
  31. + * This software is licensed under the terms of the GNU General Public
  32. + * License version 2, as published by the Free Software Foundation, and
  33. + * may be copied, distributed, and modified under those terms.
  34. + *
  35. + * This program is distributed in the hope that it will be useful,
  36. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38. + * GNU General Public License for more details.
  39. + *
  40. + */
  41. +
  42. +#include <linux/module.h>
  43. +#include <linux/kernel.h>
  44. +#include <linux/init.h>
  45. +#include <linux/pm.h>
  46. +#include <linux/suspend.h>
  47. +#include <mach/system.h>
  48. +
  49. +static int goldfish_pm_enter(suspend_state_t state)
  50. +{
  51. + arch_idle();
  52. + return 0;
  53. +}
  54. +
  55. +static struct platform_suspend_ops goldfish_pm_ops = {
  56. + .enter = goldfish_pm_enter,
  57. + .valid = suspend_valid_only_mem,
  58. +};
  59. +
  60. +static int __init goldfish_pm_init(void)
  61. +{
  62. + suspend_set_ops(&goldfish_pm_ops);
  63. + return 0;
  64. +}
  65. +
  66. +__initcall(goldfish_pm_init);
  67. +