diff -urN kernel26/arch/arm/mach-pxa/h4000.c kernel26_h4000/arch/arm/mach-pxa/h4000.c
--- kernel26/arch/arm/mach-pxa/h4000.c	2004-04-20 23:41:27.000000000 -0600
+++ kernel26_h4000/arch/arm/mach-pxa/h4000.c	2004-05-08 12:12:37.051877480 -0600
@@ -15,55 +15,45 @@
  * 2004-??-??  Shawn Anderson    Derived the from aximx3.c aximx5.c e7xx.c 
  *                               h1900.c h2200.c h3900.c h5400.c and friends.
  * 2004-04-01  Eddi De Pieri     Move lcd stuff so it can be used as a module.
+ * 2004-04-19  Eddi De Pieri     Moving to new 2.6 standard 
+ *                               (platform_device / device_driver structure)
  */
 
-#include <linux/lcd.h>
-#include <linux/backlight.h>
-#include <linux/fb.h>
-#include "../../../drivers/video/pxafb.h"
-#include <asm/arch/udc.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/device.h>
+
+#include <asm/irq.h>
+#include <asm/hardware.h>
+#include <asm/setup.h>
 
-#include <asm/arch/ipaq.h>
-#include <asm/mach/map.h>
-#include "generic.h"
+#include <asm/mach/irq.h>
 #include <asm/mach/arch.h>
-#include <asm/hardware/ipaq-asic3.h>
+#include <asm/mach/map.h>
 
+#include <asm/arch/ipaq.h>
+#include <asm/arch/udc.h>
 #include <asm/arch/h4000-gpio.h>
-/*#include <asm/arch/h4000-init.h> */
-
+#include <asm/arch/h4000-init.h>
+#include <asm/arch/h4000-asic.h>
 
-#define IPAQ_ASIC3_VIRT                    H3900_ASIC3_VIRT
-
-static void h4000_control_egpio(enum ipaq_egpio_type x, int setp)
-{
-    printk("%s: \n", __FUNCTION__);
-}
-
-static unsigned long h4000_read_egpio(enum ipaq_egpio_type x)
-{
-    printk("%s: \n", __FUNCTION__);
-    return 0;
-}
+#include <asm/hardware/ipaq-asic3.h>
 
-static int h4000_egpio_irq_number(enum ipaq_egpio_type egpio_nr)
-{
-    printk("%s: \n", __FUNCTION__);
-    return -EINVAL;
-}
+#include "generic.h"
 
+/*#define H4000_ASIC3_VIRT 0xf8000000
+#define H4000_ASIC3_PHYS 0x0c000000 */
 
 static void h4000_udc_command (int cmd)
 {
         switch (cmd)
         {
         case PXA2XX_UDC_CMD_DISCONNECT:
-            IPAQ_ASIC3_GPIO_D_OUT(IPAQ_ASIC3_VIRT) &= ~0x1;
-            /* printk("%s: make usb disappear\n",__FUNCTION__); */
+            IPAQ_ASIC3_GPIO_D_OUT(H4000_ASIC3_VIRT) &= ~GPIOD_USB_PULLUP;
             break;
         case PXA2XX_UDC_CMD_CONNECT:
-            IPAQ_ASIC3_GPIO_D_OUT(IPAQ_ASIC3_VIRT) |= 0x1;
-            /* printk("%s: let usb appear\n",__FUNCTION__); */
+            IPAQ_ASIC3_GPIO_D_OUT(H4000_ASIC3_VIRT) |= GPIOD_USB_PULLUP;
             break;
         default:
             printk("_udc_control: unknown command!\n");
@@ -73,154 +63,176 @@
 
 static int h4000_udc_is_connected (void)
 {
-    /* do we see host?  FIXME: return a meaningful value here...*/
-    /*  printk("%s: is usb connected: GPIO 10 =%d\n",
-              __FUNCTION__,(GPLR0 & 0x400)); */
-      return 1;
+        return (!(GET_H4000_GPIO(USB_DETECT_N)));
 }
 
-static struct ipaq_model_ops h4000_model_ops __initdata = {
-    .generic_name = "4000",
-    .control = h4000_control_egpio,
-    .read = h4000_read_egpio,
-    .irq_number = h4000_egpio_irq_number,
-    .set_led = ipaq_set_led,
+static irqreturn_t h4000_rs232(int irq, void *dev_id, struct pt_regs *regs)
+{
+        if (GET_H4000_GPIO(SERIAL_DETECT)) {
+                GAFR1_L |= 0x000a9450;
+                IPAQ_ASIC3_GPIO_A_OUT(H4000_ASIC3_VIRT) |= GPIOA_RS232_ON;
+        } else {
+                IPAQ_ASIC3_GPIO_A_OUT(H4000_ASIC3_VIRT) &= ~GPIOA_RS232_ON;
+                GAFR1_L &= ~0x000a9450;
+        }
+        return IRQ_HANDLED;
+}
+
+static struct irqaction h4000_rs232_irq = {
+        name:           "h4000_rs232",
+        handler:        h4000_rs232,
+        flags:          SA_INTERRUPT
 };
 
-static struct pxa2xx_udc_mach_info h4000_udc_mach_info = {
+static struct pxa2xx_udc_mach_info h4000_udc_info __initdata = {
         .udc_is_connected = h4000_udc_is_connected,
         .udc_command      = h4000_udc_command,
 };
 
-void dump_asic3_gpio(int gpiobase)
-{
-        unsigned int* ptr;
+static struct ipaq_asic3_platform_data h4000_asic3_platform_data = {
+        .gpio_a = {
+        //      .mask           = 0xffff,
+                .dir            = 0xfc7f,
+                .init           = 0x0000 | GPIOA_RS232_ON,
+        //      .trigger_type   = 0x0000,
+        //      .edge_trigger   = 0x0000,
+        //      .leveltri       = 0x0000,
+        //      .sleep_mask     = 0xffff,
+                .sleep_out      = 0x0000,
+                .batt_fault_out = 0x0000,
+        //      .int_status     = 0x0000,
+        //      .alt_function   = 0x0000,
+                .sleep_conf     = 0x000c,
+        },
+        .gpio_b = {
+        //      .mask           = 0xffff,
+                .dir            = 0xddbf,
+                .init           = 0x1c00,
+        //      .trigger_type   = 0x0000,
+        //      .edge_trigger   = 0x0000,
+        //      .leveltri       = 0x0000,
+        //      .sleep_mask     = 0xffff,
+                .sleep_out      = 0x0000,
+                .batt_fault_out = 0x0000,
+        //      .int_status     = 0x0000,
+        //      .alt_function   = 0x0000,
+                .sleep_conf     = 0x000c,
+        },
+        .gpio_c = {
+        //      .mask           = 0xffff,
+                .dir            = 0xffff,
+                .init           = 0x4700,
+        //      .trigger_type   = 0x0000,
+        //      .edge_trigger   = 0x0000,
+        //      .leveltri       = 0x0000,
+        //      .sleep_mask     = 0xffff,
+                .sleep_out      = 0x4000,
+                .batt_fault_out = 0x4000,
+        //      .int_status     = 0x0000,
+        //      .alt_function   = 0x0003,
+                .sleep_conf     = 0x000c,
+        },
+        .gpio_d = {
+        //      .mask           = 0xff03,
+                .dir            = 0xef03,
+                .init           = 0x0f02 | GPIOD_USB_ON | GPIOD_USB_PULLUP,
+        //      .trigger_type   = 0x00fc,
+        //      .edge_trigger   = 0x0080,
+        //      .leveltri       = 0x0000,
+        //      .sleep_mask     = 0xff83,
+                .sleep_out      = 0x0100,
+                .batt_fault_out = 0x0100,
+        //      .int_status     = 0x0000,
+        //      .alt_function   = 0x0000,
+                .sleep_conf     = 0x000c,
+        },
+};
 
-        ptr = (unsigned int* )IPAQ_ASIC3_VIRT + gpiobase;
-        printk("---------- BEGIN ASIC3 GPIO%d DUMP\n", gpiobase/0x100);
-        printk("MASK: %04x\n", *(ptr));
-        printk("DIR : %04x\n", *(ptr+1));
-        printk("OUT : %04x\n", *(ptr+2));
-        printk("TTYP: %04x\n", *(ptr+3));
-        printk("ETRG: %04x\n", *(ptr+4));
-        printk("LTRG: %04x\n", *(ptr+5));
-        printk("SMSK: %04x\n", *(ptr+6));
-        printk("SOUT: %04x\n", *(ptr+7));
-        printk("BOUT: %04x\n", *(ptr+8));
-        printk("ISTT: %04x\n", *(ptr+9));
-        printk("AFR : %04x\n", *(ptr+10));
-        printk("SCNF: %04x\n", *(ptr+11));
-        printk("STAT: %04x\n", *(ptr+12));
-        printk("---------- END ASIC3 GPIO%d DUMP\n", gpiobase/0x100);
-}
+static struct resource h4000_asic3_resources[] = {
+        [0] = {
+                .start  = H4000_ASIC3_PHYS,
+                .end    = H4000_ASIC3_PHYS + 0xfffff,
+                .flags  = IORESOURCE_MEM,
+        },
+};
+
+static struct platform_device h4000_asic3_device = {
+        .name           = "h4000_asic3",
+        .id             = 0,
+        .num_resources  = ARRAY_SIZE(h4000_asic3_resources),
+        .resource       = h4000_asic3_resources,
+        .dev = { .platform_data = &h4000_asic3_platform_data, },
+};
+
+static struct platform_device *devices[] __initdata = {
+        &h4000_asic3_device,
+};
+
+static struct ipaq_model_ops h4000_model_ops __initdata = {
+        .generic_name = "h4000",
+/*        .control = h4000_control_egpio, */
+/*        .read = h4000_read_egpio, */
+/*        .irq_number = h4000_egpio_irq_number, */
+/*        .set_led = ipaq_asic3_set_led,*/
+};
 
 /*
-CS3#
-   0xA7000000, 0x0C000000, 1 ;HTC Asic3 chip select
-CS4#
-   0xBD900000, 0x10000000, 1 ;SD I/O controller
-CS5#
-   0xBDE00000, 0x14000000, 1 ;DBG LED REGISTER
-   0xBDF00000, 0x15000000, 1 ;DBG LAN REGISTER
-   0xBE000000, 0x16000000, 1 ;DBG PPSH REGISTER
-*/
+CS3#    0x0C000000, 1 ;HTC Asic3 chip select
+CS4#    0x10000000, 1 ;SD I/O controller
+CS5#    0x14000000, 1 ;DBG LED REGISTER
+        0x15000000, 1 ;DBG LAN REGISTER
+        0x16000000, 1 ;DBG PPSH REGISTER */
+
 static struct map_desc h4000_io_desc[] __initdata = {
-    { 0xf3800000, PXA_CS3_PHYS,  0x02000000, MT_DEVICE},
+       /* virtual   , physical  , length    , type */
+        { H4000_ASIC3_VIRT, H4000_ASIC3_PHYS, 0x00100000, MT_DEVICE },
 };
 
 static void __init h4000_init_irq(void)
 {
-    pxa_init_irq();
+        pxa_init_irq();
+
+        setup_irq(IRQ_GPIO(GPIO_NR_H4000_SERIAL_DETECT), &h4000_rs232_irq);
+        set_irq_type(IRQ_GPIO(GPIO_NR_H4000_SERIAL_DETECT), IRQT_BOTHEDGE);
 }
 
 static void __init h4000_map_io(void)
 {
-    pxa_map_io();
-    iotable_init(h4000_io_desc, ARRAY_SIZE(h4000_io_desc));
-    
-    /* Wake up enable. */
-    PWER = PWER_GPIO0 | PWER_RTC;
-    /* Wake up on falling edge. */
-    PFER = PWER_GPIO0 | PWER_RTC;
-    /* Wake up on rising edge. */
-    PRER = 0;
-    /* 3.6864 MHz oscillator power-down enable */
-    PCFR = PCFR_OPDE;
-
-    /* Turn on GAFR 34-41 for FFUART to work. We should probably 
-     * add a "is serial cord plugged in" function .*/
-    GAFR1_L |= 0x000a9450;
-
-    /* Initialize the ASIC */
-    IPAQ_ASIC3_CLOCK_CDEX(IPAQ_ASIC3_VIRT) = 0x26c3;
-    IPAQ_ASIC3_CLOCK_SEL(IPAQ_ASIC3_VIRT)  = 0x0007;
-
-    IPAQ_ASIC3_GPIO_A_MASK(IPAQ_ASIC3_VIRT)                 = 0xffff;
-    IPAQ_ASIC3_GPIO_A_DIR(IPAQ_ASIC3_VIRT)                  = 0xfc7f;
-    IPAQ_ASIC3_GPIO_A_LEVELTRI(IPAQ_ASIC3_VIRT)             = 0x0000;
-    IPAQ_ASIC3_GPIO_A_RISING(IPAQ_ASIC3_VIRT)               = 0x0000;
-    IPAQ_ASIC3_GPIO_A_LEVEL(IPAQ_ASIC3_VIRT)                = 0x0000;
-    IPAQ_ASIC3_GPIO_A_SLEEP_MASK(IPAQ_ASIC3_VIRT)           = 0xffff;
-    IPAQ_ASIC3_GPIO_A_SLEEP_OUT(IPAQ_ASIC3_VIRT)            = 0x0000;
-    IPAQ_ASIC3_GPIO_A_BATT_FAULT_OUT(IPAQ_ASIC3_VIRT)       = 0x0000;
-    IPAQ_ASIC3_GPIO_A_INT_STATUS(IPAQ_ASIC3_VIRT)           = 0x0000;
-    IPAQ_ASIC3_GPIO_A_SLEEP_CONF(IPAQ_ASIC3_VIRT)           = 0x000c;
-    /* (1<<6) turns on serial */
-    IPAQ_ASIC3_GPIO_A_OUT(IPAQ_ASIC3_VIRT)                  = 0x0000 | (1<<6);
-    
-    IPAQ_ASIC3_GPIO_B_MASK(IPAQ_ASIC3_VIRT)                 = 0xffff;
-    IPAQ_ASIC3_GPIO_B_DIR(IPAQ_ASIC3_VIRT)                  = 0xddbf; //0xdfbf
-    IPAQ_ASIC3_GPIO_B_LEVELTRI(IPAQ_ASIC3_VIRT)             = 0x0000;
-    IPAQ_ASIC3_GPIO_B_RISING(IPAQ_ASIC3_VIRT)               = 0x0000;
-    IPAQ_ASIC3_GPIO_B_LEVEL(IPAQ_ASIC3_VIRT)                = 0x0000;
-    IPAQ_ASIC3_GPIO_B_SLEEP_MASK(IPAQ_ASIC3_VIRT)           = 0xffff;
-    IPAQ_ASIC3_GPIO_B_SLEEP_OUT(IPAQ_ASIC3_VIRT)            = 0x0000;
-    IPAQ_ASIC3_GPIO_B_BATT_FAULT_OUT(IPAQ_ASIC3_VIRT)       = 0x0000;
-    IPAQ_ASIC3_GPIO_B_INT_STATUS(IPAQ_ASIC3_VIRT)           = 0x0000;
-    IPAQ_ASIC3_GPIO_B_SLEEP_CONF(IPAQ_ASIC3_VIRT)           = 0x000c;
-    IPAQ_ASIC3_GPIO_B_OUT(IPAQ_ASIC3_VIRT)                  = 0x1c00;
-    
-    IPAQ_ASIC3_GPIO_C_MASK(IPAQ_ASIC3_VIRT)                 = 0xffff;
-    IPAQ_ASIC3_GPIO_C_DIR(IPAQ_ASIC3_VIRT)                  = 0xffff;
-    IPAQ_ASIC3_GPIO_C_LEVELTRI(IPAQ_ASIC3_VIRT)             = 0x0000;
-    IPAQ_ASIC3_GPIO_C_RISING(IPAQ_ASIC3_VIRT)               = 0x0000;
-    IPAQ_ASIC3_GPIO_C_LEVEL(IPAQ_ASIC3_VIRT)                = 0x0000;
-    IPAQ_ASIC3_GPIO_C_SLEEP_MASK(IPAQ_ASIC3_VIRT)           = 0xffff;
-    IPAQ_ASIC3_GPIO_C_SLEEP_OUT(IPAQ_ASIC3_VIRT)            = 0x4000;
-    IPAQ_ASIC3_GPIO_C_BATT_FAULT_OUT(IPAQ_ASIC3_VIRT)       = 0x4000;
-    IPAQ_ASIC3_GPIO_C_INT_STATUS(IPAQ_ASIC3_VIRT)           = 0x0000;
-    IPAQ_ASIC3_GPIO_OFFSET(IPAQ_ASIC3_VIRT, u16, C, AltFunction) = 0x0003;
-    IPAQ_ASIC3_GPIO_C_SLEEP_CONF(IPAQ_ASIC3_VIRT)           = 0x000c;
-    IPAQ_ASIC3_GPIO_C_OUT(IPAQ_ASIC3_VIRT)                  = 0x4700;
-    
-    IPAQ_ASIC3_GPIO_D_MASK(IPAQ_ASIC3_VIRT)                 = 0xff03;
-    IPAQ_ASIC3_GPIO_D_DIR(IPAQ_ASIC3_VIRT)                  = 0xef03;
-    IPAQ_ASIC3_GPIO_D_LEVELTRI(IPAQ_ASIC3_VIRT)             = 0x00fc;
-    IPAQ_ASIC3_GPIO_D_RISING(IPAQ_ASIC3_VIRT)               = 0x0080;
-    IPAQ_ASIC3_GPIO_D_LEVEL(IPAQ_ASIC3_VIRT)                = 0x0000;
-    IPAQ_ASIC3_GPIO_D_SLEEP_MASK(IPAQ_ASIC3_VIRT)           = 0xff83;
-    IPAQ_ASIC3_GPIO_D_SLEEP_OUT(IPAQ_ASIC3_VIRT)            = 0x0100;
-    IPAQ_ASIC3_GPIO_D_BATT_FAULT_OUT(IPAQ_ASIC3_VIRT)       = 0x0100;
-    IPAQ_ASIC3_GPIO_D_INT_STATUS(IPAQ_ASIC3_VIRT)           = 0x0000;
-    IPAQ_ASIC3_GPIO_D_SLEEP_CONF(IPAQ_ASIC3_VIRT)           = 0x000c;
-    /* (1<<14) turns on usb */
-    IPAQ_ASIC3_GPIO_D_OUT(IPAQ_ASIC3_VIRT)                  = 0x0f02 | (1<<14);
-    
-    IPAQ_ASIC3_INTR_IntMask(IPAQ_ASIC3_VIRT)= 0x0003;
-    IPAQ_ASIC3_INTR_IntCPS(IPAQ_ASIC3_VIRT) = 0x001e;
-    IPAQ_ASIC3_INTR_IntTBS(IPAQ_ASIC3_VIRT) = 0x000a;
-    
-    ipaq_model_ops = h4000_model_ops;
+        pxa_map_io();
+        iotable_init(h4000_io_desc, ARRAY_SIZE(h4000_io_desc));
+
+        /* Wake up enable. */
+        PWER = PWER_GPIO0 | PWER_RTC;
+        /* Wake up on falling edge. */
+        PFER = PWER_GPIO0 | PWER_RTC;
+        /* Wake up on rising edge. */
+        PRER = 0;
+        /* 3.6864 MHz oscillator power-down enable */
+        PCFR = PCFR_OPDE;
+
+        /* Initialize the ASIC */
+        //IPAQ_ASIC3_CLOCK_CDEX(H4000_ASIC3_VIRT) = 0x26c3;
+        //IPAQ_ASIC3_CLOCK_SEL(H4000_ASIC3_VIRT)  = 0x0007;
+    
+        //IPAQ_ASIC3_INTR_IntMask(H4000_ASIC3_VIRT)= 0x0003;
+        //IPAQ_ASIC3_INTR_IntCPS(H4000_ASIC3_VIRT) = 0x001e;
+        //IPAQ_ASIC3_INTR_IntTBS(H4000_ASIC3_VIRT) = 0x000a;
+
+        ipaq_model_ops = h4000_model_ops;
 }
 
+                        
 static void __init h4000_init(void)
 {
-    pxa_set_udc_info(&h4000_udc_mach_info);
+        pxa_set_udc_info(&h4000_udc_info);
+        platform_add_devices(devices, ARRAY_SIZE(devices));
 }
 
 MACHINE_START(H4000, "HP iPAQ h4000")
-MAINTAINER("your name here")
-BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
-BOOT_PARAMS(0xa0000100)
-MAPIO(h4000_map_io)
-INITIRQ(h4000_init_irq) INIT_MACHINE(h4000_init) MACHINE_END
+        MAINTAINER("h4000 port team h4100-port@handhelds.org")
+        BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
+        BOOT_PARAMS(0xa0000100)
+        MAPIO(h4000_map_io)
+        INITIRQ(h4000_init_irq)
+        INIT_MACHINE(h4000_init)
+MACHINE_END
diff -urN kernel26/include/asm-arm/arch-pxa/h4000-asic.h kernel26_h4000/include/asm-arm/arch-pxa/h4000-asic.h
--- kernel26/include/asm-arm/arch-pxa/h4000-asic.h	1969-12-31 17:00:00.000000000 -0700
+++ kernel26_h4000/include/asm-arm/arch-pxa/h4000-asic.h	2004-05-06 21:36:23.000000000 -0600
@@ -0,0 +1,56 @@
+/*
+ * Definitions for H4000 Handheld Computer
+ *
+ * Use consistent with the GNU GPL is permitted,
+ * provided that this copyright notice is
+ * preserved in its entirety in all copies and derived works.
+ *
+ * Changelog:
+ * 	may 2004: initial version,  shawn anderson <sa at xmission.com>
+ *
+ * Work in progress... please help if you can :-), thx
+ */
+
+#ifndef _INCLUDE_H4000_ASIC_H_ 
+#define _INCLUDE_H4000_ASIC_H_
+
+#include <asm/hardware/ipaq-asic3.h>
+
+#ifdef CONFIG_MACH_H4000
+
+/* H4000, ASIC3 at CS3# 0x0c000000 */
+#define H4000_ASIC3_VIRT 0xf8000000
+#define H4000_ASIC3_PHYS 0x0c000000
+
+/* ASIC3 GPIO_A */
+
+#define GPIOA_RS232_ON           (1<<6)
+
+/* ASIC3 GPIO_B */
+
+#define GPIOB_BACKLIGHT_POWER_ON (1<<10) /* Lcd Backlight */
+#define GPIOB_LCD_PCI            (1<<11) /* Connects to PDWN on LCD controller*/
+#define GPIOB_LCD_ON             (1<<12)
+
+/* ASIC3 GPIO_C */
+
+//#define GPIOC_BLUETOOTH_X      (1<<15) /* bluetooth related */
+//(1<<14) /* :defaults */
+//#define GPIOC_BLUETOOTH_XX     (1<<12) /* bluetooth related */
+#define GPIOC_WLAN_POWER_ON      (1<<11) /* 802.11b */
+//(1<<10) /* :defaults */
+//(1<<9)  /* :defaults */
+//(1<<8)  /* :defaults */
+//(1<<5)  /* keyboard related (h4350 only) */
+//(1<<4)  /* keyboard related (h4350 only) */
+//(1<<3)  /* keyboard related (h4350 only) */
+
+/* ASIC3 GPIO_D */
+
+#define GPIOD_USB_ON             (1<<14) /* USB enable */
+//(1<<11) /* :defaults */
+//(1<<10) /* :defaults */
+//(1<<9)  /* :defaults */
+#define GPIOD_IR_ON              (1<<8)
+//(1<<1)  /* :defaults */
+#define GPIOD_USB_PULLUP         (1<<0) /* USB pullup */
+
+#endif  /* CONFIG_MACH_H4000 */
+#endif  /* _INCLUDE_H4000_ASIC_H_ */
+
diff -urN kernel26/include/asm-arm/arch-pxa/h4000-gpio.h kernel26_h4000/include/asm-arm/arch-pxa/h4000-gpio.h
--- kernel26/include/asm-arm/arch-pxa/h4000-gpio.h	2004-04-01 23:14:18.000000000 -0700
+++ kernel26_h4000/include/asm-arm/arch-pxa/h4000-gpio.h	2004-05-06 21:35:21.000000000 -0600
@@ -1,3 +1,4 @@
+
 #ifndef _H4000_GPIO_H_
 #define _H4000_GPIO_H_
 
@@ -21,60 +22,37 @@
 } while (0)
 
 
-/* FIXME: Active-low signals are denoted by suffix _N  */
-/* AF == Alternate Function, FE == falling edge, RE == Rising edge */
+/* Active-low signals are denoted by suffix _N  */
+/* FE == falling edge, RE == Rising edge */
 
-#define GPIO_NR_H4000_POWER_BUTTON_N (0)                  /* ; RE FE; Input */
-#define GPIO_NR_H4000_RESET_BUTTON_N (1)                    /* AF 1 ; Input */
-#define GPIO_NR_H4000_SD_DETECT_N (2)     /* SD Card insert ; RE FE ; Input */
-#define GPIO_NR_H4000_CHARGING_N (3)         /* is it charging ; FE ; Input */
-#define GPIO_NR_H4000_AC_IN_N (4)       /* Power plugged in ; RE FE ; Input */
-#define GPIO_NR_H4000_BATTERY_DOOR_N (5)                           /* Input */
-//#define GPIO_NR_H4000_ (6)                                       /* Input */
-//#define GPIO_NR_H4000_ (7)                                 /*; FE ; Input */
-//#define GPIO_NR_H4000_ (8)                                /* ; FE ; Input */
-//#define GPIO_NR_H4000_ (9)    /* Button/keyboard h4350 only? ; RE ; Input */
-#define GPIO_NR_H4000_USB_DETECT_N (10) /* usb is connected ; RE FE ; Input */
-//#define GPIO_NR_H4000_ (11)              /* Wireless 802.11b ; FE ; Input */
-//#define GPIO_NR_H4000_ (12)                               /* AF 1 ; Output*/
-#define GPIO_NR_H4000_SERIAL_DETECT (13) /*serial connected ; RE FE ; Input */
-//#define GPIO_NR_H4000_ (14)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (15)                                    /* ; Output*/
-#define GPIO_NR_H4000_LCD_PWM (16)                          /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (17)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (18)                               /* AF 1 ; Input */
-#define GPIO_NR_H4000_UP_BUTTON_N (19)                /* h4150 Only ; Input */
-#define GPIO_NR_H4000_LEFT_BUTTON_N (20)              /* h4150 Only ; Input */
-#define GPIO_NR_H4000_ACTION_BUTTON_N (21)            /* h4150 Only ; Input */
-#define GPIO_NR_H4000_DOWN_BUTTON_N (22)              /* h4150 Only ; Input */
-/* 23 - 26 SSP Alternate Function GPIOs see pxa-regs.h */
-#define GPIO_NR_H4000_PEN_IRQ_N (27)                          /* FE ; Input */
-/* 28 - 32 I2S ??? */
-//#define GPIO_NR_H4000_ (33)                               /* AF 2 ; Output*/
-/* 34 - 41 FFUART ?? */
-/* 42 - 45 are Alternate function 3 when bluetooth is on */
-#define GPIO_NR_H4000_IRDA_RXD (46)       /* IrDA beam receive AF 2 ; Input */
-#define GPIO_NR_H4000_IRDA_TXD (47)      /* IrDA beam transmit AF 1 ; Output*/
-//#define GPIO_NR_H4000_ (48)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (49)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (50)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (51)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (52)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (53)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (54)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (55)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (56)                               /* AF 1 ; Input */
-//#define GPIO_NR_H4000_ (57)                               /* AF 1 ; Input */
-/* 58 to 73 Alternate functions */
-//#define GPIO_NR_H4000_ (74)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (75)                                    /* ; Output*/
-//#define GPIO_NR_H4000_ (76)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (77)                               /* AF 2 ; Output*/
-#define GPIO_NR_H4000_RIGHT_BUTTON_N (78)             /* h4150 Only ; Input*/
-//#define GPIO_NR_H4000_ (79)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (80)                               /* AF 2 ; Output*/
-//#define GPIO_NR_H4000_ (81)                                      /* Input */
-//#define GPIO_NR_H4000_ (82)                                      /* Input */
-//#define GPIO_NR_H4000_ (83)                                      /* Input */
+#define GPIO_NR_H4000_POWER_BUTTON_N  0                  /* ; RE FE ; Input */
+#define GPIO_NR_H4000_SD_DETECT_N     2  /* SD Card insert  ; RE FE ; Input */
+#define GPIO_NR_H4000_CHARGING        3  /* is it charging     ; FE ; Input */
+#define GPIO_NR_H4000_AC_IN_N         4  /* Power plugged in; RE FE ; Input */
+#define GPIO_NR_H4000_BATTERY_DOOR    5                            /* Input */
+//#define GPIO_NR_H4000_              6                            /* Input */
+//#define GPIO_NR_H4000_              7                     /* ; FE ; Input */
+//#define GPIO_NR_H4000_              8                     /* ; FE ; Input */
+//#define GPIO_NR_H4000_              9  /* Asic3 interrupt ?  ; RE ; Input */
+#define GPIO_NR_H4000_USB_DETECT_N    10 /* USB is connected; RE FE ; Input */
+//#define GPIO_NR_H4000_              11 /* Wireless 802.11b   ; FE ; Input */
+#define GPIO_NR_H4000_SERIAL_DETECT   13 /* serial connected; RE FE ; Input */
+//#define GPIO_NR_H4000_              14                         /* ; Output*/
+//#define GPIO_NR_H4000_              15                         /* ; Output*/
+//#define GPIO_NR_H4000_              17                         /* ; Output*/
+#define GPIO_NR_H4000_UP_BUTTON_N     19 /* h4150 Only              ; Input */
+#define GPIO_NR_H4000_LEFT_BUTTON_N   20 /* h4150 Only              ; Input */
+#define GPIO_NR_H4000_ACTION_BUTTON_N 21 /* h4150 Only              ; Input */
+#define GPIO_NR_H4000_DOWN_BUTTON_N   22 /* h4150 Only              ; Input */
+#define GPIO_NR_H4000_PEN_IRQ_N       27                      /* FE ; Input */
+//#define GPIO_NR_H4000_              50                         /* ; Output*/
+//#define GPIO_NR_H4000_              51                         /* ; Output*/
+//#define GPIO_NR_H4000_              54                         /* ; Output*/
+//#define GPIO_NR_H4000_              74                         /* ; Output*/
+//#define GPIO_NR_H4000_              75                         /* ; Output*/
+#define GPIO_NR_H4000_RIGHT_BUTTON_N  78 /* h4150 Only              ; Input*/
+//#define GPIO_NR_H4000_              81                           /* Input */
+//#define GPIO_NR_H4000_              82                           /* Input */
+//#define GPIO_NR_H4000_              83                           /* Input */
 
 #endif /* _H4000_GPIO_H_ */
diff -urN kernel26/include/asm-arm/arch-pxa/h4000-init.h kernel26_h4000/include/asm-arm/arch-pxa/h4000-init.h
--- kernel26/include/asm-arm/arch-pxa/h4000-init.h	1969-12-31 17:00:00.000000000 -0700
+++ kernel26_h4000/include/asm-arm/arch-pxa/h4000-init.h	2004-05-06 21:35:21.000000000 -0600
@@ -0,0 +1,89 @@
+/** Initial GPIO register setup for the iPAQ h4xxx. */
+
+#ifndef _H4000_INIT_H_
+#define _H4000_INIT_H_
+
+/************ GPIO pin direction setup; 0 = input, 1 = output *****************/
+/* 1111 0011 1000 0011 1101 0000 0000 0000 */
+#define GPDR0_InitValue        0xf383d000 
+/* 1111 1100 1111 1111 1011 1111 1111 1111 */
+#define GPDR1_InitValue        0xfcffbfff
+/* xxxx xxxx xxx0 0001 1011 1111 1111 1111 */
+#define GPDR2_InitValue        0x0001bfff
+
+/************ GPIO Alternate Function (Select Function 0 ~ 3) *****************/
+/* 0000 0000 0000 0000 0000 0000 0000 0100 */
+#define GAFR0_L_InitValue 0x00000004
+/* 0000 0000 0001 1010 1000 0000 0001 0010 */
+#define GAFR0_U_InitValue 0x001a8012
+/* 0110 0000 0000 0000 0000 0000 0000 1000 */
+#define GAFR1_L_InitValue (0x60000008 | 0xa9450) /* 0xa9450 connects FFUART*/
+/* 1010 1010 1010 0101 1000 1010 0000 1010 */
+#define GAFR1_U_InitValue 0xaaa58a0a
+/* 1000 1010 0000 1010 1010 1010 1010 1010 */
+#define GAFR2_L_InitValue 0x8a0aaaaa
+/* 0000 0000 0000 0000 0000 0000 0000 0010 */
+#define GAFR2_U_InitValue 0x00000002
+
+/************ GPIO Pin Sleep Level ********************************************/
+/* 0000 0001 0000 0010 0000 0000 0000 0000 */
+#define PGSR0_SleepValue 0x01020000
+/* 0000 0000 1111 0011 0000 0011 0001 0010 */
+#define PGSR1_SleepValue 0x00f30312
+/* xxxx xxxx xxx0 0001 1000 0000 0000 0000 */
+#define PGSR2_SleepValue 0x00018000
+
+
+/************ GPIO Pin Init State *********************************************/
+/*      v-----------------------------------27 PEN_IRQ */
+/*      |  v-------------------------------=24 AF2o SSP Frame */
+/*      |  .  v-----------------------------22 DOWN_BUTTON h4150 */
+/*      |  .  |v----------------------------21 ACTION_BUTTON h4150 */
+/*      |  .  ||v---------------------------20 LEFT_BUTTON h4150 */
+/*      |  .  ||| v-------------------------19 UP_BUTTON h4150 */
+/*      |  .  ||| |v------------------------18 AF1i Ext. Bus Ready */
+/*      |  .  ||| ||v-----------------------17  */
+/*      |  .  ||| |||       v---------------11 (802.11b) */
+/*      |  .  ||| |||       |v--------------10 USB_DETECT */
+/*      |  .  ||| |||       || v------------8 */
+/*      |  .  ||| |||       || | v----------7 */
+/*      |  .  ||| |||       || | |v---------6 */
+/*      |  .  ||| |||       || | || v-------4  AC_IN */
+/*      |  .  ||| |||       || | || |   v---1  AF1i Active low GP_reset */
+/*      |  .  ||| |||       || | || |   |v--0  POWER_BUTTON */
+/*         s        s                      */
+/*      ii    iii ii     i  iiii iiii iiii */
+/*       AAA A     A A                  A  */
+/* 0000 0001 0000 0010 0000 0000 0000 0000 */
+#define GPSR0_InitValue    0x1020000
+
+/*         v-------------------------------56 AF1i Wait signal for Card Space */
+/*         | v----------------------------=55 AF2o Card Address bit 26 */
+/*         | |v----------------------------54 */
+/*         | ||v--------------------------=53 AF2o Card Enable for Card Space */
+/*         | |||v-------------------------=52 AF2o Card Enable for Card Space */
+/*         | ||||   v---------------------=49 AF2o Write Enable for Card Space */
+/*         | ||||   |v--------------------=48 AF2o Output Enable for Card Space*/
+/*         | ||||   || v------------------=47 */
+/*         | ||||   || |v-----------------=46 */
+/*         | ||||   || ||     v-----------=41 AF2o FFUART request to send */
+/*         | ||||   || ||     .v----------=40 AF2o FFUART data terminal Ready */
+/*         | ||||   || ||     ..    v------36 AF1i FFUART Data carrier detect */
+/*         | ||||   || ||     ..    |   v--33 AF2o Active low chip select 5  */
+/*           ssss   ss        ss    s      */
+/*        ii            i                  */
+/* AAAA AAAA A AA   AA AA               A  */
+/* 0000 0000 1111 0011 1000 0000 0000 0010 */
+#define GPSR1_InitValue  0xf38002
+
+/*                   v----------------------80 AF2o Active low chip select 4 */
+/*                   | v--------------------79 AF2o Active low chip select 3 */
+/*                   | |v-------------------78 RIGHT_BUTTON h4150 */
+/*                   | ||v------------------77 AF2o LCD AC Bias */
+/* xxxx xxxx xxx     s s                   */
+/* xxxx xxxx xxxi iii   i                  */
+/* xxxx xxxx xxx     A A AA   AA AAAA AAAA */
+/*              0 0001 1010 0000 0000 0000 */
+#define GPSR2_InitValue   0x1a000
+
+#endif /* _H4000_INIT_H_ */

