devices-rsk7264.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * RSK+SH7264 Support.
  4. *
  5. * Copyright (C) 2012 Renesas Electronics Europe
  6. */
  7. #include <linux/init.h>
  8. #include <linux/types.h>
  9. #include <linux/platform_device.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/input.h>
  12. #include <linux/smsc911x.h>
  13. #include <asm/machvec.h>
  14. #include <asm/io.h>
  15. static struct smsc911x_platform_config smsc911x_config = {
  16. .phy_interface = PHY_INTERFACE_MODE_MII,
  17. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  18. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  19. .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
  20. };
  21. static struct resource smsc911x_resources[] = {
  22. [0] = {
  23. .start = 0x28000000,
  24. .end = 0x280000ff,
  25. .flags = IORESOURCE_MEM,
  26. },
  27. [1] = {
  28. .start = 65,
  29. .end = 65,
  30. .flags = IORESOURCE_IRQ,
  31. },
  32. };
  33. static struct platform_device smsc911x_device = {
  34. .name = "smsc911x",
  35. .id = -1,
  36. .num_resources = ARRAY_SIZE(smsc911x_resources),
  37. .resource = smsc911x_resources,
  38. .dev = {
  39. .platform_data = &smsc911x_config,
  40. },
  41. };
  42. static struct platform_device *rsk7264_devices[] __initdata = {
  43. &smsc911x_device,
  44. };
  45. static int __init rsk7264_devices_setup(void)
  46. {
  47. return platform_add_devices(rsk7264_devices,
  48. ARRAY_SIZE(rsk7264_devices));
  49. }
  50. device_initcall(rsk7264_devices_setup);