devices-rsk7269.c 1.3 KB

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