patch-2.3.6 linux/drivers/misc/parport_ax.c
Next file: linux/drivers/misc/parport_init.c
Previous file: linux/drivers/misc/parport_atari.c
Back to the patch index
Back to the overall index
- Lines: 112
- Date:
Wed Jun 9 14:44:25 1999
- Orig file:
v2.3.5/linux/drivers/misc/parport_ax.c
- Orig date:
Wed Jun 2 14:44:39 1999
diff -u --recursive --new-file v2.3.5/linux/drivers/misc/parport_ax.c linux/drivers/misc/parport_ax.c
@@ -1,4 +1,4 @@
-/* $Id: parport_ax.c,v 1.17 1999/01/20 06:18:54 davem Exp $
+/* $Id: parport_ax.c,v 1.19 1999/06/09 08:24:40 davem Exp $
* Parallel-port routines for Sun Ultra/AX architecture
*
* Author: Eddie C. Dost <ecd@skynet.be>
@@ -201,39 +201,9 @@
writel(dcsr, (unsigned long)&dma->dcsr);
}
-void
-parport_ax_release_resources(struct parport *p)
-{
- if (p->irq != PARPORT_IRQ_NONE) {
- parport_ax_disable_irq(p);
- free_irq(p->irq, p);
- }
- release_region(p->base, p->size);
- if (p->modes & PARPORT_MODE_PCECR)
- release_region(p->base+0x400, 3);
- release_region((unsigned long)p->private_data,
- sizeof(struct linux_ebus_dma));
-}
-
int
parport_ax_claim_resources(struct parport *p)
{
- /* FIXME check that resources are free */
- int err;
-
- if (p->irq != PARPORT_IRQ_NONE) {
- if ((err = request_irq(p->irq, parport_ax_interrupt,
- 0, p->name, p)) != 0)
- return err;
- else
- parport_ax_enable_irq(p);
- }
- request_region(p->base, p->size, p->name);
- if (p->modes & PARPORT_MODE_PCECR)
- request_region(p->base+0x400, 3, p->name);
- request_region((unsigned long)p->private_data,
- sizeof(struct linux_ebus_dma), p->name);
- return 0;
}
void
@@ -332,9 +302,6 @@
parport_ax_change_mode,
- parport_ax_release_resources,
- parport_ax_claim_resources,
-
parport_ax_write_epp,
parport_ax_read_epp,
parport_ax_write_epp_addr,
@@ -572,6 +539,20 @@
if (p->dma == PARPORT_DMA_AUTO)
p->dma = (p->modes & PARPORT_MODE_PCECP) ? 0 : PARPORT_DMA_NONE;
+ if (p->irq != PARPORT_IRQ_NONE) {
+ int err;
+ if ((err = request_irq(p->irq, parport_ax_interrupt,
+ 0, p->name, p)) != 0)
+ return err;
+ else
+ parport_ax_enable_irq(p);
+ }
+ request_region(p->base, p->size, p->name);
+ if (p->modes & PARPORT_MODE_PCECR)
+ request_region(p->base+0x400, 3, p->name);
+ request_region((unsigned long)p->private_data,
+ sizeof(struct linux_ebus_dma), p->name);
+
printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
if (p->irq != PARPORT_IRQ_NONE)
printk(", irq %s", __irq_itoa(p->irq));
@@ -587,7 +568,6 @@
}
printk("]\n");
parport_proc_register(p);
- p->flags |= PARPORT_FLAG_COMA;
p->ops->write_control(p, 0x0c);
p->ops->write_data(p, 0);
@@ -595,6 +575,8 @@
if (parport_probe_hook)
(*parport_probe_hook)(p);
+ parport_announce_port (p);
+
return 1;
}
@@ -627,8 +609,15 @@
while (p) {
tmp = p->next;
if (p->modes & PARPORT_MODE_PCSPP) {
- if (!(p->flags & PARPORT_FLAG_COMA))
- parport_quiesce(p);
+ if (p->irq != PARPORT_IRQ_NONE) {
+ parport_ax_disable_irq(p);
+ free_irq(p->irq, p);
+ }
+ release_region(p->base, p->size);
+ if (p->modes & PARPORT_MODE_PCECR)
+ release_region(p->base+0x400, 3);
+ release_region((unsigned long)p->private_data,
+ sizeof(struct linux_ebus_dma));
parport_proc_unregister(p);
parport_unregister_port(p);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)