smsc911x.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Specification for the SMSC911x NIC
  2. *
  3. * Copyright (C) 2006 Matsushita Electric Industrial Co., Ltd.
  4. * All Rights Reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/io.h>
  15. #include <linux/ioport.h>
  16. #include <linux/smsc911x.h>
  17. #include <unit/smsc911x.h>
  18. static struct smsc911x_platform_config smsc911x_config = {
  19. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  20. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  21. .flags = SMSC911X_USE_32BIT,
  22. };
  23. static struct resource smsc911x_resources[] = {
  24. [0] = {
  25. .start = SMSC911X_BASE,
  26. .end = SMSC911X_BASE_END,
  27. .flags = IORESOURCE_MEM,
  28. },
  29. [1] = {
  30. .start = SMSC911X_IRQ,
  31. .end = SMSC911X_IRQ,
  32. .flags = IORESOURCE_IRQ,
  33. },
  34. };
  35. static struct platform_device smsc911x_device = {
  36. .name = "smsc911x",
  37. .id = 0,
  38. .num_resources = ARRAY_SIZE(smsc911x_resources),
  39. .resource = smsc911x_resources,
  40. .dev = {
  41. .platform_data = &smsc911x_config,
  42. }
  43. };
  44. /*
  45. * add platform devices
  46. */
  47. static int __init unit_device_init(void)
  48. {
  49. platform_device_register(&smsc911x_device);
  50. return 0;
  51. }
  52. device_initcall(unit_device_init);