[PATCH] neod: use apm instead of sysfs to suspend

Mike (mwester) mwester at dls.net
Tue May 27 07:00:47 CEST 2008


It would be greatly appreciated if someone can commit this patch
to neod and bump the sane-srcrevs for OE so that buildhost and default
images will include this change.

There is no user-visible change; however this makes it possible to
force gsmd to "play nicely" with suspend/resume on the GTA01 and GTA02
by simple modifications to the apm configuration files.

(I realize that gsmd and neod are going away, but until that happens
this change would be helpful - and trivial to make - thanks!)

Mike (mwester)



---
This patch makes neod use the apm command to suspend the host rather
than writing directly to sysfs.

Signed-off-by: Mike Westerhof <mwester at dls.net>
---

--- neod.orig/src/buttonactions.c       2008-04-14 05:55:48.000000000 -0500
+++ neod/src/buttonactions.c    2008-04-26 22:25:06.000000000 -0500
@@ -569,6 +569,12 @@ void neod_buttonactions_popup_selected_s
  void neod_buttonactions_popup_selected_lock( GtkWidget* button, gpointer user_data )
  {
      gtk_widget_hide( power_menu );
+
+    if (getenv("DO_NOT_USE_APM") == NULL) {
+           system("/usr/bin/apm -s");
+           return;
+    }
+
      int fd = open( "/sys/power/state", O_WRONLY );
      if ( fd != -1 )
      {



More information about the openmoko-devel mailing list