xref: /linux/drivers/tty/serial/8250/8250_hub6.c (revision 80d443e8876602be2c130f79c4de81e12e2a700d)
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/serial_8250.h>
12 
13 #define HUB6(card, port)						\
14 	{								\
15 		.iobase		= 0x302,				\
16 		.irq		= 3,					\
17 		.uartclk	= 1843200,				\
18 		.iotype		= UPIO_HUB6,				\
19 		.flags		= UPF_BOOT_AUTOCONF,			\
20 		.hub6		= (card) << 6 | (port) << 3 | 1,	\
21 	}
22 
23 static struct plat_serial8250_port hub6_data[] = {
24 	HUB6(0, 0),
25 	HUB6(0, 1),
26 	HUB6(0, 2),
27 	HUB6(0, 3),
28 	HUB6(0, 4),
29 	HUB6(0, 5),
30 	HUB6(1, 0),
31 	HUB6(1, 1),
32 	HUB6(1, 2),
33 	HUB6(1, 3),
34 	HUB6(1, 4),
35 	HUB6(1, 5),
36 	{ },
37 };
38 
39 static struct platform_device hub6_device = {
40 	.name			= "serial8250",
41 	.id			= PLAT8250_DEV_HUB6,
42 	.dev			= {
43 		.platform_data	= hub6_data,
44 	},
45 };
46 
47 static int __init hub6_init(void)
48 {
49 	return platform_device_register(&hub6_device);
50 }
51 
52 module_init(hub6_init);
53 
54 MODULE_AUTHOR("Russell King");
55 MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards");
56 MODULE_LICENSE("GPL");
57