devices-rsk7269.c 1.4 KB

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