Commit | Line | Data |
---|---|---|
1da177e4 LT |
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 | ||
2765ca25 DG |
9 | #ifndef _ASM_POWERPC_PARPORT_H |
10 | #define _ASM_POWERPC_PARPORT_H | |
88ced031 | 11 | #ifdef __KERNEL__ |
1da177e4 | 12 | |
193cac99 MN |
13 | #include <asm/prom.h> |
14 | ||
cad5cef6 | 15 | static int parport_pc_find_nonpci_ports (int autoirq, int autodma) |
1da177e4 | 16 | { |
193cac99 | 17 | struct device_node *np; |
ceef8778 | 18 | const u32 *prop; |
193cac99 MN |
19 | u32 io1, io2; |
20 | int propsize; | |
21 | int count = 0; | |
7cad1978 MW |
22 | int virq; |
23 | ||
193cac99 MN |
24 | for (np = NULL; (np = of_find_compatible_node(np, |
25 | "parallel", | |
26 | "pnpPNP,400")) != NULL;) { | |
ceef8778 | 27 | prop = of_get_property(np, "reg", &propsize); |
193cac99 MN |
28 | if (!prop || propsize > 6*sizeof(u32)) |
29 | continue; | |
30 | io1 = prop[1]; io2 = prop[2]; | |
7cad1978 MW |
31 | |
32 | virq = irq_of_parse_and_map(np, 0); | |
33 | if (virq == NO_IRQ) | |
193cac99 | 34 | continue; |
7cad1978 MW |
35 | |
36 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) | |
37 | != NULL) | |
193cac99 MN |
38 | count++; |
39 | } | |
40 | return count; | |
1da177e4 LT |
41 | } |
42 | ||
88ced031 | 43 | #endif /* __KERNEL__ */ |
2765ca25 | 44 | #endif /* !(_ASM_POWERPC_PARPORT_H) */ |