blob: 3fca21ddf546c4213f863bffa8cf7790d612e516 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 Gibson2765ca22005-10-24 13:07:23 +10009#ifndef _ASM_POWERPC_PARPORT_H
10#define _ASM_POWERPC_PARPORT_H
Arnd Bergmann88ced032005-12-16 22:43:46 +010011#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Michael Neuling193cac92006-01-11 12:08:56 +110013#include <asm/prom.h>
14
15extern struct parport *parport_pc_probe_port (unsigned long int base,
16 unsigned long int base_hi,
17 int irq, int dma,
18 struct pci_dev *dev);
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
21{
Michael Neuling193cac92006-01-11 12:08:56 +110022 struct device_node *np;
23 u32 *prop;
24 u32 io1, io2;
25 int propsize;
26 int count = 0;
27 for (np = NULL; (np = of_find_compatible_node(np,
28 "parallel",
29 "pnpPNP,400")) != NULL;) {
30 prop = (u32 *)get_property(np, "reg", &propsize);
31 if (!prop || propsize > 6*sizeof(u32))
32 continue;
33 io1 = prop[1]; io2 = prop[2];
34 prop = (u32 *)get_property(np, "interrupts", NULL);
35 if (!prop)
36 continue;
37 if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
38 count++;
39 }
40 return count;
Linus Torvalds1da177e2005-04-16 15:20:36 -070041}
42
Arnd Bergmann88ced032005-12-16 22:43:46 +010043#endif /* __KERNEL__ */
David Gibson2765ca22005-10-24 13:07:23 +100044#endif /* !(_ASM_POWERPC_PARPORT_H) */