patch-2.4.5 linux/include/asm-sparc64/parport.h

Next file: linux/include/asm-sparc64/pbm.h
Previous file: linux/include/asm-sparc64/isa.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/include/asm-sparc64/parport.h linux/include/asm-sparc64/parport.h
@@ -1,4 +1,4 @@
-/* $Id: parport.h,v 1.10 2001/03/24 00:18:57 davem Exp $
+/* $Id: parport.h,v 1.11 2001/05/11 07:54:24 davem Exp $
  * parport.h: sparc64 specific parport initialization and dma.
  *
  * Copyright (C) 1999  Eddie C. Dost  (ecd@skynet.be)
@@ -8,6 +8,7 @@
 #define _ASM_SPARC64_PARPORT_H 1
 
 #include <asm/ebus.h>
+#include <asm/isa.h>
 #include <asm/ns87303.h>
 
 #define PARPORT_PC_MAX_PORTS	PARPORT_MAX
@@ -118,6 +119,43 @@
 	return 0;
 }
 
+static int parport_isa_probe(int count)
+{
+	struct isa_bridge *isa_br;
+	struct isa_device *isa_dev;
+
+	for_each_isa(isa_br) {
+		for_each_isadev(isa_dev, isa_br) {
+			struct isa_device *child;
+			unsigned long base;
+
+			if (strcmp(isa_dev->prom_name, "dma"))
+				continue;
+
+			child = isa_dev->child;
+			while (child) {
+				if (!strcmp(child->prom_name, "parallel"))
+					break;
+				child = child->next;
+			}
+			if (!child)
+				continue;
+
+			base = child->resource.start;
+
+			/* No DMA, see commentary in
+			 * asm-sparc64/floppy.h:isa_floppy_init()
+			 */
+			if (parport_pc_probe_port(base, base + 0x400,
+						  child->irq, PARPORT_DMA_NOFIFO,
+						  child->bus->self))
+				count++;
+		}
+	}
+
+	return count;
+}
+
 static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
 {
 	struct linux_ebus *ebus;
@@ -159,6 +197,8 @@
 			}
 		}
 	}
+
+	count = parport_isa_probe(count);
 
 	return count;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)