--- linux-2.6.16-oe/drivers/video/console/fbcon.c	Wed Mar 29 19:03:01 2006
+++ linux-2.6.16/drivers/video/console/fbcon.c	Mon Apr 17 12:41:08 2006
@@ -132,7 +132,7 @@ static char fontname[40];
 static int info_idx = -1;
 
 /* console rotation */
-static int rotate;
+static int rotate = FB_ROTATE_UR;
 
 static const struct consw fb_con;
 
@@ -252,6 +252,8 @@ static void fbcon_rotate_all(struct fb_i
 	if (!ops || ops->currcon < 0 || rotate > 3)
 		return;
 
+	ops->con_rotate = rotate;
+
 	for (i = 0; i < MAX_NR_CONSOLES; i++) {
 		vc = vc_cons[i].d;
 		if (!vc || vc->vc_mode != KD_TEXT ||
@@ -694,6 +696,7 @@ static int con2fb_acquire_newinfo(struct
 
 	if (!err) {
 		info->fbcon_par = ops;
+		ops->con_rotate = rotate;
 		set_blitting_type(vc, info);
 	}
 
@@ -927,6 +930,7 @@ static const char *fbcon_startup(void)
 	ops->currcon = -1;
 	ops->graphics = 1;
 	ops->cur_rotate = -1;
+	ops->con_rotate = rotate;
 	info->fbcon_par = ops;
 	p->con_rotate = rotate;
 	set_blitting_type(vc, info);
@@ -1088,7 +1092,7 @@ static void fbcon_init(struct vc_data *v
 		con_copy_unimap(vc, svc);
 
 	ops = info->fbcon_par;
-	p->con_rotate = rotate;
+	p->con_rotate = ops->con_rotate;
 	set_blitting_type(vc, info);
 
 	cols = vc->vc_cols;
@@ -2948,7 +2952,7 @@ static int fbcon_event_notify(struct not
 		fbcon_rotate(info, *(int *)event->data);
 		break;
 	case FB_EVENT_GET_CON_ROTATE:
-		ret = fbcon_get_rotate(info);
+		*(int*) event->data = fbcon_get_rotate(info);
 		break;
 	case FB_EVENT_SET_CON_ROTATE_ALL:
 		fbcon_rotate_all(info, *(int *)event->data);
--- linux-2.6.16-oe/drivers/video/console/fbcon.h	Wed Mar 29 19:03:01 2006
+++ linux-2.6.16/drivers/video/console/fbcon.h	Fri Mar 31 19:56:34 2006
@@ -78,6 +78,7 @@ struct fbcon_ops {
 	int    flags;
 	int    rotate;
 	int    cur_rotate;
+	int    con_rotate;
 	char  *cursor_data;
 	u8    *fontbuffer;
 	u8    *fontdata;
--- linux-2.6.16-oe/drivers/video/pxafb.c	Thu Mar 30 16:55:14 2006
+++ linux-2.6.16/drivers/video/pxafb.c	Fri Mar 31 19:56:34 2006
@@ -472,15 +472,20 @@ static inline unsigned int get_pcd(unsig
  */
 static inline void set_hsync_time(struct pxafb_info *fbi, unsigned int pcd)
 {
-	unsigned long long htime;
+	unsigned htime;
+	unsigned pixclock;
 
-	if ((pcd == 0) || (fbi->fb.var.hsync_len == 0)) {
+	/* pixclock in Hz */
+	pixclock = get_lcdclk_frequency_10khz()*10000/(pcd + 1)/2; /* FIXME: see get_pcd */
+
+	htime = fbi->fb.var.hsync_len + fbi->fb.var.left_margin + fbi->fb.var.xres;
+
+	if (htime == 0) {
 		fbi->hsync_time=0;
 		return;
 	}
 
-	htime = (unsigned long long)get_lcdclk_frequency_10khz() * 10000;
-	do_div(htime, pcd * fbi->fb.var.hsync_len);
+	htime = pixclock / htime;
 	fbi->hsync_time = htime;
 }
 
@@ -870,9 +875,20 @@ static void set_ctrlr_state(struct pxafb
 		 * registers.
 		 */
 		if (old_state == C_ENABLE) {
+#ifdef CONFIG_PXA27x
+			unsigned lccr1 = LCCR1;
+#endif
 			pxafb_disable_controller(fbi);
 			pxafb_setup_gpio(fbi);
 			pxafb_enable_controller(fbi);
+			__pxafb_lcd_power(fbi, fbi->fb.var.xres);
+#ifdef CONFIG_PXA27x
+			/* According to PXA270 errata we have to re-enable it again. */
+			if(LCCR1_DisWdth(lccr1^LCCR1)) {
+				pxafb_disable_controller(fbi);
+				pxafb_enable_controller(fbi);
+			}
+#endif
 		}
 		break;
 
@@ -895,7 +911,7 @@ static void set_ctrlr_state(struct pxafb
 			fbi->state = C_ENABLE;
 			pxafb_setup_gpio(fbi);
 			pxafb_enable_controller(fbi);
-			__pxafb_lcd_power(fbi, 1);
+			__pxafb_lcd_power(fbi, fbi->fb.var.xres);
 			__pxafb_backlight_power(fbi, 1);
 		}
 		break;
--- linux-2.6.16-oe/drivers/video/fbsysfs.c	Wed Mar 29 19:03:01 2006
+++ linux-2.6.16/drivers/video/fbsysfs.c	Mon Apr 17 16:21:23 2006
@@ -264,10 +264,10 @@ static ssize_t store_con_rotate_all(stru
 static ssize_t show_con_rotate(struct class_device *class_device, char *buf)
 {
 	struct fb_info *fb_info = class_get_devdata(class_device);
-	int rotate;
+	int rotate = -1;
 
 	acquire_console_sem();
-	rotate = fb_con_duit(fb_info, FB_EVENT_GET_CON_ROTATE, NULL);
+	fb_con_duit(fb_info, FB_EVENT_GET_CON_ROTATE, &rotate);
 	release_console_sem();
 	return snprintf(buf, PAGE_SIZE, "%d\n", rotate);
 }
@@ -515,8 +515,8 @@ static struct class_device_attribute cla
 	__ATTR(name, S_IRUGO, show_name, NULL),
 	__ATTR(stride, S_IRUGO, show_stride, NULL),
 	__ATTR(rotate, S_IRUGO|S_IWUSR, show_rotate, store_rotate),
-	__ATTR(con_rotate, S_IRUGO|S_IWUSR, show_con_rotate, store_con_rotate),
-	__ATTR(con_rotate_all, S_IWUSR, NULL, store_con_rotate_all),
+	/*__ATTR(con_rotate, S_IRUGO|S_IWUSR, show_con_rotate, store_con_rotate),*/
+	__ATTR(con_rotate_all, S_IRUGO|S_IWUSR, show_con_rotate, store_con_rotate_all),
 	__ATTR(state, S_IRUGO|S_IWUSR, show_fbstate, store_fbstate),
 };
 
--- linux-2.6.16-oe/drivers/serial/pxa.c	Wed Mar 29 19:02:57 2006
+++ linux-2.6.16/drivers/serial/pxa.c	Fri Mar 31 19:56:34 2006
@@ -217,6 +217,10 @@ static inline void check_modem_status(st
 	if ((status & UART_MSR_ANY_DELTA) == 0)
 		return;
 
+#ifdef CONFIG_PXA_SHARP_Cxx00
+	status = status ^ (UART_MSR_DSR|UART_MSR_CTS);
+#endif
+
 	if (status & UART_MSR_TERI)
 		up->port.icount.rng++;
 	if (status & UART_MSR_DDSR)
@@ -269,9 +273,11 @@ static unsigned int serial_pxa_get_mctrl
 	unsigned char status;
 	unsigned int ret;
 
-return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
+#ifdef CONFIG_PXA_SHARP_Cxx00
 	status = serial_in(up, UART_MSR);
 
+	if(port->line == 0) status = status ^ (UART_MSR_DSR|UART_MSR_CTS);
+
 	ret = 0;
 	if (status & UART_MSR_DCD)
 		ret |= TIOCM_CAR;
@@ -282,6 +288,9 @@ return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR
 	if (status & UART_MSR_CTS)
 		ret |= TIOCM_CTS;
 	return ret;
+#else
+return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
+#endif
 }
 
 static void serial_pxa_set_mctrl(struct uart_port *port, unsigned int mctrl)
@@ -302,6 +311,10 @@ static void serial_pxa_set_mctrl(struct 
 
 	mcr |= up->mcr;
 
+#ifdef CONFIG_PXA_SHARP_Cxx00
+	if(port->line == 0) mcr = mcr ^ (UART_MCR_RTS|UART_MCR_DTR);
+#endif
+
 	serial_out(up, UART_MCR, mcr);
 }
 
@@ -613,9 +626,16 @@ static inline void wait_for_xmitr(struct
 	/* Wait up to 1s for flow control if necessary */
 	if (up->port.flags & UPF_CONS_FLOW) {
 		tmout = 1000000;
-		while (--tmout &&
-		       ((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0))
-			udelay(1);
+#ifdef CONFIG_PXA_SHARP_Cxx00
+		if(up->port.line == 0)
+			while (--tmout &&
+		       		((serial_in(up, UART_MSR) & UART_MSR_CTS) != 0))
+				udelay(1);
+		else 
+#endif
+			while (--tmout &&
+		       		((serial_in(up, UART_MSR) & UART_MSR_CTS) == 0))
+				udelay(1);
 	}
 }
 
--- linux-2.6.16-oe/drivers/input/touchscreen/corgi_ts.c	Wed Mar 29 19:01:44 2006
+++ linux-2.6.16/drivers/input/touchscreen/corgi_ts.c	Fri Mar 31 19:56:34 2006
@@ -82,6 +82,53 @@ static unsigned long calc_waittime(struc
 		return 0;
 }
 
+static unsigned ts_delay = 7050;
+static unsigned ts_calc_delay = 0;
+static unsigned ts_last_delay = 0;
+
+static ssize_t show_ts_delay(struct class_device *dev, char *buf) { 
+ return sprintf(buf, "%d", ts_delay); 
+}
+
+static ssize_t show_ts_last_delay(struct class_device *dev, char *buf) { 
+ return sprintf(buf, "%d", ts_last_delay); 
+}
+
+static ssize_t show_ts_calc_delay(struct class_device *dev, char *buf) { 
+ return sprintf(buf, "%d", ts_calc_delay); 
+}
+
+static ssize_t store_ts_delay(struct class_device *dev, const char *buf, size_t count)
+{
+ char *last = NULL;
+ ts_delay = simple_strtoul(buf, &last, 0);
+ return count;
+}
+
+static ssize_t store_ts_calc_delay(struct class_device *dev, const char *buf, size_t count)
+{
+ char *last = NULL;
+ ts_calc_delay = simple_strtoul(buf, &last, 0);
+ return count;
+}
+
+static CLASS_DEVICE_ATTR(ts_delay, S_IRUGO | S_IWUSR, show_ts_delay, store_ts_delay);
+static CLASS_DEVICE_ATTR(ts_last_delay, S_IRUGO, show_ts_last_delay, NULL);
+static CLASS_DEVICE_ATTR(ts_calc_delay, S_IRUGO | S_IWUSR, show_ts_calc_delay, store_ts_calc_delay);
+
+static struct attribute *corgi_ts_sysfs_entries[] = {
+ &class_device_attr_ts_delay.attr,
+ &class_device_attr_ts_calc_delay.attr,
+ &class_device_attr_ts_last_delay.attr,
+ NULL
+};
+
+static struct attribute_group corgi_ts_attr_group = {
+ .name = NULL,
+ .attrs = corgi_ts_sysfs_entries
+};
+
+
 static int sync_receive_data_send_cmd(struct corgi_ts *corgi_ts, int doRecive, int doSend,
 		unsigned int address, unsigned long wait_time)
 {
@@ -137,7 +184,8 @@ static int read_xydata(struct corgi_ts *
 	/* critical section */
 	local_irq_save(flags);
 	corgi_ssp_ads7846_lock();
-	wait_time = calc_waittime(corgi_ts);
+	if(ts_calc_delay) ts_last_delay = wait_time = calc_waittime(corgi_ts);
+	else ts_last_delay = wait_time = ts_delay;
 
 	/* Y-axis */
 	sync_receive_data_send_cmd(corgi_ts, 0, 1, 1u, wait_time);
@@ -330,6 +378,7 @@ static int __init corgits_probe(struct p
 	/* Enable Falling Edge */
 	set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
 
+    sysfs_create_group(&input_dev->cdev.kobj, &corgi_ts_attr_group);
 	return 0;
 
  fail:	input_free_device(input_dev);
@@ -342,6 +391,7 @@ static int corgits_remove(struct platfor
 {
 	struct corgi_ts *corgi_ts = platform_get_drvdata(pdev);
 
+	sysfs_remove_group(&corgi_ts->input->cdev.kobj, &corgi_ts_attr_group);
 	free_irq(corgi_ts->irq_gpio, NULL);
 	del_timer_sync(&corgi_ts->timer);
 	corgi_ts->machinfo->put_hsync();
--- linux-2.6.16-oe/drivers/ide/legacy/ide-cs.c	Thu Mar 30 16:59:20 2006
+++ linux-2.6.16/drivers/ide/legacy/ide-cs.c	Fri Apr 14 19:57:33 2006
@@ -54,6 +54,8 @@
 #include <pcmcia/cisreg.h>
 #include <pcmcia/ciscode.h>
 
+#include <../drivers/pcmcia/soc_common.h>
+
 /*====================================================================*/
 
 /* Module parameters */
@@ -85,10 +87,11 @@ typedef struct ide_info_t {
     int		ndev;
     dev_node_t	node;
     int		hd;
+    dma_addr_t  io_phys;
 } ide_info_t;
 
 static void ide_release(dev_link_t *);
-static void ide_config(dev_link_t *);
+static void ide_config(dev_link_t *, long io_virt_to_phys);
 
 static void ide_detach(struct pcmcia_device *p_dev);
 
@@ -108,6 +111,10 @@ static int ide_attach(struct pcmcia_devi
     ide_info_t *info;
     dev_link_t *link;
 
+    #define to_soc_pcmcia_socket(x) container_of(x, struct soc_pcmcia_socket, socket)
+ 	struct soc_pcmcia_socket *sock;
+
+
     DEBUG(0, "ide_attach()\n");
 
     /* Create new ide device */
@@ -129,7 +136,9 @@ static int ide_attach(struct pcmcia_devi
     p_dev->instance = link;
 
     link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
-    ide_config(link);
+
+ 	sock = to_soc_pcmcia_socket(p_dev->socket);
+    ide_config(link, sock->res_io.start-(long)sock->virt_io);
 
     return 0;
 } /* ide_attach */
@@ -155,7 +164,7 @@ static void ide_detach(struct pcmcia_dev
     kfree(link->priv);
 } /* ide_detach */
 
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, unsigned long io_phys, struct pcmcia_device *handle)
 {
     hw_regs_t hw;
     memset(&hw, 0, sizeof(hw));
@@ -163,6 +172,7 @@ static int idecs_register(unsigned long 
     hw.irq = irq;
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
+    hw.io_phys = io_phys;
     return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
 }
 
@@ -177,7 +187,7 @@ static int idecs_register(unsigned long 
 #define CS_CHECK(fn, ret) \
 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
-static void ide_config(dev_link_t *link)
+static void ide_config(dev_link_t *link, long io_virt_to_phys)
 {
     client_handle_t handle = link->handle;
     ide_info_t *info = link->priv;
@@ -301,12 +311,12 @@ static void ide_config(dev_link_t *link)
 
     /* retry registration in case device is still spinning up */
     for (hd = -1, i = 0; i < 10; i++) {
-	hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, handle);
+	hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, io_base+io_virt_to_phys, handle);
 	if (hd >= 0) break;
 	if (link->io.NumPorts1 == 0x20) {
 	    outb(0x02, ctl_base + 0x10);
 	    hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
-				link->irq.AssignedIRQ, handle);
+				link->irq.AssignedIRQ, io_base+io_virt_to_phys, handle);
 	    if (hd >= 0) {
 		io_base += 0x10;
 		ctl_base += 0x10;
@@ -449,6 +459,7 @@ static struct pcmcia_device_id ide_ids[]
 	PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852),
 	PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
 	PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
+	PCMCIA_DEVICE_PROD_ID12("SAMSUNG", "04/05/06", 0x43d74cb4, 0x6a22777d),
 	PCMCIA_DEVICE_NULL,
 };
 MODULE_DEVICE_TABLE(pcmcia, ide_ids);
--- linux-2.6.16-oe/drivers/ide/ide-taskfile.c	Thu Mar 30 16:55:13 2006
+++ linux-2.6.16/drivers/ide/ide-taskfile.c	Fri Mar 31 19:56:34 2006
@@ -52,6 +52,9 @@
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
+#include <asm/arch/system.h>
+#include <asm/arch/dma.h>
+
 static void ata_bswap_data (void *buffer, int wcount)
 {
 	u16 *p = buffer;
@@ -383,6 +386,208 @@ static void task_end_request(ide_drive_t
 	} else
 		ide_end_request(drive, 1, rq->hard_nr_sectors);
 }
+
+unsigned ide_piodma_burst_size = DCMD_BURST8;
+EXPORT_SYMBOL(ide_piodma_burst_size);
+
+static void
+ide_piodma_intr(int channel, void *data, struct pt_regs *regs)
+{
+ unsigned long flags;
+ unsigned dmach;
+ unsigned dcsr;
+ ide_hwif_t *hwif;
+ ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)data;
+
+ spin_lock_irqsave(&ide_lock, flags);
+ hwif = hwgroup->hwif;
+ dmach = hwif->piodmach;
+ if(!hwgroup->busy || hwif->nleft
+				 || hwgroup->handler != task_in_intr_piodma) 
+  printk("ide_piodma_intr: not expecting interrupt\n"); 
+ dcsr = DCSR(dmach);
+ /* disable dma, clear interrupts */
+ DCSR(dmach) =  DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
+ if(!(dcsr & DCSR_ENDINTR)) {
+  hwif->piodma = 0;
+  spin_unlock_irqrestore(&ide_lock, flags);
+  printk(KERN_ERR "ide_piodma_intr: unexpected DCSR value 0x%x, disabling piodma\n", dcsr);
+  return;
+ }
+ spin_unlock_irqrestore(&ide_lock, flags);
+ ide_intr(hwif->irq, data, regs);
+}
+
+void ide_piodma_allocate(ide_hwif_t *hwif)
+{
+ hwif->piodmach = pxa_request_dma("ide piodma",/* FIXME: hack, fix arch-pxa/dma.c DMA_PRIO_LOW*/12, ide_piodma_intr, hwif->hwgroup);
+ if(hwif->piodmach < 0) return;
+}
+
+void ide_piodma_free(ide_hwif_t *hwif)
+{
+ hwif->piodma = 0;
+ if(!hwif->io_phys || hwif->piodmach < 0) return;
+ pxa_free_dma(hwif->piodmach);
+ hwif->piodmach = -1;
+}
+
+static int
+ide_piodma_setup(ide_hwif_t *hwif)
+{
+ unsigned dmach = hwif->piodmach;
+ struct scatterlist *sg = hwif->sg_table;
+ unsigned int nleft = hwif->nleft;
+
+ if(DCSR(dmach) & DCSR_RUN) {
+  printk("ide_piodma_setup: error: dma is not complete yet! DCSR=0x%x, DTADR=0x%x, DCMD=0x%x\n", DCSR(dmach), 
+				  DTADR(dmach), DCMD(dmach));
+  DCSR(dmach) =  DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
+  hwif->piodma = 0;
+  return -1;
+ }
+
+ DCSR(dmach) = DCSR_NODESC;
+ DSADR(dmach) = hwif->io_phys;
+ DTADR(dmach) = sg_dma_address(&sg[hwif->cursg]) + hwif->cursg_ofs*SECTOR_SIZE; 
+ if(nleft == 1) DCMD(dmach) = DCMD_ENDIRQEN | DCMD_INCTRGADDR | ide_piodma_burst_size | SECTOR_SIZE;
+ else DCMD(dmach) = DCMD_INCTRGADDR | ide_piodma_burst_size | SECTOR_SIZE;
+
+ hwif->nleft = nleft-1; /* we don't support multisector transfers... */
+ hwif->cursg_ofs++;
+ if ((hwif->cursg_ofs * SECTOR_SIZE) == sg[hwif->cursg].length) {
+		hwif->cursg++;
+		hwif->cursg_ofs = 0;
+ }
+
+ DCSR(dmach) |= DCSR_RUN;
+ return 0;
+}
+
+static int
+ide_piodma_setup_out(ide_hwif_t *hwif)
+{
+ unsigned dmach = hwif->piodmach;
+ struct scatterlist *sg = hwif->sg_table;
+ unsigned int nleft = hwif->nleft;
+
+ if(DCSR(dmach) & DCSR_RUN) {
+  printk("ide_piodma_setup_out: error: dma is not complete yet! DCSR=0x%x, DTADR=0x%x, DCMD=0x%x\n", DCSR(dmach), 
+				  DTADR(dmach), DCMD(dmach));
+  DCSR(dmach) =  DCSR_STARTINTR|DCSR_ENDINTR|DCSR_BUSERR;
+  hwif->piodma = 0;
+  return -1;
+ }
+
+ DCSR(dmach) = DCSR_NODESC;
+ DTADR(dmach) = hwif->io_phys;
+ DSADR(dmach) = sg_dma_address(&sg[hwif->cursg]) + hwif->cursg_ofs*SECTOR_SIZE; 
+ DCMD(dmach) = DCMD_INCSRCADDR | ide_piodma_burst_size | SECTOR_SIZE;
+
+ hwif->nleft = nleft-1; /* we don't support multisector transfers... */
+ hwif->cursg_ofs++;
+ if ((hwif->cursg_ofs * SECTOR_SIZE) == sg[hwif->cursg].length) {
+		hwif->cursg++;
+		hwif->cursg_ofs = 0;
+ }
+
+ DCSR(dmach) |= DCSR_RUN;
+ return 0;
+}
+
+ide_startstop_t task_in_intr_piodma (ide_drive_t *drive)
+{
+ ide_hwif_t *hwif = drive->hwif;
+ struct request *rq = HWGROUP(drive)->rq;
+ u8 stat = hwif->INB(IDE_STATUS_REG);
+
+ /* new way for dealing with premature shared PCI interrupts */
+ if(hwif->nleft) {
+  if(!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
+   if (stat & (ERR_STAT | DRQ_STAT)) {
+    dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_FROM_DEVICE);
+    return task_error(drive, rq, __FUNCTION__, stat);
+   }
+   /* No data yet, so wait for another IRQ. */
+   ide_set_handler(drive, &task_in_intr_piodma, WAIT_WORSTCASE, NULL);
+   return ide_started;
+  }
+
+  ide_set_handler(drive, &task_in_intr_piodma, WAIT_WORSTCASE, NULL);
+  if(ide_piodma_setup(hwif)) {
+    dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_FROM_DEVICE);
+	return task_error(drive, rq, __FUNCTION__, stat);
+  }
+  return ide_started;
+ } else {
+  if(DCSR(hwif->piodmach) & DCSR_RUN) {
+   printk("task_in_intr_piodma: dma is still running\n");
+   ide_set_handler(drive, &task_in_intr_piodma, WAIT_WORSTCASE, NULL);
+   return ide_started;
+  }
+ }
+
+ dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_FROM_DEVICE);
+
+ /* If it was the last datablock check status and finish transfer. */
+ stat = wait_drive_not_busy(drive);
+ if (!OK_STAT(stat, 0, BAD_R_STAT))
+	return task_error(drive, rq, __FUNCTION__, stat);
+ task_end_request(drive, rq, stat);
+ return ide_stopped;
+}
+EXPORT_SYMBOL(task_in_intr_piodma);
+
+static ide_startstop_t task_out_intr_piodma (ide_drive_t *drive)
+{
+	ide_hwif_t *hwif = drive->hwif;
+	struct request *rq = HWGROUP(drive)->rq;
+	u8 stat = hwif->INB(IDE_STATUS_REG);
+
+	if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) goto error;
+
+	/* Deal with unexpected ATA data phase. */
+	if (((stat & DRQ_STAT) == 0) ^ !hwif->nleft) goto error;
+	
+
+	if (!hwif->nleft) {
+		dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_TO_DEVICE);
+		task_end_request(drive, rq, stat);
+		return ide_stopped;
+	}
+
+	/* Still data left to transfer. */
+	ide_piodma_setup_out(hwif);
+	ide_set_handler(drive, &task_out_intr_piodma, WAIT_WORSTCASE, NULL);
+
+	return ide_started;
+
+error:
+	dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_TO_DEVICE);
+	return task_error(drive, rq, __FUNCTION__, stat);
+}
+
+ide_startstop_t pre_task_out_intr_piodma (ide_drive_t *drive, struct request *rq)
+{
+	ide_hwif_t *hwif = drive->hwif;
+	ide_startstop_t startstop;
+
+	if (ide_wait_stat(&startstop, drive, DATA_READY,
+			  drive->bad_wstat, WAIT_DRQ)) {
+		printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
+				drive->name,
+				drive->hwif->data_phase ? "MULT" : "",
+				drive->addressing ? "_EXT" : "");
+		dma_unmap_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_TO_DEVICE);
+		return startstop;
+	}
+
+	ide_set_handler(drive, &task_out_intr_piodma, WAIT_WORSTCASE, NULL);
+	ide_piodma_setup_out(drive->hwif);
+
+	return ide_started;
+}
+EXPORT_SYMBOL(pre_task_out_intr_piodma);
 
 /*
  * Handler for command with PIO data-in phase (Read/Read Multiple).
--- linux-2.6.16-oe/drivers/ide/ide.c	Wed Mar 29 19:02:45 2006
+++ linux-2.6.16/drivers/ide/ide.c	Fri Mar 31 19:56:34 2006
@@ -671,6 +671,7 @@ void ide_unregister(unsigned int index)
 	unregister_blkdev(hwif->major, hwif->name);
 	spin_lock_irq(&ide_lock);
 
+	if(hwif->piodmach >= 0) ide_piodma_free(hwif);
 	if (hwif->dma_base) {
 		(void) ide_release_dma(hwif);
 
@@ -800,6 +801,8 @@ found:
 	memcpy(&hwif->hw, hw, sizeof(*hw));
 	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
 	hwif->irq = hw->irq;
+	hwif->io_phys = hw->io_phys;
+	hwif->piodmach = -1;
 	hwif->noprobe = 0;
 	hwif->chipset = hw->chipset;
 	hwif->gendev.parent = hw->dev;
--- linux-2.6.16-oe/drivers/ide/ide-disk.c	Thu Mar 30 16:55:13 2006
+++ linux-2.6.16/drivers/ide/ide-disk.c	Fri Mar 31 19:56:34 2006
@@ -283,7 +283,11 @@ static ide_startstop_t __ide_do_rw_disk(
 			command = lba48 ? WIN_READ_EXT : WIN_READ;
 		}
 
-		ide_execute_command(drive, command, &task_in_intr, WAIT_CMD, NULL);
+		if(hwif->piodma && !drive->mult_count) {
+		 dma_map_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_FROM_DEVICE);
+		 ide_execute_command(drive, command, &task_in_intr_piodma, WAIT_CMD, NULL);
+		} else
+		 ide_execute_command(drive, command, &task_in_intr, WAIT_CMD, NULL);
 		return ide_started;
 	} else {
 		if (drive->mult_count) {
@@ -297,7 +301,10 @@ static ide_startstop_t __ide_do_rw_disk(
 		/* FIXME: ->OUTBSYNC ? */
 		hwif->OUTB(command, IDE_COMMAND_REG);
 
-		return pre_task_out_intr(drive, rq);
+		if(hwif->piodma > 1 && !drive->mult_count) {
+		 dma_map_sg(hwif->gendev.parent, hwif->sg_table, hwif->sg_nents, DMA_TO_DEVICE);
+		 return pre_task_out_intr_piodma(drive, rq);
+		} else return pre_task_out_intr(drive, rq);
 	}
 }
 
--- linux-2.6.16-oe/drivers/ide/ide-proc.c	Wed Mar 29 19:01:43 2006
+++ linux-2.6.16/drivers/ide/ide-proc.c	Fri Mar 31 19:56:34 2006
@@ -39,6 +39,9 @@
 
 #include <asm/io.h>
 
+
+#include <asm/arch/system.h>
+
 static int proc_ide_read_imodel
 	(char *page, char **start, off_t off, int count, int *eof, void *data)
 {
@@ -466,7 +469,82 @@ static void destroy_proc_ide_drives(ide_
 	}
 }
 
+extern unsigned ide_piodma_burst_size;
+
+static int proc_ide_write_piodma_burst_size
+	(struct file *file, const char __user *buffer, unsigned long count, void *data)
+{
+	char n = 0;
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EACCES;
+	if (count > 1)
+		count = 1;
+	if (copy_from_user(&n, buffer, count))
+		return -EFAULT;
+	if(n < '1' || n > '3') return -EINVAL;
+	switch(n) {
+			case '1': ide_piodma_burst_size = DCMD_BURST8; break;
+			case '2': ide_piodma_burst_size = DCMD_BURST16; break;
+			case '3': ide_piodma_burst_size = DCMD_BURST32; break;
+	}
+	return count;
+}
+static int proc_ide_write_piodma
+	(struct file *file, const char __user *buffer, unsigned long count, void *data)
+{
+	ide_hwif_t	*hwif = (ide_hwif_t *) data;
+	char n = '1';
+
+	if (!capable(CAP_SYS_ADMIN))
+		return -EACCES;
+	if (count > 1)
+		count = 1;
+	if (copy_from_user(&n, buffer, count))
+		return -EFAULT;
+	if(n > '2' || n < '0') return -EINVAL;
+	if(n == '1' || n == '2') {
+	 if(!hwif->piodma) {
+	  if(hwif->io_phys == 0) return -ENOTSUPP;
+	  ide_piodma_allocate(hwif); 
+	  if(hwif->piodmach < 0) return -EBUSY;
+	 }
+	 hwif->piodma = n-'0';
+	 return count;
+	}
+
+	hwif->piodma = 0;
+	return count;
+}
+
+static int proc_ide_read_piodma
+	(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	ide_hwif_t	*hwif = (ide_hwif_t *) data;
+	int		len;
+
+	len = sprintf(page, "%d\n", hwif->piodma);
+	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
+}
+static int proc_ide_read_piodma_burst_size
+	(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	int		len;
+	int bs;
+	switch(ide_piodma_burst_size) {
+			case DCMD_BURST32: bs = 3; break;
+			case DCMD_BURST16: bs = 2; break;
+			case DCMD_BURST8: bs = 1; break;
+			default: bs = -1;
+	}
+
+	len = sprintf(page, "%d\n", bs);
+	PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
+}
+
 static ide_proc_entry_t hwif_entries[] = {
+	{ "piodma",	S_IFREG|S_IRUGO|S_IWUSR,	proc_ide_read_piodma,	proc_ide_write_piodma },
+	{ "piodma_burst_size",	S_IFREG|S_IRUGO|S_IWUSR,	proc_ide_read_piodma_burst_size,	proc_ide_write_piodma_burst_size },
 	{ "channel",	S_IFREG|S_IRUGO,	proc_ide_read_channel,	NULL },
 	{ "mate",	S_IFREG|S_IRUGO,	proc_ide_read_mate,	NULL },
 	{ "model",	S_IFREG|S_IRUGO,	proc_ide_read_imodel,	NULL },
--- linux-2.6.16-oe/drivers/pcmcia/soc_common.h	Wed Nov 16 16:57:34 2005
+++ linux-2.6.16/drivers/pcmcia/soc_common.h	Fri Mar 31 19:56:34 2006
@@ -169,10 +169,18 @@ extern void soc_pcmcia_debug(struct soc_
  * and memory command width time is 150ns; the PCMCIA 3.3V attribute and
  * memory command width time is 300ns.
  */
+#if 0
 #define SOC_PCMCIA_IO_ACCESS		(165)
 #define SOC_PCMCIA_5V_MEM_ACCESS	(150)
 #define SOC_PCMCIA_3V_MEM_ACCESS	(300)
 #define SOC_PCMCIA_ATTR_MEM_ACCESS	(300)
+#else
+/* cycle tyme */
+#define SOC_PCMCIA_IO_ACCESS		(255)
+#define SOC_PCMCIA_5V_MEM_ACCESS	(250)
+#define SOC_PCMCIA_3V_MEM_ACCESS	(600)
+#define SOC_PCMCIA_ATTR_MEM_ACCESS	(600)
+#endif
 
 /*
  * The socket driver actually works nicely in interrupt-driven form,
--- linux-2.6.16-oe/drivers/pcmcia/pxa2xx_base.c	Wed Mar 29 19:01:50 2006
+++ linux-2.6.16/drivers/pcmcia/pxa2xx_base.c	Fri Mar 31 19:56:34 2006
@@ -48,6 +48,7 @@
 #define MCXX_ASST_SHIFT     (7)
 #define MCXX_HOLD_SHIFT     (14)
 
+#if 0
 static inline u_int pxa2xx_mcxx_hold(u_int pcmcia_cycle_ns,
 				     u_int mem_clk_10khz)
 {
@@ -78,13 +79,85 @@ static inline u_int pxa2xx_pcmcia_cmd_ti
 	return (300000 * (pcmcia_mcxx_asst + 1) / mem_clk_10khz);
 }
 
+#else
+
+static inline u_int pxa2xx_mcxx_hold(u_int hold,
+				     u_int mem_clk_10khz)
+{
+	u_int code = hold * mem_clk_10khz;
+	return (code / 100000) + ((code % 100000) ? 1 : 0);
+}
+
+static inline u_int pxa2xx_mcxx_asst(u_int cas,
+				     u_int mem_clk_10khz)
+{
+	u_int code = cas * mem_clk_10khz;
+	if(code % 300000 > 200000) return code/300000;
+	else return code/300000-1;
+}
+
+static inline u_int pxa2xx_mcxx_setup(u_int set,
+				      u_int mem_clk_10khz)
+{
+	u_int code = set * mem_clk_10khz;
+	return (code / 100000) + ((code % 100000) ? 1 : 0) - 2;
+}
+#endif
+
 static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock )
 {
-	MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	u_int set, cas, hold;
+
+	int spd = speed;
+
+	do {
+	 switch(speed) {
+			 case 600:
+					 cas = 300; /*tw(WE)*/
+					 set = 100; /*tsu(A)*/
+					 hold = 70; /*trec(WE)*/
+					 break;
+			 case 250:
+					 cas = 150;
+					 set = 30;
+					 hold = 30;
+					 break;
+			 case 200:
+					 cas = 120;
+					 set = 20;
+					 hold = 30;
+					 break;
+			 case 150:
+					 cas = 80;
+					 set = 20;
+					 hold = 20;
+					 break;
+			 case 100:
+					 cas = 60;
+					 set = 10;
+					 hold = 15;
+					 break;
+			 default:
+					 if(speed > 600) {
+					  set = 100;
+					  hold = 70;
+					  cas = 300+(speed-600);
+					 } else {
+					  if(speed % 50) speed = (speed/50+1)*50;
+					  else speed += 50;
+					  cas = 0;
+					 }
+	 }
+	} while(cas == 0);
+
+	/* Adjust to meet minimal cycle requirement? */
+	if(cas+set+hold < spd) hold = spd - cas - set;
+
+	MCMEM(sock) = ((pxa2xx_mcxx_setup(set, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
-		| ((pxa2xx_mcxx_asst(speed, clock)
+		| ((pxa2xx_mcxx_asst(cas, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
-		| ((pxa2xx_mcxx_hold(speed, clock)
+		| ((pxa2xx_mcxx_hold(hold, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
 	return 0;
@@ -92,11 +165,23 @@ static int pxa2xx_pcmcia_set_mcmem( int 
 
 static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock )
 {
-	MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	u_int set, cas, hold;
+
+	if(speed == 255) {
+	 set = 70;
+	 hold = 20;
+	 cas = 165;
+	} else {
+	 /* FIXME: calculate proportional settings? */
+	 cas = speed - 90;
+	 set = 70;
+	 hold = 20;
+	}
+	MCIO(sock) = ((pxa2xx_mcxx_setup(set, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
-		| ((pxa2xx_mcxx_asst(speed, clock)
+		| ((pxa2xx_mcxx_asst(cas, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
-		| ((pxa2xx_mcxx_hold(speed, clock)
+		| ((pxa2xx_mcxx_hold(hold, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
 	return 0;
@@ -104,11 +189,47 @@ static int pxa2xx_pcmcia_set_mcio( int s
 
 static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
 {
-	MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	u_int set, cas, hold;
+	int spd = speed;
+static int x = 1;
+	do {
+	 switch(speed) {
+			 case 600:
+					 cas = 300; /*tw(WE)*/
+					 set = 100; /*tsu(A)*/
+					 hold = 70; /*trec(WE)*/
+					 break;
+			 case 300:
+					 /* FIXME */
+					 if(x) {
+					  printk("setting mcatt for 300ns cycle\n");
+					  x = 0;
+					 }
+					 cas = 150; /*tw(WE)*/
+					 set = 30;  /*tsu(A)*/
+					 hold = 30; /*trec(WE)*/
+					 break;
+			 default:
+					 if(speed > 600) {
+					  set = 100;
+					  hold = 70;
+					  cas = 300+(speed-600);
+					 } else {
+					  speed = (speed/100+1)*100;
+					  cas = 0;
+					 }
+	 }
+	} while(cas == 0);
+
+	/* Adjust to meet minimal cycle requirement? */
+	if(cas+set+hold < spd) hold = spd - cas - set;
+
+
+	MCATT(sock) = ((pxa2xx_mcxx_setup(set, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
-		| ((pxa2xx_mcxx_asst(speed, clock)
+		| ((pxa2xx_mcxx_asst(cas, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
-		| ((pxa2xx_mcxx_hold(speed, clock)
+		| ((pxa2xx_mcxx_hold(hold, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
 	return 0;
--- linux-2.6.16-oe/arch/arm/mach-pxa/corgi_lcd.c	Wed Mar 29 19:01:35 2006
+++ linux-2.6.16/arch/arm/mach-pxa/corgi_lcd.c	Fri Mar 31 19:56:34 2006
@@ -433,9 +433,10 @@ struct platform_device corgifb_device = 
 
 void spitz_lcd_power(int on)
 {
-	if (on)
-		lcdtg_hw_init(480);
-	else
+	if (on) {
+ 	    if(on != 480 && on != 240) on = 480;
+		lcdtg_hw_init(on);
+	} else
 		lcdtg_suspend();
 }
 
@@ -515,7 +516,22 @@ void spitz_put_hsync(void)
 
 void spitz_wait_hsync(void)
 {
-	sharpsl_wait_sync(SPITZ_GPIO_HSYNC);
+	int gpio = SPITZ_GPIO_HSYNC;
+	int i;
+
+	if((LCCR0 & (LCCR0_ENB|LCCR0_DIS)) != LCCR0_ENB) return;
+
+	/* 
+	 * HS = 1.0/(100Hz * 640) is apporximate hsync time 
+	 * HS / (1/416Mhz) = 6500 cycles
+	 * So 5000 iterations should be enough.
+	 */
+	i = 0; 
+	while((GPLR(gpio) & GPIO_bit(gpio)) == 0) 
+	 if(i++ > 5000) return;
+	i = 0;
+	while((GPLR(gpio) & GPIO_bit(gpio)) != 0)
+	 if(i++ > 5000) return;
 }
 #endif
 
--- linux-2.6.16-oe/arch/arm/mach-pxa/spitz.c	Thu Mar 30 16:55:15 2006
+++ linux-2.6.16/arch/arm/mach-pxa/spitz.c	Fri Mar 31 19:56:34 2006
@@ -458,6 +458,9 @@ static struct platform_device *devices[]
 	&spitzled_device,
 };
 
+unsigned _LCDBSCNTR = 2;
+unsigned _ARB_CNTRL = 0x01800f11;
+
 static void __init common_init(void)
 {
 	PMCR = 0x00;
@@ -476,6 +479,8 @@ static void __init common_init(void)
 	corgi_ssp_set_machinfo(&spitz_ssp_machinfo);
 
 	pxa_gpio_mode(SPITZ_GPIO_HSYNC | GPIO_IN);
+	LCDBSCNTR = _LCDBSCNTR;
+	ARB_CNTRL = _ARB_CNTRL;
 
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 	pxa_set_udc_info(&spitz_udc_info);

--- linux-2.6.16-oe/arch/arm/mach-pxa/spitz_pm.c	Thu Mar 30 16:55:15 2006
+++ linux-2.6.16/arch/arm/mach-pxa/spitz_pm.c	Fri Mar 31 19:56:34 2006
@@ -111,7 +111,9 @@ static void spitz_presuspend(void)
 	PRER = GPIO_bit(SPITZ_GPIO_KEY_INT);
 	PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
 	PWER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET) | PWER_RTC;
-	PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
+	/* PKWR = GPIO_bit(SPITZ_GPIO_SYNC) | GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); */
+	/* PKWR = 0; */
+	PKWR = 1<<12/* ON KEY = GPIO 95 */;
 	PKSR = 0xffffffff; // clear
 
 	/* nRESET_OUT Disable */
@@ -124,50 +126,50 @@ static void spitz_presuspend(void)
 	PCFR = PCFR_GPR_EN | PCFR_OPDE;
 }
 
+extern unsigned _LCDBSCNTR;
+extern unsigned _ARB_CNTRL;
 static void spitz_postsuspend(void)
 {
 	pxa_gpio_mode(GPIO18_RDY_MD);
 	pxa_gpio_mode(10 | GPIO_IN);
+	LCDBSCNTR = _LCDBSCNTR;
+	ARB_CNTRL = _ARB_CNTRL;
 }
 
--- linux-2.6.16-oe/include/asm-arm/arch-pxa/pxa-regs.h	Wed Mar 29 19:03:05 2006
+++ linux-2.6.16/include/asm-arm/arch-pxa/pxa-regs.h	Fri Mar 31 19:56:35 2006
@@ -2337,6 +2337,16 @@
 #define IMPMSR_PS0_RUN_MODE	(0x0 << 0) /*    Run mode */
 #define IMPMSR_PS0_STANDBY_MODE	(0x1 << 0) /*    Standby mode */
 
+#define ARB_CNTRL	__REG(0x48000048) /* Arbiter Control */
+#define LCDBSCNTR	__REG(0x48000054) /* LCD Buffer Strength Control */
+#define LCDBSCNTR_LCDBS	(0xf << 0) /* LCD buffer strength */
+#define BSCNTR0	__REG(0x4800004C) /* Memory Buffer Strength Control Register 0 */
+#define BSCNTR1	__REG(0x48000050) /* Memory Buffer Strength Control Register 1 */
+#define BSCNTR2	__REG(0x4800005C) /* Memory Buffer Strength Control Register 2 */
+#define BSCNTR2_CLK3BS	(0xf << 4) /* SDCLK<3> (internal flash clock) buffer strength */
+#define BSCNTR3	__REG(0x48000060) /* Memory Buffer Strength Control Register 3 */
+
+
 #endif
 
 /* PWRMODE register M field values */
--- linux-2.6.16-oe/include/asm-arm/hardware/sharpsl_pm.h	Thu Mar 30 16:55:15 2006
+++ linux-2.6.16/include/asm-arm/hardware/sharpsl_pm.h	Fri Mar 31 19:56:35 2006
@@ -83,6 +83,7 @@ struct sharpsl_pm_status {
 #define SHARPSL_BL_LIMIT        (1 << 2)  /* Backlight Intensity Limited */
 #define SHARPSL_APM_QUEUED      (1 << 3)  /* APM Event Queued */
 #define SHARPSL_DO_OFFLINE_CHRG (1 << 4)  /* Trigger the offline charger */
+#define SHARPSL_CHECK_BAT_VOLT	(1 << 5)
 
 	int full_count;
 	unsigned long charge_start_time;
--- linux-2.6.16-oe/include/linux/ide.h	Wed Mar 29 19:03:11 2006
+++ linux-2.6.16/include/linux/ide.h	Fri Apr 14 11:56:53 2006
@@ -216,6 +216,7 @@ typedef struct hw_regs_s {
 	ide_ack_intr_t	*ack_intr;		/* acknowledge interrupt */
 	hwif_chipset_t  chipset;
 	struct device	*dev;
+	dma_addr_t     io_phys;
 } hw_regs_t;
 
 /*
@@ -801,6 +802,9 @@ typedef struct hwif_s {
 	unsigned dma;
 
 	void (*led_act)(void *data, int rw);
+ 	unsigned   piodma;
+ 	int        piodmach;
+ 	dma_addr_t io_phys;
 } ____cacheline_internodealigned_in_smp ide_hwif_t;
 
 /*
@@ -1149,7 +1153,9 @@ extern ide_startstop_t set_geometry_intr
 extern ide_startstop_t recal_intr(ide_drive_t *);
 extern ide_startstop_t task_no_data_intr(ide_drive_t *);
 extern ide_startstop_t task_in_intr(ide_drive_t *);
+extern ide_startstop_t task_in_intr_piodma(ide_drive_t *);
 extern ide_startstop_t pre_task_out_intr(ide_drive_t *, struct request *);
+extern ide_startstop_t pre_task_out_intr_piodma(ide_drive_t *, struct request *);
 
 extern int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *);
 
@@ -1373,5 +1379,9 @@ static inline int hwif_to_node(ide_hwif_
 	struct pci_dev *dev = hwif->pci_dev;
 	return dev ? pcibus_to_node(dev->bus) : -1;
 }
+
+extern void ide_piodma_free(ide_hwif_t *hwif);
+extern void ide_piodma_allocate(ide_hwif_t *hwif);
+
 
 #endif /* _IDE_H */

