• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (C) 2005 Russell King.
3  *  Data taken from include/asm-i386/serial.h
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  */
9 #include <linux/module.h>
10 #include <linux/init.h>
11 #include <linux/mca.h>
12 #include <linux/serial_8250.h>
13 
14 /*
15  * FIXME: Should we be doing AUTO_IRQ here?
16  */
17 #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
18 #define MCA_FLAGS	UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ
19 #else
20 #define MCA_FLAGS	UPF_BOOT_AUTOCONF | UPF_SKIP_TEST
21 #endif
22 
23 #define PORT(_base,_irq)			\
24 	{					\
25 		.iobase		= _base,	\
26 		.irq		= _irq,		\
27 		.uartclk	= 1843200,	\
28 		.iotype		= UPIO_PORT,	\
29 		.flags		= MCA_FLAGS,	\
30 	}
31 
32 static struct plat_serial8250_port mca_data[] = {
33 	PORT(0x3220, 3),
34 	PORT(0x3228, 3),
35 	PORT(0x4220, 3),
36 	PORT(0x4228, 3),
37 	PORT(0x5220, 3),
38 	PORT(0x5228, 3),
39 	{ },
40 };
41 
42 static struct platform_device mca_device = {
43 	.name			= "serial8250",
44 	.id			= PLAT8250_DEV_MCA,
45 	.dev			= {
46 		.platform_data	= mca_data,
47 	},
48 };
49 
mca_init(void)50 static int __init mca_init(void)
51 {
52 	if (!MCA_bus)
53 		return -ENODEV;
54 	return platform_device_register(&mca_device);
55 }
56 
57 module_init(mca_init);
58 
59 MODULE_AUTHOR("Russell King");
60 MODULE_DESCRIPTION("8250 serial probe module for MCA ports");
61 MODULE_LICENSE("GPL");
62