8250_mca.c 1.3 KB

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