8250_mca.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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/config.h>
  12. #include <linux/module.h>
  13. #include <linux/init.h>
  14. #include <linux/mca.h>
  15. #include <linux/serial_8250.h>
  16. /*
  17. * FIXME: Should we be doing AUTO_IRQ here?
  18. */
  19. #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
  20. #define MCA_FLAGS UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ
  21. #else
  22. #define MCA_FLAGS UPF_BOOT_AUTOCONF | UPF_SKIP_TEST
  23. #endif
  24. #define PORT(_base,_irq) \
  25. { \
  26. .iobase = _base, \
  27. .irq = _irq, \
  28. .uartclk = 1843200, \
  29. .iotype = UPIO_PORT, \
  30. .flags = MCA_FLAGS, \
  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. static struct platform_device mca_device = {
  42. .name = "serial8250",
  43. .id = PLAT8250_DEV_MCA,
  44. .dev = {
  45. .platform_data = mca_data,
  46. },
  47. };
  48. static int __init mca_init(void)
  49. {
  50. if (!MCA_bus)
  51. return -ENODEV;
  52. return platform_device_register(&mca_device);
  53. }
  54. module_init(mca_init);
  55. MODULE_AUTHOR("Russell King");
  56. MODULE_DESCRIPTION("8250 serial probe module for MCA ports");
  57. MODULE_LICENSE("GPL");