xref: /linux/drivers/tty/serial/8250/8250_hub6.c (revision 664b0bae0b87f69bc9deb098f5e0158b9cf18e04)
1*e3b3d0f5SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
29bef3d41SPaul Gortmaker /*
39bef3d41SPaul Gortmaker  *  Copyright (C) 2005 Russell King.
49bef3d41SPaul Gortmaker  *  Data taken from include/asm-i386/serial.h
59bef3d41SPaul Gortmaker  */
69bef3d41SPaul Gortmaker #include <linux/module.h>
79bef3d41SPaul Gortmaker #include <linux/init.h>
89bef3d41SPaul Gortmaker #include <linux/serial_8250.h>
99bef3d41SPaul Gortmaker 
109bef3d41SPaul Gortmaker #define HUB6(card, port)						\
119bef3d41SPaul Gortmaker 	{								\
129bef3d41SPaul Gortmaker 		.iobase		= 0x302,				\
139bef3d41SPaul Gortmaker 		.irq		= 3,					\
149bef3d41SPaul Gortmaker 		.uartclk	= 1843200,				\
159bef3d41SPaul Gortmaker 		.iotype		= UPIO_HUB6,				\
169bef3d41SPaul Gortmaker 		.flags		= UPF_BOOT_AUTOCONF,			\
179bef3d41SPaul Gortmaker 		.hub6		= (card) << 6 | (port) << 3 | 1,	\
189bef3d41SPaul Gortmaker 	}
199bef3d41SPaul Gortmaker 
209bef3d41SPaul Gortmaker static struct plat_serial8250_port hub6_data[] = {
219bef3d41SPaul Gortmaker 	HUB6(0, 0),
229bef3d41SPaul Gortmaker 	HUB6(0, 1),
239bef3d41SPaul Gortmaker 	HUB6(0, 2),
249bef3d41SPaul Gortmaker 	HUB6(0, 3),
259bef3d41SPaul Gortmaker 	HUB6(0, 4),
269bef3d41SPaul Gortmaker 	HUB6(0, 5),
279bef3d41SPaul Gortmaker 	HUB6(1, 0),
289bef3d41SPaul Gortmaker 	HUB6(1, 1),
299bef3d41SPaul Gortmaker 	HUB6(1, 2),
309bef3d41SPaul Gortmaker 	HUB6(1, 3),
319bef3d41SPaul Gortmaker 	HUB6(1, 4),
329bef3d41SPaul Gortmaker 	HUB6(1, 5),
339bef3d41SPaul Gortmaker 	{ },
349bef3d41SPaul Gortmaker };
359bef3d41SPaul Gortmaker 
369bef3d41SPaul Gortmaker static struct platform_device hub6_device = {
379bef3d41SPaul Gortmaker 	.name			= "serial8250",
389bef3d41SPaul Gortmaker 	.id			= PLAT8250_DEV_HUB6,
399bef3d41SPaul Gortmaker 	.dev			= {
409bef3d41SPaul Gortmaker 		.platform_data	= hub6_data,
419bef3d41SPaul Gortmaker 	},
429bef3d41SPaul Gortmaker };
439bef3d41SPaul Gortmaker 
hub6_init(void)449bef3d41SPaul Gortmaker static int __init hub6_init(void)
459bef3d41SPaul Gortmaker {
469bef3d41SPaul Gortmaker 	return platform_device_register(&hub6_device);
479bef3d41SPaul Gortmaker }
489bef3d41SPaul Gortmaker 
499bef3d41SPaul Gortmaker module_init(hub6_init);
509bef3d41SPaul Gortmaker 
519bef3d41SPaul Gortmaker MODULE_AUTHOR("Russell King");
529bef3d41SPaul Gortmaker MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards");
539bef3d41SPaul Gortmaker MODULE_LICENSE("GPL");
54