blob: 414c50e2e8819df9d1cef2e06655801927db6359 [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;
22 for (np = NULL; (np = of_find_compatible_node(np,
23 "parallel",
24 "pnpPNP,400")) != NULL;) {
Stephen Rothwellceef8772007-04-03 22:24:06 +100025 prop = of_get_property(np, "reg", &propsize);
Michael Neuling193cac92006-01-11 12:08:56 +110026 if (!prop || propsize > 6*sizeof(u32))
27 continue;
28 io1 = prop[1]; io2 = prop[2];
Stephen Rothwellceef8772007-04-03 22:24:06 +100029 prop = of_get_property(np, "interrupts", NULL);
Michael Neuling193cac92006-01-11 12:08:56 +110030 if (!prop)
31 continue;
32 if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
33 count++;
34 }
35 return count;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036}
37
Arnd Bergmann88ced032005-12-16 22:43:46 +010038#endif /* __KERNEL__ */
David Gibson2765ca22005-10-24 13:07:23 +100039#endif /* !(_ASM_POWERPC_PARPORT_H) */