8250_mca.c 1.3 KB

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