]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | /* |
3 | * parport.h: platform-specific PC-style parport initialisation | |
4 | * | |
5 | * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk> | |
6 | * | |
7 | * This file should only be included by drivers/parport/parport_pc.c. | |
8 | */ | |
9 | ||
2765ca25 DG |
10 | #ifndef _ASM_POWERPC_PARPORT_H |
11 | #define _ASM_POWERPC_PARPORT_H | |
88ced031 | 12 | #ifdef __KERNEL__ |
1da177e4 | 13 | |
193cac99 MN |
14 | #include <asm/prom.h> |
15 | ||
cad5cef6 | 16 | static int parport_pc_find_nonpci_ports (int autoirq, int autodma) |
1da177e4 | 17 | { |
193cac99 | 18 | struct device_node *np; |
ceef8778 | 19 | const u32 *prop; |
193cac99 MN |
20 | u32 io1, io2; |
21 | int propsize; | |
22 | int count = 0; | |
7cad1978 MW |
23 | int virq; |
24 | ||
342ea00f | 25 | for_each_compatible_node(np, "parallel", "pnpPNP,400") { |
ceef8778 | 26 | prop = of_get_property(np, "reg", &propsize); |
193cac99 MN |
27 | if (!prop || propsize > 6*sizeof(u32)) |
28 | continue; | |
29 | io1 = prop[1]; io2 = prop[2]; | |
7cad1978 MW |
30 | |
31 | virq = irq_of_parse_and_map(np, 0); | |
ef24ba70 | 32 | if (!virq) |
193cac99 | 33 | continue; |
7cad1978 MW |
34 | |
35 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) | |
36 | != NULL) | |
193cac99 MN |
37 | count++; |
38 | } | |
39 | return count; | |
1da177e4 LT |
40 | } |
41 | ||
88ced031 | 42 | #endif /* __KERNEL__ */ |
2765ca25 | 43 | #endif /* !(_ASM_POWERPC_PARPORT_H) */ |