diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/Kconfig linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/Kconfig
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/Kconfig	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/Kconfig	2007-02-13 14:30:36.000000000 +0000
@@ -50,7 +50,7 @@ config ARCH_SMDK2410
 config ARCH_H1940
 	bool "IPAQ H1940"
 	select CPU_S3C2410
-	select PM_H1940 if PM
+	select PM_HTC if PM
 	help
 	  Say Y here if you are using the HP IPAQ H1940
 
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/Makefile linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/Makefile
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/Makefile	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/Makefile	2007-02-13 14:30:46.000000000 +0000
@@ -21,7 +21,6 @@ obj-$(CONFIG_S3C2410_CLOCK)	+= clock.o
 
 obj-$(CONFIG_ARCH_SMDK2410)	+= mach-smdk2410.o
 obj-$(CONFIG_ARCH_H1940)	+= mach-h1940.o
-obj-$(CONFIG_PM_H1940)		+= pm-h1940.o
 obj-$(CONFIG_MACH_N30)		+= mach-n30.o
 obj-$(CONFIG_ARCH_BAST)		+= mach-bast.o usb-simtec.o
 obj-$(CONFIG_MACH_OTOM)		+= mach-otom.o
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/mach-h1940.c linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/mach-h1940.c
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/mach-h1940.c	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/mach-h1940.c	2007-02-13 14:01:58.000000000 +0000
@@ -38,6 +38,7 @@
 #include <asm/arch/h1940-latch.h>
 #include <asm/arch/fb.h>
 
+#include <asm/plat-s3c24xx/htc-pm.h>
 #include <asm/plat-s3c24xx/clock.h>
 #include <asm/plat-s3c24xx/devs.h>
 #include <asm/plat-s3c24xx/cpu.h>
@@ -166,10 +167,7 @@ static void __init h1940_map_io(void)
 	s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
 	s3c24xx_set_board(&h1940_board);
 
-	/* setup PM */
-
-	memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
-	s3c2410_pm_init();
+	htc_pm_init(H1940_SUSPEND_RESUMEAT, H1940_SUSPEND_CHECK, 0x40000, 0x400);
 }
 
 static void __init h1940_init_irq(void)
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/pm.c linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/pm.c
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2410/pm.c	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2410/pm.c	2007-02-13 14:11:31.000000000 +0000
@@ -53,35 +53,6 @@ static void s3c2410_pm_prepare(void)
 	DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
 	DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
 
-	if (machine_is_h1940()) {
-		void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-		unsigned long ptr;
-		unsigned long calc = 0;
-
-		/* generate check for the bootloader to check on resume */
-
-		for (ptr = 0; ptr < 0x40000; ptr += 0x400)
-			calc += __raw_readl(base+ptr);
-
-		__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
-	}
-
-	/* the RX3715 uses similar code and the same H1940 and the
-	 * same offsets for resume and checksum pointers */
-
-	if (machine_is_rx3715()) {
-		void *base = phys_to_virt(H1940_SUSPEND_CHECK);
-		unsigned long ptr;
-		unsigned long calc = 0;
-
-		/* generate check for the bootloader to check on resume */
-
-		for (ptr = 0; ptr < 0x40000; ptr += 0x4)
-			calc += __raw_readl(base+ptr);
-
-		__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
-	}
-
 	if ( machine_is_aml_m5900() )
 		s3c2410_gpio_setpin(S3C2410_GPF2, 1);
 
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2440/Kconfig linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2440/Kconfig
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2440/Kconfig	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2440/Kconfig	2007-02-13 14:30:29.000000000 +0000
@@ -43,7 +43,7 @@ config MACH_OSIRIS
 config MACH_RX3715
 	bool "HP iPAQ rx3715"
 	select CPU_S3C2440
-	select PM_H1940 if PM
+	select PM_HTC if PM
 	help
 	  Say Y here if you are using the HP iPAQ rx3715.
 
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2440/mach-rx3715.c linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2440/mach-rx3715.c
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/mach-s3c2440/mach-rx3715.c	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/mach-s3c2440/mach-rx3715.c	2007-02-13 14:30:14.000000000 +0000
@@ -46,6 +46,7 @@
 #include <asm/arch/nand.h>
 #include <asm/arch/fb.h>
 
+#include <asm/plat-s3c24xx/pm-htc.h>
 #include <asm/plat-s3c24xx/clock.h>
 #include <asm/plat-s3c24xx/devs.h>
 #include <asm/plat-s3c24xx/cpu.h>
@@ -225,9 +226,7 @@ static void __init rx3715_init_irq(void)
 
 static void __init rx3715_init_machine(void)
 {
-	memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
-	s3c2410_pm_init();
-
+	htc_pm_init((H1940_SUSPEND_RESUMEAT, H1940_SUSPEND_CHECK, 0x40000, 4);
 	s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
 }
 
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/Kconfig linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/Kconfig
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/Kconfig	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/Kconfig	2007-02-13 14:36:18.000000000 +0000
@@ -25,6 +25,12 @@ config PM_SIMTEC
 	  Common power management code for systems that are
 	  compatible with the Simtec style of power management
 
+config PM_HTC
+	bool
+	help
+	  Common power management code for systems that are
+	  compatible with the HTC (HP iPAQ) suspend/resume code.
+
 config S3C2410_BOOT_WATCHDOG
 	bool "S3C2410 Initialisation watchdog"
 	depends on ARCH_S3C2410 && S3C2410_WATCHDOG
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/Makefile linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/Makefile
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/Makefile	2007-02-12 10:28:24.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/Makefile	2007-02-13 14:43:21.000000000 +0000
@@ -24,6 +24,7 @@ obj-y				+= clock.o
 obj-$(CONFIG_CPU_S3C244X)	+= s3c244x.o
 obj-$(CONFIG_CPU_S3C244X)	+= s3c244x-irq.o
 obj-$(CONFIG_PM_SIMTEC)		+= pm-simtec.o
+obj-$(CONFIG_PM_HTC)		+= pm-htc.o pm-htc-shim.o
 obj-$(CONFIG_PM)		+= pm.o
 obj-$(CONFIG_PM)		+= sleep.o
 obj-$(CONFIG_S3C2410_DMA)	+= dma.o
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/pm-htc-shim.S linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/pm-htc-shim.S
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/pm-htc-shim.S	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/pm-htc-shim.S	2007-02-13 13:58:08.000000000 +0000
@@ -1,8 +1,8 @@
-/* linux/arch/arm/mach-s3c2410/pm-h1940.S
+/* linux/arch/arm/mach-s3c2410/pm-htc-shim.S
  *
  * Copyright (c) 2006 Ben Dooks <ben-linux@fluff.org>
  *
- * H1940 Suspend to RAM
+ * HTC (H1940,RX3175,etc) Suspend to RAM helper
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,8 +26,8 @@
 #include <asm/arch/regs-gpio.h>
 
 	.text
-	.global	h1940_pm_return
+	.global	htc_pm_return
 
-h1940_pm_return:
+htc_pm_return:
 	mov	r0, #S3C2410_PA_GPIO
 	ldr	pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ]
diff -urpN -X ../dontdiff linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/pm-htc.c linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/pm-htc.c
--- linux-2.6.20-rmk-12feb2007-pre-htcpm/arch/arm/plat-s3c24xx/pm-htc.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.20-rmk-12feb2007-htcpm/arch/arm/plat-s3c24xx/pm-htc.c	2007-02-13 14:27:19.000000000 +0000
@@ -0,0 +1,66 @@
+/* linux/arch/arm/plat-s3c24xx/pm-htc.c
+ *
+ * Copyright (c) 2007 Simtec Electronics
+ *	Ben Dooks <ben@simtec.co.uk>
+ *
+ * HTC (iPAQ) style PM suspend support (h1940,rx3715,etc)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/suspend.h>
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#include <asm/plat-s3c24xx/cpu.h>
+#include <asm/plat-s3c24xx/pm.h>
+
+#include <asm/arch/h1940.h>
+
+extern void htc_pm_return(void);
+
+static void __iomem *htc_check_start;
+static unsigned long htc_check_stride;
+
+void htc_pm_prepare(void)
+{
+	void __iomem *base = htc_check_start;
+	unsigned long calc = 0;
+	unsigned long ptr;
+
+	/* generate check for the bootloader to check on resume */
+	
+	for (ptr = 0; ptr < 0x40009; ptr += htc_check_stride)
+		calc += __raw_readl(base+ptr);
+	
+	__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECK));
+}
+
+void __init htc_pm_init(unsigned long resume_at,
+			unsigned long check_start,
+			unsigned long check_length,
+			unsigned long stride)
+{
+	htc_check_start = phys_to_virt(check_start);
+	htc_check_length = check_length;
+	htc_check_stride = stride;
+
+	pm_board_prep = htc_pm_prepare;
+
+	memcpy(phys_to_virt(resume_at), htc_pm_return, 32);
+	s3c2410_pm_init();
+}

