Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * parport.h: platform-specific PC-style parport initialisation |
| 3 | * |
| 4 | * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> |
| 5 | * |
| 6 | * This file should only be included by drivers/parport/parport_pc.c. |
| 7 | */ |
| 8 | |
David Gibson | 2765ca2 | 2005-10-24 13:07:23 +1000 | [diff] [blame] | 9 | #ifndef _ASM_POWERPC_PARPORT_H |
| 10 | #define _ASM_POWERPC_PARPORT_H |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 11 | #ifdef __KERNEL__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 13 | #include <asm/prom.h> |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) |
| 16 | { |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 17 | struct device_node *np; |
Stephen Rothwell | ceef877 | 2007-04-03 22:24:06 +1000 | [diff] [blame] | 18 | const u32 *prop; |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 19 | u32 io1, io2; |
| 20 | int propsize; |
| 21 | int count = 0; |
Martyn Welch | 7cad197 | 2010-04-26 22:50:21 +0000 | [diff] [blame] | 22 | int virq; |
| 23 | |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 24 | for (np = NULL; (np = of_find_compatible_node(np, |
| 25 | "parallel", |
| 26 | "pnpPNP,400")) != NULL;) { |
Stephen Rothwell | ceef877 | 2007-04-03 22:24:06 +1000 | [diff] [blame] | 27 | prop = of_get_property(np, "reg", &propsize); |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 28 | if (!prop || propsize > 6*sizeof(u32)) |
| 29 | continue; |
| 30 | io1 = prop[1]; io2 = prop[2]; |
Martyn Welch | 7cad197 | 2010-04-26 22:50:21 +0000 | [diff] [blame] | 31 | |
| 32 | virq = irq_of_parse_and_map(np, 0); |
| 33 | if (virq == NO_IRQ) |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 34 | continue; |
Martyn Welch | 7cad197 | 2010-04-26 22:50:21 +0000 | [diff] [blame] | 35 | |
| 36 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) |
| 37 | != NULL) |
Michael Neuling | 193cac9 | 2006-01-11 12:08:56 +1100 | [diff] [blame] | 38 | count++; |
| 39 | } |
| 40 | return count; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | } |
| 42 | |
Arnd Bergmann | 88ced03 | 2005-12-16 22:43:46 +0100 | [diff] [blame] | 43 | #endif /* __KERNEL__ */ |
David Gibson | 2765ca2 | 2005-10-24 13:07:23 +1000 | [diff] [blame] | 44 | #endif /* !(_ASM_POWERPC_PARPORT_H) */ |