--- h1900_ts.0.c	2004-03-24 18:19:24.861351896 -0700
+++ h1900_ts.c	2004-03-24 18:50:17.543701368 -0700
@@ -28,7 +28,9 @@
 #include <linux/delay.h>
 
 #include <asm/arch/hardware.h>
-#include <asm/arch-sa1100/h3600_hal.h>
+// doesnt exist in 2.6 ...
+//#include <asm/arch-sa1100/h3600_hal.h>
+
 #include <asm/irq.h>
 
 #include <asm/mach/irq.h>
@@ -37,6 +39,27 @@
 
 #define SAMPLE_TIMEOUT 10	/* sample every 10ms */
 
+/**** temporary 
+    FIXME: These should be completed and put into asm/mach/pxa-regs.h  
+           see the Intel® PXA255 Processor Developer's Manual ****/
+
+#define SSCR0_SSE_ENABLED       0x80 /* bit  7 of SSCR0; 1=on 0=off*/
+#define SSCR0_ECS_USE_SSPEXTCLK 0x40 /* bit  6 of SSCR0; 1=SSPEXTCLK 0=on-chip*/
+#define SSCR0_FRF_SPI           0x0  /* bits 5:4 of SSCR0  binary 00*/
+#define SSCR0_FRF_SSP           0x10 /* bits 5:4 of SSCR0  binary 01*/
+#define SSCR0_FRF_MICROWIRE     0x20 /* bits 5:4 of SSCR0  binary 10*/
+
+#define SSCR1_MWDS_16BIT        0x20 /* bit 5 of SSCR1;  1=16bit */  
+#define SSCR1_SPH               0x10 /* bit 4 of SSCR1; motorola*/
+#define SSCR1_SPO_FALLING       0x8  /* bit 3 of SSCR1; motorola*/
+#define SSCR1_LBM               0x4  /* bit 2 of SSCR1 */
+#define SSCR1_TIE               0x2  /* bit 1 of SSCR1 */
+#define SSCR1_RIE               0x1  /* bit 0 of SSCR1 */
+
+#define SSSR_RNE                0x8 /* bit 3 of SSSR */
+#define SSSR_BSY                0x10 /* bit 4 of SSSR */
+
+
 MODULE_AUTHOR("Joshua Wise");
 MODULE_DESCRIPTION("Touchscreen support for the iPAQ H1900");
 
@@ -84,10 +107,10 @@
 #define CTRL_Z2POS 0x40
 #define CTRL_XPOS  0x50
 
-static void h1900_pen(int irq, void* data, struct pt_regs *regs)
+static irqreturn_t h1900_pen(int irq, void* data, struct pt_regs *regs)
 {
 	int pressed;
-	unsigned char ctrlbyte;
+	//unsigned char ctrlbyte;
 	unsigned int bytes[4];
 	
 	pressed = GPLR(GPIO_NR_H1900_PEN_IRQ_N) & GPIO_bit(GPIO_NR_H1900_PEN_IRQ_N);
@@ -98,8 +121,9 @@
 	if (!pressed)
 	{
 		/* tell the HAL that we have been released. */
-		h3600_hal_touchpanel(0, 0, 0);
-		return;
+                // FIXME: need a replacement for linux 2.6
+		//h3600_hal_touchpanel(0, 0, 0);
+		return IRQ_NONE;
 	};
 	
 	/* read positions. */
@@ -116,10 +140,12 @@
 #endif
 
 	/* tell the HAL about the position */
-	h3600_hal_touchpanel(bytes[3], bytes[0], 1);
+        // FIXME: need a replacement for linux 2.6
+	//h3600_hal_touchpanel(bytes[3], bytes[0], 1);
 	
 	/* and, timerize it. */
 	mod_timer (&timer, jiffies + (SAMPLE_TIMEOUT * HZ) / 1000);
+        return IRQ_HANDLED;
 };
 
 static void h1900_ts_timer(unsigned long nr)
@@ -129,8 +155,8 @@
 
 int h1900_ts_init( void )
 {
-	if ( !machine_is_h1900() ) {
-		printk("%s: unknown iPAQ model %s\n", __FUNCTION__, h3600_generic_name() );
+	if ( !(machine_is_h1900() || machine_is_h4000()) ) {
+		printk("%s: unknown iPAQ model\n", __FUNCTION__/*, h3600_generic_name()*/ );
 		return -ENODEV;
 	}
 	
@@ -169,7 +195,8 @@
 	GPDR(GPIO24_SFRM) |=  GPIO_bit(GPIO24_SFRM);
 	GPDR(GPIO25_STXD) |=  GPIO_bit(GPIO25_STXD);
 	GPDR(GPIO26_SRXD) &= ~GPIO_bit(GPIO26_SRXD);
-	pxa_gpio_mode(GPIO23_SCLK_MD);
+	//pxa_gpio_mode(GPIO23_SCLK_MD);
+	pxa_gpio_mode(GPIO23_SCLK_md); //???
 	pxa_gpio_mode(GPIO24_SFRM_MD);
 	pxa_gpio_mode(GPIO25_STXD_MD);
 	pxa_gpio_mode(GPIO26_SRXD_MD);
--- Kconfig.0	2004-03-24 18:37:07.755767384 -0700
+++ Kconfig	2004-03-24 18:39:08.107471144 -0700
@@ -44,6 +44,10 @@
         bool "hp iPAQ h4000"
         depends on ARCH_PXA
 
+config H1900_TS
+        tristate "h1900/h4xxx ADS7846 Touchscreen"
+        depends on ARCH_H4000 || ARCH_H1900
+
 config ARCH_H5400
 	bool "hp iPAQ h5100/h5400/h5500"
 	depends on ARCH_PXA
--- Makefile.0	2004-03-24 18:36:10.309500544 -0700
+++ Makefile	2004-03-24 18:36:52.324113352 -0700
@@ -19,6 +19,7 @@
 obj-$(CONFIG_PXA_IPAQ)		+= ipaq.o
 
 obj-$(CONFIG_ARCH_H1900)	+= h1900.o
+obj-$(CONFIG_H1900_TS)        += h1900_ts.o
 obj-$(CONFIG_ARCH_E7XX)		+= e7xx.o
 obj-$(CONFIG_ARCH_H3900)	+= h3900.o
 obj-$(CONFIG_ARCH_H4000)        += h4000.o
