blob: d20abf04541e5f43c608ba4ec53d8ef9f9033a38 [file] [log] [blame]
Russell Kingec9f47c2005-06-27 11:12:54 +01001/*
Russell Kingec9f47c2005-06-27 11:12:54 +01002 * 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 */
Russell Kingec9f47c2005-06-27 11:12:54 +01009#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
32static 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
42static struct platform_device mca_device = {
43 .name = "serial8250",
Russell King6df29de2005-09-08 16:04:41 +010044 .id = PLAT8250_DEV_MCA,
Russell Kingec9f47c2005-06-27 11:12:54 +010045 .dev = {
46 .platform_data = mca_data,
47 },
48};
49
50static int __init mca_init(void)
51{
52 if (!MCA_bus)
53 return -ENODEV;
54 return platform_device_register(&mca_device);
55}
56
57module_init(mca_init);
58
59MODULE_AUTHOR("Russell King");
60MODULE_DESCRIPTION("8250 serial probe module for MCA ports");
61MODULE_LICENSE("GPL");