Index: linux-2.6.11/include/asm-arm/arch-pxa/hx2750.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.11/include/asm-arm/arch-pxa/hx2750.h	2005-04-06 10:10:32.000000000 +0100
@@ -0,0 +1,88 @@
+/*
+ * Hardware specific definitions for iPAQ hx2750
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASM_ARCH_HX2750_H
+#define __ASM_ARCH_HX2750_H  1
+
+/*
+ * HX2750 (Non Standard) GPIO Definitions
+ */
+
+#define HX2750_GPIO_KEYPWR      (0)    /* Power button */
+#define HX2750_GPIO_BATTCOVER1  (9)    /* Battery Cover Switch */
+#define HX2750_GPIO_CF_IRQ      (11)   /* CF IRQ? */
+#define HX2750_GPIO_USBCONNECT  (12)   /* USB Connected? */
+#define HX2750_GPIO_CF_DETECT   (13)   /* CF Card Detect? */
+#define HX2750_GPIO_EXTPWR      (14)   /* External Power Detect? */
+#define HX2750_GPIO_CF_PWR      (17)   /* CF Power? */
+#define HX2750_GPIO_SR_STROBE   (18)   /* Shift Register Strobe */
+#define HX2750_GPIO_CHARGE      (22)   /* Charging Enable (active low)? */
+#define HX2750_GPIO_TSC2102_SS  (24)   /* TSC2101 SS# */
+#define HX2750_GPIO_BTPWR       (27)   /* Bluetooth Power? */
+#define HX2750_GPIO_BATTCOVER2  (33)   /* Battery Cover Switch */
+#define HX2750_GPIO_SD_DETECT   (38)   /* MMC Card Detect */
+#define HX2750_GPIO_SR_CLK1     (52)   /* Shift Register Clock */
+#define HX2750_GPIO_SR_CLK2     (53)   
+#define HX2750_GPIO_CF_WIFIIRQ  (54)   /* CF Wifi IRQ? */
+#define HX2750_GPIO_GPIO_DIN    (88)   /* Shift Register Data */
+#define HX2750_GPIO_KEYLEFT     (90)   /* Left button */
+#define HX2750_GPIO_KEYRIGHT    (91)   /* Right button */
+#define HX2750_GPIO_KEYCAL      (93)   /* Calander button */
+#define HX2750_GPIO_KEYTASK     (94)   /* Task button */
+#define HX2750_GPIO_KEYSIDE     (95)   /* Side button */
+#define HX2750_GPIO_KEYENTER    (96)   /* Enter Button*/
+#define HX2750_GPIO_KEYCON      (97)   /* Contacts button */
+#define HX2750_GPIO_KEYMAIL     (98)   /* Mail button */
+#define HX2750_GPIO_BIOPWR      (99)   /* BIO Reader Power? */
+#define HX2750_GPIO_KEYUP       (100)  /* Up button */
+#define HX2750_GPIO_KEYDOWN     (101)  /* Down button*/
+#define HX2750_GPIO_SD_READONLY (103)  /* MMC/SD Write Protection */
+#define HX2750_GPIO_LEDMAIL     (106)  /* Green Mail LED */
+#define HX2750_GPIO_HP_JACK     (108)  /* Head Phone Jack Present */
+#define HX2750_GPIO_PENDOWN     (117)  /* Touch Screen Pendown */
+
+
+//#define HX2750_GPIO_     () /* */
+
+/*
+ * HX2750 Interrupts
+ */
+#define HX2750_IRQ_GPIO_SD_DETECT	IRQ_GPIO(HX2750_GPIO_SD_DETECT)
+#define HX2750_IRQ_GPIO_PENDOWN     IRQ_GPIO(HX2750_GPIO_PENDOWN)
+#define HX2750_IRQ_GPIO_CF_DETECT   IRQ_GPIO(HX2750_GPIO_CF_DETECT)
+#define HX2750_IRQ_GPIO_CF_IRQ      IRQ_GPIO(HX2750_GPIO_CF_IRQ)
+#define HX2750_IRQ_GPIO_CF_WIFIIRQ  IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ)
+
+/*
+ * HX2750 Extra GPIO Definitions
+ */
+
+#define HX2750_EGPIO_WIFI_PWR	(1 << 11)  /* Triggers gpio 54 - Wifi enable? */
+#define HX2750_EGPIO_LCD_PWR	(1 << 10)  /* LCD Power */
+#define HX2750_EGPIO_BL_PWR     (1 << 9)   /* Backlight LED Power */
+#define HX2750_EGPIO_8          (1 << 8)   /* */
+#define HX2750_EGPIO_7          (1 << 7)   /* */
+#define HX2750_EGPIO_SD_PWR     (1 << 6)   /* SD Power? */
+#define HX2750_EGPIO_5          (1 << 5)   /* */
+#define HX2750_EGPIO_4          (1 << 4)   /* */
+#define HX2750_EGPIO_CF1_RESET  (1 << 3)   /* Triggers gpio 54 - CF1 Reset? */
+#define HX2750_EGPIO_2          (1 << 2)   /* */
+#define HX2750_EGPIO_1          (1 << 1)   /* */
+#define HX2750_EGPIO_PWRLED     (1 << 0)   /* Red Power LED */
+
+
+void hx2750_set_egpio(unsigned int gpio);
+void hx2750_clear_egpio(unsigned int gpio);
+
+
+#endif /* __ASM_ARCH_HX2750_H  */
+
Index: linux-2.6.11/arch/arm/mach-pxa/Makefile
===================================================================
--- linux-2.6.11.orig/arch/arm/mach-pxa/Makefile	2005-03-02 07:38:09.000000000 +0000
+++ linux-2.6.11/arch/arm/mach-pxa/Makefile	2005-04-21 16:10:25.000000000 +0100
@@ -12,6 +12,7 @@
 obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
 obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
 obj-$(CONFIG_PXA_SHARPSL)	+= corgi.o corgi_ssp.o ssp.o
+obj-$(CONFIG_MACH_HX2750)	+= hx2750.o hx2750_test.o ssp.o
 
 # Support for blinky lights
 led-y := leds.o
@@ -23,3 +24,5 @@
 
 # Misc features
 obj-$(CONFIG_PM) += pm.o sleep.o
+
+
Index: linux-2.6.11/arch/arm/mach-pxa/hx2750_test.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.11/arch/arm/mach-pxa/hx2750_test.c	2005-04-21 13:54:59.000000000 +0100
@@ -0,0 +1,333 @@
+/*
+ * HP iPAQ hx2750 Test Development Code
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/input.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/mach/arch.h>
+
+#include <asm/arch/hx2750.h>
+#include <asm/arch/pxa-regs.h>
+ 
+
+static int prodval;
+
+/*    
+ * Sysfs functions       
+ */   
+static ssize_t test1_show(struct device *dev, char *buf) 
+{
+	unsigned long rp;
+
+	asm ("mrc	p15, 0, %0, cr1, cr0;\n" :"=r"(rp) ); 
+	printk("%lx\n",rp);
+	
+	asm ("mrc	p15, 0, %0, cr1, cr1;\n" :"=r"(rp) ); 
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr2, cr0;\n" :"=r"(rp) ); 
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr3, cr0;\n" :"=r"(rp) ); 
+	printk("%lx\n",rp);
+
+	asm ("mrc	p15, 0, %0, cr13, cr0;\n" :"=r"(rp) ); 
+	printk("%lx\n",rp);
+		
+	return sprintf(buf, "%d\n",prodval); 
+}
+ 
+static ssize_t test1_store(struct device *dev, const char *buf, size_t count)
+{
+	prodval = simple_strtoul(buf, NULL, 10);  
+ 
+	return count;
+}
+ 
+static DEVICE_ATTR(test1, 0644, test1_show, test1_store);
+
+static ssize_t test2_show(struct device *dev, char *buf) 
+{
+	hx2750_ssp_init2();
+ 
+	return sprintf(buf, "%d\n",0); 
+} 
+
+static DEVICE_ATTR(test2, 0444, test2_show, NULL);
+
+static ssize_t sendegpio_store(struct device *dev, const char *buf, size_t count)
+{
+	unsigned int val = simple_strtoul(buf, NULL, 16);
+	
+	printk("Sending: %x\n",val);
+
+	/* Bootloader default 0x484 */
+	/* 0100 1000 0100 */
+
+	hx2750_send_egpio(val);
+
+	return count; 
+} 
+
+static DEVICE_ATTR(sendegpio, 0644, NULL, sendegpio_store);
+
+
+static ssize_t gpioclr_store(struct device *dev, const char *buf, size_t count)
+{
+	int prod;
+	prod = simple_strtoul(buf, NULL, 10);  
+
+	GPCR(prod) = GPIO_bit(prod);
+ 
+	return count;
+}
+ 
+static DEVICE_ATTR(gpioclr, 0200, NULL, gpioclr_store);
+
+static ssize_t gpioset_store(struct device *dev, const char *buf, size_t count)
+{
+	int prod;
+	prod = simple_strtoul(buf, NULL, 10);  
+
+	GPSR(prod) = GPIO_bit(prod);
+ 
+	return count;
+}
+ 
+static DEVICE_ATTR(gpioset, 0200, NULL, gpioset_store);
+
+
+
+
+static ssize_t sspr_store(struct device *dev, const char *buf, size_t count)
+{        
+	unsigned long val,ret;        
+	sscanf(buf, "%lx %lx", &val, &ret);
+	
+	hx2750_tsc2101_send(1<<15,val,&ret,1);
+	
+	return count;
+}   
+
+static DEVICE_ATTR(sspr, 0200, NULL, sspr_store);
+ 
+static ssize_t sspw_store(struct device *dev, const char *buf, size_t count)
+{        
+	int val,ret;        
+	val = simple_strtoul(buf, NULL, 16);   
+	
+	hx2750_tsc2101_send(0,val,&ret,1);
+	
+	printk("Response: %x\n",ret);  
+ 
+	return count;
+}   
+
+static DEVICE_ATTR(sspw, 0200, NULL, sspw_store);
+
+
+extern struct pm_ops pxa_pm_ops;
+extern void pxa_cpu_resume(void);
+
+static int (*pxa_pm_enter_orig)(suspend_state_t state);
+
+//static struct {
+//	u32 ffier, fflcr, ffmcr, ffspr, ffisr, ffdll, ffdlh;
+//} sys_ctx;
+
+u32 resstruct[20];
+
+static int hx2750_pxa_pm_enter(suspend_state_t state)
+{
+	int i;
+	u32 save[10];
+
+	PWER = 0xC0000003;// | PWER_RTC;
+	PFER = 0x00000003;
+	PRER = 0x00000003;
+	
+	PGSR0=0x00000018;
+	PGSR1=0x00000380;
+	PGSR2=0x00800000;
+	PGSR3=0x00500400;
+		
+	//PVCR=0x494; or 0x14;
+	//PVCR=0x14;
+	//PCMD0=0x41f;
+	//i=PISR;
+	//PICR=0x00000062;
+	
+	//PCFR=0x457;
+	//PCFR=0x70; // Does not resume from sleep
+	PCFR=0x077; // was 0x477
+	PSLR=0xff100004;
+	
+	resstruct[0]=0x0000b4e6;
+	resstruct[1]=0x00000001;
+	resstruct[2]=virt_to_phys(pxa_cpu_resume);
+	resstruct[3]=0xffffffff; //value for r0
+
+	resstruct[14]=0x00000078;  //mcr	15, 0, r0, cr1, cr0, {0}
+	resstruct[15]=0x00000000;  //mcr	15, 0, r0, cr1, cr1, {0} 0xffffffff
+	resstruct[16]=0xa0000000;  //mcr	15, 0, r0, cr2, cr0, {0} 0xa0748000
+	resstruct[17]=0x00000001;  //mcr	15, 0, r0, cr3, cr0, {0} 0x00000015
+	resstruct[18]=0x00000000;  //mcr	15, 0, r0, cr13, cr0, {0} 0x00000000
+	
+	hx2750_send_egpio(3);
+	
+	pxa_gpio_mode(87 | GPIO_OUT  | GPIO_DFLT_HIGH);
+
+	printk("Entering Suspend\n");
+	
+	//sys_ctx.ffier = FFIER;
+	//sys_ctx.fflcr = FFLCR;
+	//sys_ctx.ffmcr = FFMCR;
+	//sys_ctx.ffspr = FFSPR;
+	//sys_ctx.ffisr = FFISR;
+	//FFLCR |= 0x80;
+	//sys_ctx.ffdll = FFDLL;
+	//sys_ctx.ffdlh = FFDLH;
+	//FFLCR &= 0xef;
+
+	pxa_pm_enter_orig(state);
+	
+	//FFMCR = sys_ctx.ffmcr;
+	//FFSPR = sys_ctx.ffspr;
+	//FFLCR = sys_ctx.fflcr;
+	//FFLCR |= 0x80;
+	//FFDLH = sys_ctx.ffdlh;
+	//FFDLL = sys_ctx.ffdll;
+	//FFLCR = sys_ctx.fflcr;
+	//FFISR = sys_ctx.ffisr;
+	//FFLCR = 0x07;
+	//FFIER = sys_ctx.ffier;
+		
+	return 0;
+}
+
+
+
+
+
+
+
+
+
+static irqreturn_t hx2750_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+    printk("Input %d changed.\n", irq-32);
+
+	return IRQ_HANDLED;
+}
+
+
+static int __init hx2750_test_probe(struct device *dev)
+{
+	pxa_gpio_mode(21 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_CHARGE | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(83 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_BIOPWR | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(116 | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(118 | GPIO_OUT | GPIO_DFLT_HIGH);
+
+
+	//pxa_gpio_mode(HX2750_GPIO_CF_PWR | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(HX2750_GPIO_CF_PWR | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_BTPWR | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(79 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(85 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(HX2750_GPIO_LEDMAIL | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(107 | GPIO_OUT | GPIO_DFLT_LOW);
+	pxa_gpio_mode(114 | GPIO_OUT | GPIO_DFLT_LOW);	
+	
+	pxa_gpio_mode(HX2750_GPIO_BATTCOVER1 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_BATTCOVER2 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_CF_IRQ | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_USBCONNECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_CF_DETECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_EXTPWR | GPIO_IN);
+	
+	pxa_gpio_mode(15 | GPIO_IN);
+	//pxa_gpio_mode(HX2750_GPIO_CF_WIFIIRQ | GPIO_IN);
+	pxa_gpio_mode(80 | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_HP_JACK | GPIO_IN);
+	pxa_gpio_mode(115 | GPIO_IN);
+	pxa_gpio_mode(119 | GPIO_IN);	
+
+    request_irq(IRQ_GPIO(15), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+    //request_irq(IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+    request_irq(IRQ_GPIO(80), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+    request_irq(IRQ_GPIO(115), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);
+    request_irq(IRQ_GPIO(119), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);  
+    request_irq(IRQ_GPIO(HX2750_GPIO_SR_CLK2), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);    
+
+	//request_irq(IRQ_GPIO(10), hx2750_interrupt, SA_INTERRUPT, "hx2750test", NULL);    
+
+	set_irq_type(IRQ_GPIO(15),IRQT_BOTHEDGE);
+	//set_irq_type(IRQ_GPIO(HX2750_GPIO_CF_WIFIIRQ),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(80),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(115),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(119),IRQT_BOTHEDGE);
+	set_irq_type(IRQ_GPIO(HX2750_GPIO_SR_CLK2),IRQT_BOTHEDGE);
+	
+	//set_irq_type(IRQ_GPIO(10),IRQT_BOTHEDGE);
+
+	printk("hx2750 Test Code Initialized.\n");
+	device_create_file(dev, &dev_attr_test1);
+	device_create_file(dev, &dev_attr_test2);
+	device_create_file(dev, &dev_attr_sendegpio);
+	device_create_file(dev, &dev_attr_gpioset);
+	device_create_file(dev, &dev_attr_gpioclr);
+	device_create_file(dev, &dev_attr_sspr);
+	device_create_file(dev, &dev_attr_sspw);
+	
+	pxa_pm_enter_orig=pxa_pm_ops.enter;
+	pxa_pm_ops.enter=hx2750_pxa_pm_enter;
+	
+	return 0;
+}
+
+static struct device_driver hx2750_test_driver = {
+	.name		= "hx2750-test",
+	.bus		= &platform_bus_type,
+	.probe		= hx2750_test_probe,
+//	.remove		= hx2750_bl_remove,
+//	.suspend	= hx2750_bl_suspend,
+//	.resume		= hx2750_bl_resume,
+}; 
+ 
+ 
+static int __init hx2750_test_init(void)
+{
+	return driver_register(&hx2750_test_driver);
+}
+
+
+static void __exit hx2750_test_exit(void)
+{
+ 	driver_unregister(&hx2750_test_driver);
+}
+
+module_init(hx2750_test_init);
+module_exit(hx2750_test_exit);
+
+MODULE_AUTHOR("Richard Purdie <richard@o-hand.com>");
+MODULE_DESCRIPTION("iPAQ hx2750 Backlight Driver");
+MODULE_LICENSE("GPLv2");
Index: linux-2.6.11/arch/arm/mach-pxa/Kconfig
===================================================================
--- linux-2.6.11.orig/arch/arm/mach-pxa/Kconfig	2005-03-02 07:37:50.000000000 +0000
+++ linux-2.6.11/arch/arm/mach-pxa/Kconfig	2005-04-21 16:10:25.000000000 +0100
@@ -26,6 +26,15 @@
 	  Sharp SL-C700 (Corgi), SL-C750 (Shepherd) or a
 	  Sharp SL-C760 (Husky) handheld computer.
 
+config MACH_HX2750
+	bool "HP iPAQ hx2750"
+	select PXA27x
+	select PXA_KEYS
+	select SOC_DEVICE
+	select SOC_TSC2101
+	help
+	  This enables support for the HP iPAQ HX2750 handheld.
+
 endchoice
 
 endmenu
@@ -58,3 +67,4 @@
 	  Enable support for iWMMXt
 
 endif
+
Index: linux-2.6.11/arch/arm/mach-pxa/hx2750.c
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.11/arch/arm/mach-pxa/hx2750.c	2005-04-21 16:13:28.000000000 +0100
@@ -0,0 +1,417 @@
+/*
+ * Machine definitions for HP iPAQ hx2750
+ *
+ * Copyright 2005 Openedhand Ltd.
+ *
+ * Author: Richard Purdie <richard@o-hand.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/ioport.h>
+#include <linux/device.h>
+#include <linux/delay.h>
+#include <linux/input.h>
+#include <linux/mmc/host.h>
+
+#include <asm/mach-types.h>
+#include <asm/hardware.h>
+#include <asm/mach/arch.h>
+
+#include <asm/arch/hx2750.h>
+#include <asm/arch/pxa-regs.h>
+#include <asm/arch/pxa_keys.h>
+#include <asm/mach/map.h>
+#include <asm/arch/udc.h>	
+#include <asm/arch/mmc.h>
+#include <asm/arch/audio.h>
+#include <asm/arch/pxafb.h>
+#include <asm/arch/ssp.h>
+
+#include "generic.h"
+
+
+/* PXA2xx Keys */
+
+static struct pxa_keys_button hx2750_button_table[] = {
+	{ KEY_POWER, HX2750_GPIO_KEYPWR, 0 },   
+	{ KEY_LEFT, HX2750_GPIO_KEYLEFT, 0 },
+	{ KEY_RIGHT, HX2750_GPIO_KEYRIGHT, 0 },
+	{ KEY_KP0, HX2750_GPIO_KEYCAL, 0 },
+	{ KEY_KP1, HX2750_GPIO_KEYTASK, 0 },
+	{ KEY_KP2, HX2750_GPIO_KEYSIDE, 0 },
+	{ KEY_ENTER, HX2750_GPIO_KEYENTER, 0 },
+	{ KEY_KP3, HX2750_GPIO_KEYCON, 0 }, //KEY_CONTACTS
+	{ KEY_MAIL, HX2750_GPIO_KEYMAIL, 0 }, 
+	{ KEY_UP, HX2750_GPIO_KEYUP, 0 },
+	{ KEY_DOWN, HX2750_GPIO_KEYDOWN, 0 },
+};  
+    
+static struct pxa_keys_platform_data hx2750_pxa_keys_data = {
+	.buttons = hx2750_button_table,
+	.nbuttons = ARRAY_SIZE(hx2750_button_table),
+};  
+    
+static struct platform_device hx2750_pxa_keys = {
+	.name = "pxa2xx-keys",
+	.dev = {
+		.platform_data = &hx2750_pxa_keys_data,
+	},
+};
+
+extern struct platform_device pxafb_device;
+
+/*
+ * hx2750 Backlight Device
+ */
+static struct platform_device hx2750_bl_device = {
+	.name		= "hx2750-bl",
+	.id		= -1,
+//	.dev	= {
+		//.parent = &pxafb_device.dev,
+	//}
+};
+
+
+static struct platform_device hx2750_test_device = {
+	.name		= "hx2750-test",
+	.id		= -1,
+};
+
+
+/* USB */
+
+static int hx2750_udc_is_connected (void)
+{
+	return GPLR0 & GPIO_bit(HX2750_GPIO_USBCONNECT);
+}
+
+//static void hx2750_udc_command (int cmd) 
+//{
+//}
+
+static struct pxa2xx_udc_mach_info hx2750_udc_mach_info = {
+	.udc_is_connected = hx2750_udc_is_connected,
+//	.udc_command      = hx2750_udc_command,
+};
+
+
+static struct ssp_dev hx2750_ssp_dev1;
+static struct ssp_dev hx2750_ssp_dev2;
+static struct ssp_dev hx2750_ssp_dev3;
+
+void hx2750_ssp_init(void)
+{
+	pxa_gpio_mode(HX2750_GPIO_TSC2102_SS | GPIO_OUT | GPIO_DFLT_HIGH);
+	
+	if (ssp_init(&hx2750_ssp_dev1,1))
+		printk(KERN_ERR "Unable to register SSP1 handler!\n");
+	else {
+		ssp_disable(&hx2750_ssp_dev1);
+		ssp_config(&hx2750_ssp_dev1, (SSCR0_Motorola | (SSCR0_DSS & 0x0f )), SSCR1_SPH, 0, SSCR0_SerClkDiv(6));
+		ssp_enable(&hx2750_ssp_dev1);
+	}
+	
+//	if (ssp_init(&hx2750_ssp_dev2,2,NULL))
+//		printk(KERN_ERR "Unable to register SSP2 handler!\n");
+//	else {
+//		ssp_disable(&hx2750_ssp_dev2);
+//		ssp_config(&hx2750_ssp_dev2, (SSCR0_TI | (SSCR0_DSS & 0x09 )), 0, 0, SSCR0_SerClkDiv(140));
+//		ssp_enable(&hx2750_ssp_dev2);
+//	}
+//	
+	if (ssp_init(&hx2750_ssp_dev3,3))
+		printk(KERN_ERR "Unable to register SSP3 handler!\n");
+	else {
+		ssp_disable(&hx2750_ssp_dev3);
+		ssp_config(&hx2750_ssp_dev3, (SSCR0_Motorola | (SSCR0_DSS & 0x07 )), SSCR1_SPO | SSCR1_SPH, 0, SSCR0_SerClkDiv(166));
+		ssp_enable(&hx2750_ssp_dev3);
+	}
+
+	printk("SSP Devices Initialised\n");
+
+	return;
+}
+
+struct ssp_state ssp1;
+
+void hx2750_ssp_suspend(void)
+{
+	ssp_disable(&hx2750_ssp_dev1);
+	ssp_save_state(&hx2750_ssp_dev1,&ssp1); 
+}
+
+void hx2750_ssp_resume(void)
+{
+	ssp_restore_state(&hx2750_ssp_dev1,&ssp1); 
+	ssp_enable(&hx2750_ssp_dev1);
+}
+
+void hx2750_ssp_init2(void)
+{
+
+	if (ssp_init(&hx2750_ssp_dev2,2))
+		printk(KERN_ERR "Unable to register SSP2 handler!\n");
+	else {
+		mdelay(1000);
+		ssp_disable(&hx2750_ssp_dev2);
+		mdelay(1000);
+		ssp_config(&hx2750_ssp_dev2, (SSCR0_TI | (SSCR0_DSS & 0x09 )), 0, 0, SSCR0_SerClkDiv(140));
+		mdelay(1000);
+		ssp_enable(&hx2750_ssp_dev2);
+		mdelay(1000);
+	}
+	
+	printk("SSP Device2 Initialised\n");
+
+	return;
+}
+
+int hx2750_tsc2101_send(int read, int command, int *values, int numval)
+{
+	int i;
+	
+	GPCR0 = GPIO_bit(HX2750_GPIO_TSC2102_SS);           
+	
+	ssp_write_word(&hx2750_ssp_dev1, command | read);
+	/* dummy read */
+	ssp_read_word(&hx2750_ssp_dev1); 
+
+	for (i=0; i < numval; i++) {
+		if (read) {
+			ssp_write_word(&hx2750_ssp_dev1, 0);
+			values[i]=ssp_read_word(&hx2750_ssp_dev1);
+		} else {
+			ssp_write_word(&hx2750_ssp_dev1, values[i]);
+			ssp_read_word(&hx2750_ssp_dev1);
+		}
+	}
+	
+	GPSR0 = GPIO_bit(HX2750_GPIO_TSC2102_SS);
+	return 0;
+}
+
+EXPORT_SYMBOL(hx2750_tsc2101_send);
+
+void hx2750_send_egpio(unsigned int val)
+{
+	int i;
+
+	GPCR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+	GPCR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+
+	for (i=0;i<12;i++) {  
+		if (val & 0x01)
+			GPSR2 = GPIO_bit(HX2750_GPIO_GPIO_DIN);
+		else
+			GPCR2 = GPIO_bit(HX2750_GPIO_GPIO_DIN);
+		val >>= 1;
+		GPSR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+		GPCR1 = GPIO_bit(HX2750_GPIO_SR_CLK1);
+	} 
+
+	GPSR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+	GPCR0 = GPIO_bit(HX2750_GPIO_SR_STROBE);
+}
+
+EXPORT_SYMBOL(hx2750_send_egpio);
+
+static unsigned int hx2750_egpio_current;
+
+void hx2750_set_egpio(unsigned int gpio)
+{
+	hx2750_egpio_current|=gpio;
+	
+	hx2750_send_egpio(hx2750_egpio_current);
+}
+EXPORT_SYMBOL(hx2750_set_egpio);
+
+void hx2750_clear_egpio(unsigned int gpio)
+{
+	hx2750_egpio_current&=~gpio;
+	
+	hx2750_send_egpio(hx2750_egpio_current);
+}
+EXPORT_SYMBOL(hx2750_clear_egpio);
+
+
+static struct platform_device tsc2102_ts_device = {
+	.name 		= "tsc2101_ts",
+	.id 		= -1,
+};
+
+
+/* Initialization code */
+
+static void __init hx2750_map_io(void)
+{
+	pxa_map_io();
+}
+
+static void __init hx2750_init_irq(void)
+{
+	pxa_init_irq();
+}
+
+
+static struct platform_device *devices[] __initdata = {
+	&hx2750_bl_device,
+	&hx2750_test_device,
+	&hx2750_pxa_keys,
+	&tsc2102_ts_device,
+};
+
+
+/*
+ * MMC/SD Device
+ *
+ * The card detect interrupt isn't debounced so we delay it by HZ/4
+ * to give the card a chance to fully insert/eject.
+ */
+
+static struct mmc_detect {
+	struct timer_list detect_timer;
+	void *devid;
+} mmc_detect;
+
+static void mmc_detect_callback(unsigned long data)
+{
+	mmc_detect_change(mmc_detect.devid);
+} 
+
+static irqreturn_t hx2750_mmc_detect_int(int irq, void *devid, struct pt_regs *regs)
+{
+	mmc_detect.devid=devid;
+	mod_timer(&mmc_detect.detect_timer, jiffies + HZ/4);
+	return IRQ_HANDLED;
+}
+ 
+static int hx2750_mci_init(struct device *dev, irqreturn_t (*unused_detect_int)(int, void *, struct pt_regs *), void *data)
+{
+	int err;
+
+	/*
+	 * setup GPIO for PXA27x MMC controller
+	 */
+	pxa_gpio_mode(GPIO32_MMCCLK_MD);
+	pxa_gpio_mode(GPIO112_MMCCMD_MD);
+	pxa_gpio_mode(GPIO92_MMCDAT0_MD);
+	pxa_gpio_mode(GPIO109_MMCDAT1_MD);
+	pxa_gpio_mode(GPIO110_MMCDAT2_MD);
+	pxa_gpio_mode(GPIO111_MMCDAT3_MD);
+	pxa_gpio_mode(HX2750_GPIO_SD_DETECT | GPIO_IN);
+	pxa_gpio_mode(HX2750_GPIO_SD_READONLY | GPIO_IN);  
+
+	init_timer(&mmc_detect.detect_timer);
+	mmc_detect.detect_timer.function = mmc_detect_callback;
+	mmc_detect.detect_timer.data = (unsigned long) &mmc_detect;
+	
+	err = request_irq(HX2750_IRQ_GPIO_SD_DETECT, hx2750_mmc_detect_int, SA_INTERRUPT,
+			     "MMC card detect", data);
+	if (err) {
+		printk(KERN_ERR "hx2750_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
+		return -1;
+	}
+	
+	set_irq_type(HX2750_IRQ_GPIO_SD_DETECT, IRQT_BOTHEDGE);
+
+	return 0;
+}
+
+static void hx2750_mci_setpower(struct device *dev, unsigned int vdd)
+{
+	struct pxamci_platform_data* p_d = dev->platform_data;
+
+	if (( 1 << vdd) & p_d->ocr_mask) {
+		//printk(KERN_DEBUG "%s: on\n", __FUNCTION__);
+		hx2750_set_egpio(HX2750_EGPIO_SD_PWR);
+	} else {
+		//printk(KERN_DEBUG "%s: off\n", __FUNCTION__);
+		hx2750_clear_egpio(HX2750_EGPIO_SD_PWR);
+	}
+}
+
+static void hx2750_mci_exit(struct device *dev, void *data)
+{
+	free_irq(HX2750_IRQ_GPIO_SD_DETECT, data);
+	del_timer(&mmc_detect.detect_timer);
+}
+
+static struct pxamci_platform_data hx2750_mci_platform_data = {
+	.ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34,
+	.init 		= hx2750_mci_init,
+	.setpower 	= hx2750_mci_setpower,
+	.exit		= hx2750_mci_exit,
+};
+
+
+static struct pxafb_mach_info hx2750_pxafb_info __initdata = {
+	.pixclock       = 288462,
+	.xres           = 240,
+	.yres           = 320,
+	.bpp            = 16,
+	.hsync_len      = 20,
+	.left_margin    = 42,
+	.right_margin   = 18,
+	.vsync_len		= 4,
+	.upper_margin   = 3,
+	.lower_margin   = 4,
+	.sync           = 0,
+	.lccr0          = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
+	.lccr3          = LCCR3_PixFlEdg | LCCR3_OutEnH,
+	.pxafb_backlight_power	= NULL,
+};
+
+static void __init hx2750_init( void )
+{
+	PWER = 0xC0000003;// | PWER_RTC;
+	PFER = 0x00000003;
+	PRER = 0x00000003;
+	
+	PGSR0=0x00000018;
+	PGSR1=0x00000380;
+	PGSR2=0x00800000;
+	PGSR3=0x00500400;
+	
+	//PCFR |= PCFR_OPDE;
+	PCFR=0x77;
+	PSLR=0xff100000;
+	//PCFR=0x10; - does not return from suspend
+		
+	//PCFR=  0x00004040;
+	//PSLR=  0xff400f04;
+	
+	/* Setup Extra GPIO Bank access */
+	pxa_gpio_mode(HX2750_GPIO_GPIO_DIN | GPIO_OUT | GPIO_DFLT_HIGH);
+	pxa_gpio_mode(HX2750_GPIO_SR_CLK1 | GPIO_OUT | GPIO_DFLT_LOW);	
+	pxa_gpio_mode(HX2750_GPIO_SR_CLK2 | GPIO_IN);	
+	pxa_gpio_mode(HX2750_GPIO_SR_STROBE | GPIO_OUT | GPIO_DFLT_LOW);
+
+	
+	/* Init Extra GPIOs - Bootloader reset default is 0x484 */
+	/* This is 0xe84 */
+	hx2750_set_egpio(HX2750_EGPIO_2 | HX2750_EGPIO_7 | HX2750_EGPIO_LCD_PWR | HX2750_EGPIO_BL_PWR | HX2750_EGPIO_WIFI_PWR);
+	
+	pxa_set_udc_info(&hx2750_udc_mach_info);
+	pxa_set_mci_info(&hx2750_mci_platform_data);
+	set_pxa_fb_info(&hx2750_pxafb_info);
+	hx2750_ssp_init();
+	platform_add_devices (devices, ARRAY_SIZE (devices));
+}
+
+
+MACHINE_START(HX2750, "HP iPAQ HX2750")
+        BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
+        BOOT_PARAMS(0xa0000100)
+        MAPIO(hx2750_map_io)
+        INITIRQ(hx2750_init_irq)
+        .timer = &pxa_timer,
+        .init_machine = hx2750_init,
+MACHINE_END
+

