1 /* Parallel-port initialisation code.
3 * Authors: David Campbell <campbell@tirian.che.curtin.edu.au>
4 * Tim Waugh <tim@cyberelk.demon.co.uk>
5 * Jose Renau <renau@acm.org>
7 * based on work by Grant Guenther <grant@torque.net>
8 * and Philip Blundell <Philip.Blundell@pobox.com>
11 #include <linux/config.h>
12 #include <linux/module.h>
13 #include <linux/tasks.h>
15 #include <linux/parport.h>
16 #include <linux/errno.h>
17 #include <linux/kernel.h>
18 #include <linux/malloc.h>
19 #include <linux/init.h>
20 #include <linux/kerneld.h>
23 static int io
[PARPORT_MAX
+1] __initdata
= { [0 ... PARPORT_MAX
] = 0 };
24 static int irq
[PARPORT_MAX
] __initdata
= { [0 ... PARPORT_MAX
-1] = PARPORT_IRQ_NONE
};
25 static int dma
[PARPORT_MAX
] __initdata
= { [0 ... PARPORT_MAX
-1] = PARPORT_DMA_NONE
};
27 extern int parport_pc_init(int *io
, int *irq
, int *dma
);
28 extern int parport_ax_init(void);
30 static int parport_setup_ptr __initdata
= 0;
32 __initfunc(void parport_setup(char *str
, int *ints
))
34 if (ints
[0] == 0 || ints
[1] == 0) {
35 /* Disable parport if "parport=" or "parport=0" in cmdline */
36 io
[0] = PARPORT_DISABLE
;
39 if (parport_setup_ptr
< PARPORT_MAX
) {
40 io
[parport_setup_ptr
] = ints
[1];
42 irq
[parport_setup_ptr
] = ints
[2];
43 if (ints
[0]>2) dma
[parport_setup_ptr
] = ints
[3];
47 printk(KERN_ERR
"parport=0x%x", ints
[1]);
49 printk(",%d", ints
[2]);
50 if (ints
[0]>2) printk(",%d", ints
[3]);
52 printk(" ignored, too many ports.\n");
64 void cleanup_module(void)
66 parport_proc_cleanup();
69 __initfunc(int parport_init(void))
71 if (io
[0] == PARPORT_DISABLE
)
74 #ifdef CONFIG_PNP_PARPORT
75 parport_probe_hook
= &parport_probe_one
;
78 #ifdef CONFIG_PARPORT_PC
79 parport_pc_init(io
, irq
, dma
);
81 #ifdef CONFIG_PARPORT_AX
88 /* Exported symbols for modules. */
90 EXPORT_SYMBOL(parport_claim
);
91 EXPORT_SYMBOL(parport_release
);
92 EXPORT_SYMBOL(parport_register_port
);
93 EXPORT_SYMBOL(parport_unregister_port
);
94 EXPORT_SYMBOL(parport_quiesce
);
95 EXPORT_SYMBOL(parport_register_device
);
96 EXPORT_SYMBOL(parport_unregister_device
);
97 EXPORT_SYMBOL(parport_enumerate
);
98 EXPORT_SYMBOL(parport_ieee1284_nibble_mode_ok
);
99 EXPORT_SYMBOL(parport_wait_peripheral
);
100 EXPORT_SYMBOL(parport_proc_register
);
101 EXPORT_SYMBOL(parport_proc_unregister
);
102 EXPORT_SYMBOL(parport_probe_hook
);
104 void inc_parport_count(void)
111 void dec_parport_count(void)