blob: a452968b29ea9d9fead23f883cf3d255bf9bbe9e [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
Greg Kroah-Hartmancad5cef2012-12-21 14:04:10 -080015static int parport_pc_find_nonpci_ports (int autoirq, int autodma)
Linus Torvalds1da177e2005-04-16 15:20:36 -070016{
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
Wei Yongjun342ea002013-03-11 04:24:18 +000024 for_each_compatible_node(np, "parallel", "pnpPNP,400") {
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];
Martyn Welch7cad1972010-04-26 22:50:21 +000029
30 virq = irq_of_parse_and_map(np, 0);
31 if (virq == NO_IRQ)
Michael Neuling193cac92006-01-11 12:08:56 +110032 continue;
Martyn Welch7cad1972010-04-26 22:50:21 +000033
34 if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0)
35 != NULL)
Michael Neuling193cac92006-01-11 12:08:56 +110036 count++;
37 }
38 return count;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039}
40
Arnd Bergmann88ced032005-12-16 22:43:46 +010041#endif /* __KERNEL__ */
David Gibson2765ca22005-10-24 13:07:23 +100042#endif /* !(_ASM_POWERPC_PARPORT_H) */