8250_hub6.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (C) 2005 Russell King.
  4. * Data taken from include/asm-i386/serial.h
  5. */
  6. #include <linux/module.h>
  7. #include <linux/init.h>
  8. #include <linux/serial_8250.h>
  9. #define HUB6(card, port) \
  10. { \
  11. .iobase = 0x302, \
  12. .irq = 3, \
  13. .uartclk = 1843200, \
  14. .iotype = UPIO_HUB6, \
  15. .flags = UPF_BOOT_AUTOCONF, \
  16. .hub6 = (card) << 6 | (port) << 3 | 1, \
  17. }
  18. static struct plat_serial8250_port hub6_data[] = {
  19. HUB6(0, 0),
  20. HUB6(0, 1),
  21. HUB6(0, 2),
  22. HUB6(0, 3),
  23. HUB6(0, 4),
  24. HUB6(0, 5),
  25. HUB6(1, 0),
  26. HUB6(1, 1),
  27. HUB6(1, 2),
  28. HUB6(1, 3),
  29. HUB6(1, 4),
  30. HUB6(1, 5),
  31. { },
  32. };
  33. static struct platform_device hub6_device = {
  34. .name = "serial8250",
  35. .id = PLAT8250_DEV_HUB6,
  36. .dev = {
  37. .platform_data = hub6_data,
  38. },
  39. };
  40. static int __init hub6_init(void)
  41. {
  42. return platform_device_register(&hub6_device);
  43. }
  44. module_init(hub6_init);
  45. MODULE_AUTHOR("Russell King");
  46. MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards");
  47. MODULE_LICENSE("GPL");