8250_hub6.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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/serial_8250.h>
  12. #define HUB6(card,port) \
  13. { \
  14. .iobase = 0x302, \
  15. .irq = 3, \
  16. .uartclk = 1843200, \
  17. .iotype = UPIO_HUB6, \
  18. .flags = UPF_BOOT_AUTOCONF, \
  19. .hub6 = (card) << 6 | (port) << 3 | 1, \
  20. }
  21. static struct plat_serial8250_port hub6_data[] = {
  22. HUB6(0, 0),
  23. HUB6(0, 1),
  24. HUB6(0, 2),
  25. HUB6(0, 3),
  26. HUB6(0, 4),
  27. HUB6(0, 5),
  28. HUB6(1, 0),
  29. HUB6(1, 1),
  30. HUB6(1, 2),
  31. HUB6(1, 3),
  32. HUB6(1, 4),
  33. HUB6(1, 5),
  34. { },
  35. };
  36. static struct platform_device hub6_device = {
  37. .name = "serial8250",
  38. .id = PLAT8250_DEV_HUB6,
  39. .dev = {
  40. .platform_data = hub6_data,
  41. },
  42. };
  43. static int __init hub6_init(void)
  44. {
  45. return platform_device_register(&hub6_device);
  46. }
  47. module_init(hub6_init);
  48. MODULE_AUTHOR("Russell King");
  49. MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards");
  50. MODULE_LICENSE("GPL");