Import 2.3.18pre1
[davej-history.git] / include / asm-alpha / parport.h
blobe9b590ee1be0c11113242754c332276eab4c782b
1 /*
2 * parport.h: platform-specific PC-style parport initialisation
4 * Copyright (C) 1999 Tim Waugh <tim@cyberelk.demon.co.uk>
6 * This file should only be included by drivers/parport/parport_pc.c.
7 */
9 #ifndef _ASM_AXP_PARPORT_H
10 #define _ASM_AXP_PARPORT_H 1
12 #include <linux/config.h>
14 /* Maximum number of ports to support. It is useless to set this greater
15 than PARPORT_MAX (in <linux/parport.h>). */
16 #define PARPORT_PC_MAX_PORTS 8
18 /* If parport_cs (PCMCIA) is managing ports for us, we'll need the
19 * probing routines forever; otherwise we can lose them at boot time. */
20 #ifdef CONFIG_PARPORT_PC_PCMCIA
21 #define __maybe_initdata
22 #define __maybe_init
23 #else
24 #define __maybe_initdata __initdata
25 #define __maybe_init __init
26 #endif
28 static int __maybe_init parport_pc_init_pci(int irq, int dma);
30 static int user_specified __maybe_initdata = 0;
31 int __init
32 parport_pc_init(int *io, int *io_hi, int *irq, int *dma)
34 int count = 0, i = 0;
36 if (io && *io) {
37 /* Only probe the ports we were given. */
38 user_specified = 1;
39 do {
40 if (!*io_hi) *io_hi = 0x400 + *io;
41 if (parport_pc_probe_port(*(io++), *(io_hi++),
42 *(irq++), *(dma++)))
43 count++;
44 } while (*io && (++i < PARPORT_PC_MAX_PORTS));
45 } else {
46 /* Probe all the likely ports. */
47 if (parport_pc_probe_port(0x3bc, 0x7bc, irq[0], dma[0]))
48 count++;
49 if (parport_pc_probe_port(0x378, 0x778, irq[0], dma[0]))
50 count++;
51 if (parport_pc_probe_port(0x278, 0x678, irq[0], dma[0]))
52 count++;
53 count += parport_pc_init_pci (irq[0], dma[0]);
56 return count;
59 #endif /* !(_ASM_AXP_PARPORT_H) */