WIP FPC-III support
[linux/fpc-iii.git] / arch / powerpc / include / asm / parport.h
blob8abfb8f7c33dbe0c81ecc48496735b264afbec23
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * parport.h: platform-specific PC-style parport initialisation
5 * Copyright (C) 1999, 2000 Tim Waugh <tim@cyberelk.demon.co.uk>
7 * This file should only be included by drivers/parport/parport_pc.c.
8 */
10 #ifndef _ASM_POWERPC_PARPORT_H
11 #define _ASM_POWERPC_PARPORT_H
12 #ifdef __KERNEL__
14 #include <asm/prom.h>
16 static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
18 struct device_node *np;
19 const u32 *prop;
20 u32 io1, io2;
21 int propsize;
22 int count = 0;
23 int virq;
25 for_each_compatible_node(np, "parallel", "pnpPNP,400") {
26 prop = of_get_property(np, "reg", &propsize);
27 if (!prop || propsize > 6*sizeof(u32))
28 continue;
29 io1 = prop[1]; io2 = prop[2];
31 virq = irq_of_parse_and_map(np, 0);
32 if (!virq)
33 continue;
35 if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
36 != NULL)
37 count++;
39 return count;
42 #endif /* __KERNEL__ */
43 #endif /* !(_ASM_POWERPC_PARPORT_H) */