devices-rsk7264.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * RSK+SH7264 Support.
  3. *
  4. * Copyright (C) 2012 Renesas Electronics Europe
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. */
  10. #include <linux/init.h>
  11. #include <linux/types.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/input.h>
  15. #include <linux/smsc911x.h>
  16. #include <asm/machvec.h>
  17. #include <asm/io.h>
  18. static struct smsc911x_platform_config smsc911x_config = {
  19. .phy_interface = PHY_INTERFACE_MODE_MII,
  20. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  21. .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
  22. .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
  23. };
  24. static struct resource smsc911x_resources[] = {
  25. [0] = {
  26. .start = 0x28000000,
  27. .end = 0x280000ff,
  28. .flags = IORESOURCE_MEM,
  29. },
  30. [1] = {
  31. .start = 65,
  32. .end = 65,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. static struct platform_device smsc911x_device = {
  37. .name = "smsc911x",
  38. .id = -1,
  39. .num_resources = ARRAY_SIZE(smsc911x_resources),
  40. .resource = smsc911x_resources,
  41. .dev = {
  42. .platform_data = &smsc911x_config,
  43. },
  44. };
  45. static struct platform_device *rsk7264_devices[] __initdata = {
  46. &smsc911x_device,
  47. };
  48. static int __init rsk7264_devices_setup(void)
  49. {
  50. return platform_add_devices(rsk7264_devices,
  51. ARRAY_SIZE(rsk7264_devices));
  52. }
  53. device_initcall(rsk7264_devices_setup);