blob: 1ca1102b4a2f0386b5ee2993588d6fb48f832a91 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070015static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
16{
Michael Neuling193cac92006-01-11 12:08:56 +110017 struct device_node *np;
Stephen Rothwellceef8772007-04-03 22:24:06 +100018 const u32 *prop;
Michael Neuling193cac92006-01-11 12:08:56 +110019 u32 io1, io2;
20 int propsize;
21 int count = 0;
Martyn Welch7cad1972010-04-26 22:50:21 +000022 int virq;
23
Michael Neuling193cac92006-01-11 12:08:56 +110024 for (np = NULL; (np = of_find_compatible_node(np,
25 "parallel",
26 "pnpPNP,400")) != NULL;) {
Stephen Rothwellceef8772007-04-03 22:24:06 +100027 prop = of_get_property(np, "reg", &propsize);
Michael Neuling193cac92006-01-11 12:08:56 +110028 if (!prop || propsize > 6*sizeof(u32))
29 continue;
30 io1 = prop[1]; io2 = prop[2];
Martyn Welch7cad1972010-04-26 22:50:21 +000031
32 virq = irq_of_parse_and_map(np, 0);
33 if (virq == NO_IRQ)
Michael Neuling193cac92006-01-11 12:08:56 +110034 continue;
Martyn Welch7cad1972010-04-26 22:50:21 +000035
36 if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
37 != NULL)
Michael Neuling193cac92006-01-11 12:08:56 +110038 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) */